From d6e0e93eed9f93ae42bdd92032483c21a57cafb1 Mon Sep 17 00:00:00 2001 From: ocoursiere Date: Sun, 22 Sep 2002 12:33:00 +0000 Subject: [PATCH] Minor update --- bepascal/bepascal/be/app/Application.cpp | 14 +++++--- bepascal/bepascal/be/app/Handler.cpp | 8 ++++- bepascal/bepascal/be/app/Looper.cpp | 5 +-- bepascal/bepascal/be/bepas_kernel/beobj.pp | 1 + bepascal/bepascal/be/interface/View.cpp | 39 +++++++++++++++++++-- bepascal/bepascal/be/interface/Window.cpp | 4 ++- bepascal/bepascal/be/interface/view.pp | 10 +++++- bepascal/bepascal/be/kernel/os.pp | 5 +++ bepascal/bepascal/be/support/supportdefs.pp | 4 +++ 9 files changed, 79 insertions(+), 11 deletions(-) diff --git a/bepascal/bepascal/be/app/Application.cpp b/bepascal/bepascal/be/app/Application.cpp index 47b3bde..7cfdcc6 100644 --- a/bepascal/bepascal/be/app/Application.cpp +++ b/bepascal/bepascal/be/app/Application.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include @@ -31,6 +31,9 @@ #include #include #include +#include + +// #include #include @@ -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) { } diff --git a/bepascal/bepascal/be/app/Handler.cpp b/bepascal/bepascal/be/app/Handler.cpp index 0770436..283023b 100644 --- a/bepascal/bepascal/be/app/Handler.cpp +++ b/bepascal/bepascal/be/app/Handler.cpp @@ -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() diff --git a/bepascal/bepascal/be/app/Looper.cpp b/bepascal/bepascal/be/app/Looper.cpp index 5f6cd7d..ce08216 100644 --- a/bepascal/bepascal/be/app/Looper.cpp +++ b/bepascal/bepascal/be/app/Looper.cpp @@ -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) { } diff --git a/bepascal/bepascal/be/bepas_kernel/beobj.pp b/bepascal/bepascal/be/bepas_kernel/beobj.pp index 8fc72c6..dd2af19 100644 --- a/bepascal/bepascal/be/bepas_kernel/beobj.pp +++ b/bepascal/bepascal/be/bepas_kernel/beobj.pp @@ -31,6 +31,7 @@ const type // BePascal types TCPlusObject = Pointer; + THandle = Pointer; TBeObject = class(TObject) private diff --git a/bepascal/bepascal/be/interface/View.cpp b/bepascal/bepascal/be/interface/View.cpp index 3fc93a6..506e3ef 100644 --- a/bepascal/bepascal/be/interface/View.cpp +++ b/bepascal/bepascal/be/interface/View.cpp @@ -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 diff --git a/bepascal/bepascal/be/interface/Window.cpp b/bepascal/bepascal/be/interface/Window.cpp index 7c31b3a..dbe0a6e 100644 --- a/bepascal/bepascal/be/interface/Window.cpp +++ b/bepascal/bepascal/be/interface/Window.cpp @@ -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) { } diff --git a/bepascal/bepascal/be/interface/view.pp b/bepascal/bepascal/be/interface/view.pp index 6ff7545..34f0efd 100644 --- a/bepascal/bepascal/be/interface/view.pp +++ b/bepascal/bepascal/be/interface/view.pp @@ -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 diff --git a/bepascal/bepascal/be/kernel/os.pp b/bepascal/bepascal/be/kernel/os.pp index 590454c..475eba2 100644 --- a/bepascal/bepascal/be/kernel/os.pp +++ b/bepascal/bepascal/be/kernel/os.pp @@ -29,6 +29,11 @@ const B_REAL_TIME_DISPLAY_PRIORITY = 100; B_URGENT_PRIORITY = 110; B_REAL_TIME_PRIORITY = 120; + +const + B_OS_NAME_LENGTH = 32; + B_PAGE_SIZE = 4096; + B_INFINITE_TIMEOUT = 9223372036854775807; type TThread_id = Longint; diff --git a/bepascal/bepascal/be/support/supportdefs.pp b/bepascal/bepascal/be/support/supportdefs.pp index 401928c..fee876b 100644 --- a/bepascal/bepascal/be/support/supportdefs.pp +++ b/bepascal/bepascal/be/support/supportdefs.pp @@ -32,6 +32,10 @@ type // TODO : import other functions ! + // import from stddef.h + TSize_t = Cardinal; + TSSize_t = Longint; + implementation