From fd0ffd303f82e645eccf4c46dae46fe581bd6300 Mon Sep 17 00:00:00 2001 From: ocoursiere Date: Wed, 5 Feb 2003 22:05:42 +0000 Subject: [PATCH] Font, ScrollView and ScrollBar. Thank's to Baldur. --- bepascal/bepascal/be/interface/Font.cpp | 692 ++++++++++++++++++ bepascal/bepascal/be/interface/ScrollBar.cpp | 635 ++++++++++++++++ bepascal/bepascal/be/interface/ScrollView.cpp | 592 +++++++++++++++ bepascal/bepascal/be/interface/font.h | 33 + bepascal/bepascal/be/interface/font.pp | 494 +++++++++++++ bepascal/bepascal/be/interface/scrollbar.pp | 284 +++++++ bepascal/bepascal/be/interface/scrollview.pp | 259 +++++++ 7 files changed, 2989 insertions(+) create mode 100644 bepascal/bepascal/be/interface/Font.cpp create mode 100644 bepascal/bepascal/be/interface/ScrollBar.cpp create mode 100644 bepascal/bepascal/be/interface/ScrollView.cpp create mode 100644 bepascal/bepascal/be/interface/font.h create mode 100644 bepascal/bepascal/be/interface/font.pp create mode 100644 bepascal/bepascal/be/interface/scrollbar.pp create mode 100644 bepascal/bepascal/be/interface/scrollview.pp diff --git a/bepascal/bepascal/be/interface/Font.cpp b/bepascal/bepascal/be/interface/Font.cpp new file mode 100644 index 0000000..51fc423 --- /dev/null +++ b/bepascal/bepascal/be/interface/Font.cpp @@ -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 + + + +BPFont::BPFont(TPasObject PasObject, const BFont &font) : BFont( font), BPasObject(PasObject) +{ +} + +BPFont::BPFont(TPasObject PasObject) : BFont(), BPasObject(PasObject) +{ +} + + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * AUTHOR: nobody + * FILE: Font.cpp + * DATE: Wed Jan 29 20:08:34 2003 + * DESCR: + ***********************************************************************/ +#include "Font.h" + +/*********************************************************************** + * Method: BFont::BFont + * Params: + * Effects: + ***********************************************************************/ +TCPlusObject BFont_Create(TPasObject PasObject) +{ + return new BPFont(PasObject); +} + + +/*********************************************************************** + * Method: BFont::BFont + * Params: const BFont &font + * Effects: + ***********************************************************************/ +TCPlusObject BFont_Create_1 +(TPasObject PasObject, const BFont &font) +{ + return new BPFont(PasObject, font); +} + + +/*********************************************************************** + * Method: BFont::BFont + * Params: const BFont *font + * Effects: + ***********************************************************************/ +TCPlusObject BFont_Create_2 +(TPasObject PasObject, const BFont *font) +{ + return new BPFont(PasObject, font); +} + +void BFont_Free +(BFont *font) +{ + //delete font; +} + + +/*********************************************************************** + * Method: BFont::SetFamilyAndStyle + * Params: const font_family family, const font_style style + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BFont_SetFamilyAndStyle(BFont *Font, const font_family family, const font_style style) +{ + //return Font->SetFamilyAndStyle(family, style); +} + + +/*********************************************************************** + * Method: BFont::SetFamilyAndStyle + * Params: uint32 code + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetFamilyAndStyle_1 +(BFont *Font, uint32 code) +{ + //Font->SetFamilyAndStyle(code); +} + + +/*********************************************************************** + * Method: BFont::SetFamilyAndFace + * Params: const font_family family, uint16 face + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BFont_SetFamilyAndFace(BFont *Font, const font_family family, uint16 face) +{ + return Font->SetFamilyAndFace(family, face); +} + + +/*********************************************************************** + * Method: BFont::SetSize + * Params: float size + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetSize(BFont *Font, float size) +{ + Font->SetSize(size); +} + + +/*********************************************************************** + * Method: BFont::SetShear + * Params: float shear + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetShear(BFont *Font, float shear) +{ + Font->SetShear(shear); +} + + +/*********************************************************************** + * Method: BFont::SetRotation + * Params: float rotation + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetRotation(BFont *Font, float rotation) +{ + Font->SetRotation(rotation); +} + + +/*********************************************************************** + * Method: BFont::SetSpacing + * Params: uint8 spacing + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetSpacing(BFont *Font, uint8 spacing) +{ + Font->SetSpacing(spacing); +} + + +/*********************************************************************** + * Method: BFont::SetEncoding + * Params: uint8 encoding + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetEncoding(BFont *Font, uint8 encoding) +{ + Font->SetEncoding(encoding); +} + + +/*********************************************************************** + * Method: BFont::SetFace + * Params: uint16 face + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetFace(BFont *Font, uint16 face) +{ + Font->SetFace(face); +} + + +/*********************************************************************** + * Method: BFont::SetFlags + * Params: uint32 flags + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_SetFlags(BFont *Font, uint32 flags) +{ + Font->SetFlags(flags); +} + + +/*********************************************************************** + * Method: BFont::GetFamilyAndStyle + * Params: font_family *family, font_style *style + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetFamilyAndStyle(BFont *Font, font_family *family, font_style *style) +{ + //Font->GetFamilyAndStyle(family, style); +} + + +/*********************************************************************** + * Method: BFont::FamilyAndStyle + * Params: + * Returns: uint32 + * Effects: + ***********************************************************************/ +uint32 +BFont_FamilyAndStyle(BFont *Font) +{ + // return Font->FamilyAndStyle(); +} + + +/*********************************************************************** + * Method: BFont::Size + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BFont_Size(BFont *Font) +{ + return Font->Size(); +} + + +/*********************************************************************** + * Method: BFont::Shear + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BFont_Shear(BFont *Font) +{ + return Font->Shear(); +} + + +/*********************************************************************** + * Method: BFont::Rotation + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BFont_Rotation(BFont *Font) +{ + return Font->Rotation(); +} + + +/*********************************************************************** + * Method: BFont::Spacing + * Params: + * Returns: uint8 + * Effects: + ***********************************************************************/ +uint8 +BFont_Spacing(BFont *Font) +{ + return Font->Spacing(); +} + + +/*********************************************************************** + * Method: BFont::Encoding + * Params: + * Returns: uint8 + * Effects: + ***********************************************************************/ +uint8 +BFont_Encoding(BFont *Font) +{ + return Font->Encoding(); +} + + +/*********************************************************************** + * Method: BFont::Face + * Params: + * Returns: uint16 + * Effects: + ***********************************************************************/ +uint16 +BFont_Face(BFont *Font) +{ + return Font->Face(); +} + + +/*********************************************************************** + * Method: BFont::Flags + * Params: + * Returns: uint32 + * Effects: + ***********************************************************************/ +uint32 +BFont_Flags(BFont *Font) +{ + return Font->Flags(); +} + + +/*********************************************************************** + * Method: BFont::Direction + * Params: + * Returns: font_direction + * Effects: + ***********************************************************************/ +font_direction +BFont_Direction(BFont *Font) +{ + return Font->Direction(); +} + + +/*********************************************************************** + * Method: BFont::IsFixed + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BFont_IsFixed(BFont *Font) +{ + return Font->IsFixed(); +} + + +/*********************************************************************** + * Method: BFont::IsFullAndHalfFixed + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BFont_IsFullAndHalfFixed(BFont *Font) +{ + return Font->IsFullAndHalfFixed(); +} + + +/*********************************************************************** + * Method: BFont::BoundingBox + * Params: + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BFont_BoundingBox(BFont *Font) +{ + return Font->BoundingBox(); +} + + +/*********************************************************************** + * Method: BFont::Blocks + * Params: + * Returns: unicode_block + * Effects: + ***********************************************************************/ +unicode_block +BFont_Blocks(BFont *Font) +{ + return Font->Blocks(); +} + + +/*********************************************************************** + * Method: BFont::FileFormat + * Params: + * Returns: font_file_format + * Effects: + ***********************************************************************/ +font_file_format +BFont_FileFormat(BFont *Font) +{ + return Font->FileFormat(); +} + + +/*********************************************************************** + * Method: BFont::CountTuned + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BFont_CountTuned(BFont *Font) +{ + return Font->CountTuned(); +} + + +/*********************************************************************** + * Method: BFont::GetTunedInfo + * Params: int32 index, tuned_font_info *info + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetTunedInfo(BFont *Font, int32 index, tuned_font_info *info) +{ + Font->GetTunedInfo(index, info); +} + + +/*********************************************************************** + * Method: BFont::TruncateString + * Params: BString *in_out, uint32 mode, float width + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_TruncateString(BFont *Font, BString *in_out, uint32 mode, float width) +{ + Font->TruncateString(in_out, mode, width); +} + + +/*********************************************************************** + * Method: BFont::GetTruncatedStrings + * Params: const char *stringArray[], int32 numStrings, uint32 mode, float width, BString resultArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetTruncatedStrings(BFont *Font, const char *stringArray[], int32 numStrings, uint32 mode, float width, BString resultArray[]) +{ + Font->GetTruncatedStrings(stringArray, numStrings, mode, width, resultArray); +} + + +/*********************************************************************** + * Method: BFont::GetTruncatedStrings + * Params: const char *stringArray[], int32 numStrings, uint32 mode, float width, char *resultArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetTruncatedStrings_1 +(BFont *Font, const char *stringArray[], int32 numStrings, uint32 mode, float width, char *resultArray[]) +{ + Font->GetTruncatedStrings(stringArray, numStrings, mode, width, resultArray); +} + + +/*********************************************************************** + * Method: BFont::StringWidth + * Params: const char *string + * Returns: float + * Effects: + ***********************************************************************/ +float +BFont_StringWidth(BFont *Font, const char *string) +{ + return Font->StringWidth(string); +} + + +/*********************************************************************** + * Method: BFont::StringWidth + * Params: const char *string, int32 length + * Returns: float + * Effects: + ***********************************************************************/ +float +BFont_StringWidth_1 +(BFont *Font, const char *string, int32 length) +{ + return Font->StringWidth(string, length); +} + + +/*********************************************************************** + * Method: BFont::GetStringWidths + * Params: const char *stringArray[], const int32 lengthArray[], int32 numStrings, float widthArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetStringWidths(BFont *Font, const char *stringArray[], const int32 lengthArray[], int32 numStrings, float widthArray[]) +{ + Font->GetStringWidths(stringArray, lengthArray, numStrings, widthArray); +} + + +/*********************************************************************** + * Method: BFont::GetEscapements + * Params: const char charArray[], int32 numChars, float escapementArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetEscapements(BFont *Font, const char charArray[], int32 numChars, float escapementArray[]) +{ + Font->GetEscapements(charArray, numChars, escapementArray); +} + + +/*********************************************************************** + * Method: BFont::GetEscapements + * Params: const char charArray[], int32 numChars, escapement_delta *delta, float escapementArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetEscapements_1 +(BFont *Font, const char charArray[], int32 numChars, escapement_delta *delta, float escapementArray[]) +{ + Font->GetEscapements(charArray, numChars, delta, escapementArray); +} + + +/*********************************************************************** + * Method: BFont::GetEscapements + * Params: const char charArray[], int32 numChars, escapement_delta *delta, BPoint escapementArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetEscapements_2 +(BFont *Font, const char charArray[], int32 numChars, escapement_delta *delta, BPoint escapementArray[]) +{ + Font->GetEscapements(charArray, numChars, delta, escapementArray); +} + + +/*********************************************************************** + * Method: BFont::GetEscapements + * Params: const char charArray[], int32 numChars, escapement_delta *delta, BPoint escapementArray[], BPoint offsetArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetEscapements_3 +(BFont *Font, const char charArray[], int32 numChars, escapement_delta *delta, BPoint escapementArray[], BPoint offsetArray[]) +{ + Font->GetEscapements(charArray, numChars, delta, escapementArray, offsetArray); +} + + +/*********************************************************************** + * Method: BFont::GetEdges + * Params: const char charArray[], int32 numBytes, edge_info edgeArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetEdges(BFont *Font, const char charArray[], int32 numBytes, edge_info edgeArray[]) +{ + Font->GetEdges(charArray, numBytes, edgeArray); +} + + +/*********************************************************************** + * Method: BFont::GetHeight + * Params: font_height *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetHeight(BFont *Font, font_height *height) +{ + Font->GetHeight(height); +} + + +/*********************************************************************** + * Method: BFont::GetBoundingBoxesAsGlyphs + * Params: const char charArray[], int32 numChars, font_metric_mode mode, BRect boundingBoxArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetBoundingBoxesAsGlyphs(BFont *Font, const char charArray[], int32 numChars, font_metric_mode mode, BRect boundingBoxArray[]) +{ + Font->GetBoundingBoxesAsGlyphs(charArray, numChars, mode, boundingBoxArray); +} + + +/*********************************************************************** + * Method: BFont::GetBoundingBoxesAsString + * Params: const char charArray[], int32 numChars, font_metric_mode mode, escapement_delta *delta, BRect boundingBoxArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetBoundingBoxesAsString(BFont *Font, const char charArray[], int32 numChars, font_metric_mode mode, escapement_delta *delta, BRect boundingBoxArray[]) +{ + Font->GetBoundingBoxesAsString(charArray, numChars, mode, delta, boundingBoxArray); +} + + +/*********************************************************************** + * Method: BFont::GetBoundingBoxesForStrings + * Params: const char *stringArray[], int32 numStrings, font_metric_mode mode, escapement_delta deltas[], BRect boundingBoxArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetBoundingBoxesForStrings(BFont *Font, const char *stringArray[], int32 numStrings, font_metric_mode mode, escapement_delta deltas[], BRect boundingBoxArray[]) +{ + Font->GetBoundingBoxesForStrings(stringArray, numStrings, mode, deltas, boundingBoxArray); +} + + +/*********************************************************************** + * Method: BFont::GetGlyphShapes + * Params: const char charArray[], int32 numChars, BShape *glyphShapeArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetGlyphShapes(BFont *Font, const char charArray[], int32 numChars, BShape *glyphShapeArray[]) +{ + Font->GetGlyphShapes(charArray, numChars, glyphShapeArray); +} + + +/*********************************************************************** + * Method: BFont::GetHasGlyphs + * Params: const char charArray[], int32 numChars, bool hasArray[] + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_GetHasGlyphs(BFont *Font, const char charArray[], int32 numChars, bool hasArray[]) +{ + Font->GetHasGlyphs(charArray, numChars, hasArray); +} + + + +/*********************************************************************** + * Method: BFont::PrintToStream + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BFont_PrintToStream(BFont *Font) +{ + Font->PrintToStream(); +} + + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _FONT_CPP_ */ + diff --git a/bepascal/bepascal/be/interface/ScrollBar.cpp b/bepascal/bepascal/be/interface/ScrollBar.cpp new file mode 100644 index 0000000..3b8238f --- /dev/null +++ b/bepascal/bepascal/be/interface/ScrollBar.cpp @@ -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 + * FILE: StringView.cpp + * DATE: Mon Jan 13 21:52:29 2003 + * DESCR: + ***********************************************************************/ +#include "ScrollBar.h" +#include "view.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(__cplusplus) +} +#endif + +class BPScrollBar : public BScrollBar,virtual public BPView { + +public: + BPScrollBar(TPasObject PasObject, + BRect frame, + const char *name, + BView *target, + float min, + float max, + orientation direction); + BPScrollBar(TPasObject PasObject,BMessage *data); + +//static BArchivable *Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; + +virtual void AttachedToWindow(); + +virtual void MessageReceived(BMessage *msg); +virtual void MouseDown(BPoint pt); +virtual void MouseUp(BPoint pt); +virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); +virtual void Draw(BRect updateRect); +virtual void FrameMoved(BPoint new_position); +virtual void FrameResized(float new_width, float new_height); + +virtual void AllAttached(); +virtual void AllDetached(); + +private: + +}; + +BPScrollBar::BPScrollBar(TPasObject PasObject, + BRect frame, + const char *name, + BView *target, + float min, + float max, + orientation direction) + : + BScrollBar( frame, + name, + target, + min, + max, + direction), + BPView(PasObject, BRect(0,0,0,0), name, 0, 0), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + +BPScrollBar::BPScrollBar(TPasObject PasObject, BMessage *data) + :BScrollBar(data), + BPView(PasObject, data), + BPHandler(PasObject, data), + BPasObject(PasObject) +{ +} + +void BPScrollBar::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BScrollBar::MessageReceived(message); +} + +void BPScrollBar::Draw(BRect updateRect) +{ + BScrollBar::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPScrollBar::AttachedToWindow(void) +{ + BScrollBar::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + + +void BPScrollBar::AllAttached(void) +{ + BScrollBar::AllAttached(); +} + +void BPScrollBar::AllDetached(void) +{ + BScrollBar::AllDetached(); +} + + + +void BPScrollBar::FrameMoved(BPoint parentPoint) +{ + BScrollBar::FrameMoved(parentPoint); +} + +void BPScrollBar::FrameResized(float width, float height) +{ + BScrollBar::FrameResized(width, height); +} + + + + +void BPScrollBar::MouseDown(BPoint point) +{ + BScrollBar::MouseDown(point); +} + +void BPScrollBar::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BScrollBar::MouseMoved(point, transit, message); +} + +void BPScrollBar::MouseUp(BPoint point) +{ + BScrollBar::MouseUp(point); +} + + + + + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * AUTHOR: nobody + * FILE: ScrollBar.cpp + * DATE: Sun Feb 2 15:49:13 2003 + * DESCR: + ***********************************************************************/ + +/*********************************************************************** + * Method: BScrollBar::BScrollBar + * Params: BRect frame, const char *name, BView *target, float min, float max, orientation direction + * Effects: + ***********************************************************************/ +TCPlusObject BScrollBar_Create(TPasObject PasObject, BRect frame, const char *name, BView *target, float min, float max, orientation direction) +{ + return new BPScrollBar(PasObject, frame, name, target, min, max, direction); +} + + +/*********************************************************************** + * Method: BScrollBar::BScrollBar + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BScrollBar_Create_1 +(TPasObject PasObject, BMessage *data) +{ + return new BPScrollBar(PasObject, data); +} + + +/*********************************************************************** + * Method: BScrollBar::~BScrollBar + * Params: + * Effects: + ***********************************************************************/ +void BScrollBar_Free(BScrollBar *ScrollBar) +{ + delete ScrollBar; +} + + +/*********************************************************************** + * Method: BScrollBar::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BScrollBar_Instantiate(BScrollBar *ScrollBar, BMessage *data) +{ + return ScrollBar->Instantiate(data); +} + + +/*********************************************************************** + * Method: BScrollBar::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollBar_Archive(BScrollBar *ScrollBar, BMessage *data, bool deep) +{ + return ScrollBar->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BScrollBar::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_AttachedToWindow(BScrollBar *ScrollBar) +{ + ScrollBar->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BScrollBar::SetValue + * Params: float value + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetValue(BScrollBar *ScrollBar, float value) +{ + ScrollBar->SetValue(value); +} + + +/*********************************************************************** + * Method: BScrollBar::Value + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BScrollBar_Value(BScrollBar *ScrollBar) +{ + return ScrollBar->Value(); +} + + +/*********************************************************************** + * Method: BScrollBar::SetProportion + * Params: float + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetProportion(BScrollBar *ScrollBar, float value) +{ + ScrollBar->SetProportion(value); +} + + +/*********************************************************************** + * Method: BScrollBar::Proportion + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BScrollBar_Proportion(BScrollBar *ScrollBar) +{ + return ScrollBar->Proportion(); +} + + +/*********************************************************************** + * Method: BScrollBar::ValueChanged + * Params: float newValue + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_ValueChanged(BScrollBar *ScrollBar, float newValue) +{ + ScrollBar->ValueChanged(newValue); +} + + +/*********************************************************************** + * Method: BScrollBar::SetRange + * Params: float min, float max + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetRange(BScrollBar *ScrollBar, float min, float max) +{ + ScrollBar->SetRange(min, max); +} + + +/*********************************************************************** + * Method: BScrollBar::GetRange + * Params: float *min, float *max + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_GetRange(BScrollBar *ScrollBar, float *min, float *max) +{ + ScrollBar->GetRange(min, max); +} + + +/*********************************************************************** + * Method: BScrollBar::SetSteps + * Params: float smallStep, float largeStep + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetSteps(BScrollBar *ScrollBar, float smallStep, float largeStep) +{ + ScrollBar->SetSteps(smallStep, largeStep); +} + + +/*********************************************************************** + * Method: BScrollBar::GetSteps + * Params: float *smallStep, float *largeStep + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_GetSteps(BScrollBar *ScrollBar, float *smallStep, float *largeStep) +{ + ScrollBar->GetSteps(smallStep, largeStep); +} + + +/*********************************************************************** + * Method: BScrollBar::SetTarget + * Params: BView *target + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetTarget(BScrollBar *ScrollBar, BView *target) +{ + ScrollBar->SetTarget(target); +} + + +/*********************************************************************** + * Method: BScrollBar::SetTarget + * Params: const char *targetName + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_SetTarget_1 +(BScrollBar *ScrollBar, const char *targetName) +{ + ScrollBar->SetTarget(targetName); +} + + +/*********************************************************************** + * Method: BScrollBar::Target + * Params: + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BScrollBar_Target(BScrollBar *ScrollBar) +{ + return ScrollBar->Target(); +} + + +/*********************************************************************** + * Method: BScrollBar::Orientation + * Params: + * Returns: orientation + * Effects: + ***********************************************************************/ +orientation +BScrollBar_Orientation(BScrollBar *ScrollBar) +{ + return ScrollBar->Orientation(); +} + + +/*********************************************************************** + * Method: BScrollBar::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_MessageReceived(BScrollBar *ScrollBar, BMessage *msg) +{ + ScrollBar->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BScrollBar::MouseDown + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_MouseDown(BScrollBar *ScrollBar, BPoint pt) +{ + ScrollBar->MouseDown(pt); +} + + +/*********************************************************************** + * Method: BScrollBar::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_MouseUp(BScrollBar *ScrollBar, BPoint pt) +{ + ScrollBar->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BScrollBar::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_MouseMoved(BScrollBar *ScrollBar, BPoint pt, uint32 code, const BMessage *msg) +{ + ScrollBar->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BScrollBar::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_DetachedFromWindow(BScrollBar *ScrollBar) +{ + ScrollBar->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BScrollBar::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_Draw(BScrollBar *ScrollBar, BRect updateRect) +{ + ScrollBar->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BScrollBar::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_FrameMoved(BScrollBar *ScrollBar, BPoint new_position) +{ + ScrollBar->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BScrollBar::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_FrameResized(BScrollBar *ScrollBar, float new_width, float new_height) +{ + ScrollBar->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BScrollBar::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BScrollBar_ResolveSpecifier(BScrollBar *ScrollBar, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return ScrollBar->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BScrollBar::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_ResizeToPreferred(BScrollBar *ScrollBar) +{ + ScrollBar->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BScrollBar::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_GetPreferredSize(BScrollBar *ScrollBar, float *width, float *height) +{ + ScrollBar->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BScrollBar::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_MakeFocus(BScrollBar *ScrollBar, bool state) +{ + ScrollBar->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BScrollBar::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_AllAttached(BScrollBar *ScrollBar) +{ + ScrollBar->AllAttached(); +} + + +/*********************************************************************** + * Method: BScrollBar::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollBar_AllDetached(BScrollBar *ScrollBar) +{ + ScrollBar->AllDetached(); +} + + +/*********************************************************************** + * Method: BScrollBar::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollBar_GetSupportedSuites(BScrollBar *ScrollBar, BMessage *data) +{ + return ScrollBar->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BScrollBar::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollBar_Perform(BScrollBar *ScrollBar, perform_code d, void *arg) +{ + return ScrollBar->Perform(d, arg); +} + + + + +#if defined(__cplusplus) +} +#endif + +#endif /* SCROLLBAR_CPP */ + diff --git a/bepascal/bepascal/be/interface/ScrollView.cpp b/bepascal/bepascal/be/interface/ScrollView.cpp new file mode 100644 index 0000000..53dfcd6 --- /dev/null +++ b/bepascal/bepascal/be/interface/ScrollView.cpp @@ -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 + * FILE: StringView.cpp + * DATE: Mon Jan 13 21:52:29 2003 + * DESCR: + ***********************************************************************/ +#include "ScrollView.h" +#include "view.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(__cplusplus) +} +#endif + +class BPScrollView : public BScrollView, virtual public BPView { + +public: + BPScrollView( + TPasObject PasObject, + const char *name, + BView *target, + uint32 resizeMask = B_FOLLOW_LEFT | + B_FOLLOW_TOP, + uint32 flags = 0, + bool horizontal = false, + bool vertical = false, + border_style border = B_FANCY_BORDER); + BPScrollView(TPasObject PasObject,BMessage *data); +//virtual ~BScrollView(); +static BArchivable *Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; + +virtual void Draw(BRect updateRect); +virtual void AttachedToWindow(); + + +virtual void MessageReceived(BMessage *msg); +virtual void MouseDown(BPoint pt); +virtual void WindowActivated(bool state); +virtual void MouseUp(BPoint pt); +virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); +virtual void DetachedFromWindow(); +virtual void AllAttached(); +virtual void AllDetached(); +//virtual void FrameMoved(BPoint new_position); +virtual void FrameResized(float new_width, float new_height); + + +//virtual void ResizeToPreferred(); +//virtual void GetPreferredSize(float *width, float *height); +//virtual void MakeFocus(bool state = true); + +/*----- Private or reserved -----------------------------------------*/ + +private: +}; + +BPScrollView::BPScrollView(TPasObject PasObject, + const char *name, + BView *target, + uint32 resizeMask = B_FOLLOW_LEFT | + B_FOLLOW_TOP, + uint32 flags = 0, + bool horizontal = false, + bool vertical = false, + border_style border = B_FANCY_BORDER) + : + BScrollView(name, + target, + resizeMask, + flags, + horizontal, + vertical, + border), + BPView(PasObject, BRect(0,0,0,0), name, 0, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + + + +BPScrollView::BPScrollView(TPasObject PasObject, BMessage *data) + :BScrollView(data), + BPView(PasObject, data), + BPHandler(PasObject, data), + BPasObject(PasObject) +{ +} + + + + +void BPScrollView::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BScrollView::MessageReceived(message); +} + +void BPScrollView::Draw(BRect updateRect) +{ + BScrollView::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPScrollView::AttachedToWindow(void) +{ + //BTextView::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + + +void BPScrollView::AllAttached(void) +{ + BScrollView::AllAttached(); +} + +void BPScrollView::AllDetached(void) +{ + BScrollView::AllDetached(); +} + + +void BPScrollView::WindowActivated(bool active) +{ + BScrollView::WindowActivated(active); +} + + + +void BPScrollView::FrameResized(float width, float height) +{ + BScrollView::FrameResized(width, height); +} + +void BPScrollView::DetachedFromWindow(void) +{ + BScrollView::DetachedFromWindow(); +} + + + +void BPScrollView::MouseDown(BPoint point) +{ + BScrollView::MouseDown(point); +} + +void BPScrollView::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BScrollView::MouseMoved(point, transit, message); +} + +void BPScrollView::MouseUp(BPoint point) +{ + BScrollView::MouseUp(point); +} + + +#if defined(__cplusplus) +extern "C" { +#endif + + +/*********************************************************************** + * AUTHOR: nobody + * FILE: ScrollView.cpp + * DATE: Sun Feb 2 20:53:19 2003 + * DESCR: + ***********************************************************************/ + +/*********************************************************************** + * Method: BScrollView::BScrollView + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BScrollView_Create(TPasObject PasObject, + const char *name, + BView *target, + uint32 resizeMask = B_FOLLOW_LEFT | + B_FOLLOW_TOP, + uint32 flags = 0, + bool horizontal = false, + bool vertical = false, + border_style border = B_FANCY_BORDER) +{ + return new BPScrollView(PasObject, name,target,resizeMask,flags,horizontal,vertical,border); +} + +TCPlusObject BScrollView_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPScrollView(PasObject, data); +} + + +/*********************************************************************** + * Method: BScrollView::~BScrollView + * Params: + * Effects: + ***********************************************************************/ +void BScrollView_Free(BScrollView *ScrollView) +{ + delete ScrollView; +} + + +/*********************************************************************** + * Method: BScrollView::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BScrollView_Instantiate(BScrollView *ScrollView, BMessage *data) +{ + return ScrollView->Instantiate(data); +} + + +/*********************************************************************** + * Method: BScrollView::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollView_Archive(BScrollView *ScrollView, BMessage *data, bool deep) +{ + return ScrollView->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BScrollView::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_Draw(BScrollView *ScrollView, BRect updateRect) +{ + ScrollView->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BScrollView::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_AttachedToWindow(BScrollView *ScrollView) +{ + ScrollView->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BScrollView::ScrollBar + * Params: orientation flag + * Returns: BScrollBar * + * Effects: + ***********************************************************************/ +BScrollBar * +BScrollView_ScrollBar(BScrollView *ScrollView, orientation flag) +{ + return ScrollView->ScrollBar(flag); +} + + +/*********************************************************************** + * Method: BScrollView::SetBorder + * Params: border_style border + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_SetBorder(BScrollView *ScrollView, border_style border) +{ + ScrollView->SetBorder(border); +} + + +/*********************************************************************** + * Method: BScrollView::Border + * Params: + * Returns: border_style + * Effects: + ***********************************************************************/ +border_style +BScrollView_Border(BScrollView *ScrollView) +{ + return ScrollView->Border(); +} + + +/*********************************************************************** + * Method: BScrollView::SetBorderHighlighted + * Params: bool state + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollView_SetBorderHighlighted(BScrollView *ScrollView, bool state) +{ + return ScrollView->SetBorderHighlighted(state); +} + + +/*********************************************************************** + * Method: BScrollView::IsBorderHighlighted + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BScrollView_IsBorderHighlighted(BScrollView *ScrollView) +{ + return ScrollView->IsBorderHighlighted(); +} + + +/*********************************************************************** + * Method: BScrollView::SetTarget + * Params: BView *new_target + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_SetTarget(BScrollView *ScrollView, BView *new_target) +{ + ScrollView->SetTarget(new_target); +} + + +/*********************************************************************** + * Method: BScrollView::Target + * Params: + * Returns: BView * + * Effects: + ***********************************************************************/ +BView * +BScrollView_Target(BScrollView *ScrollView) +{ + return ScrollView->Target(); +} + + +/*********************************************************************** + * Method: BScrollView::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_MessageReceived(BScrollView *ScrollView, BMessage *msg) +{ + ScrollView->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BScrollView::MouseDown + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_MouseDown(BScrollView *ScrollView, BPoint pt) +{ + ScrollView->MouseDown(pt); +} + + +/*********************************************************************** + * Method: BScrollView::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_WindowActivated(BScrollView *ScrollView, bool state) +{ + ScrollView->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BScrollView::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_MouseUp(BScrollView *ScrollView, BPoint pt) +{ + ScrollView->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BScrollView::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_MouseMoved(BScrollView *ScrollView, BPoint pt, uint32 code, const BMessage *msg) +{ + ScrollView->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BScrollView::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_DetachedFromWindow(BScrollView *ScrollView) +{ + ScrollView->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BScrollView::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_AllAttached(BScrollView *ScrollView) +{ + ScrollView->AllAttached(); +} + + +/*********************************************************************** + * Method: BScrollView::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_AllDetached(BScrollView *ScrollView) +{ + ScrollView->AllDetached(); +} + + +/*********************************************************************** + * Method: BScrollView::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_FrameMoved(BScrollView *ScrollView, BPoint new_position) +{ + ScrollView->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BScrollView::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_FrameResized(BScrollView *ScrollView, float new_width, float new_height) +{ + ScrollView->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BScrollView::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BScrollView_ResolveSpecifier(BScrollView *ScrollView, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return ScrollView->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BScrollView::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_ResizeToPreferred(BScrollView *ScrollView) +{ + ScrollView->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BScrollView::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_GetPreferredSize(BScrollView *ScrollView, float *width, float *height) +{ + ScrollView->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BScrollView::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BScrollView_MakeFocus(BScrollView *ScrollView, bool state) +{ + ScrollView->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BScrollView::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollView_GetSupportedSuites(BScrollView *ScrollView, BMessage *data) +{ + return ScrollView->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BScrollView::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BScrollView_Perform(BScrollView *ScrollView, perform_code d, void *arg) +{ + return ScrollView->Perform(d, arg); +} + + + + +#if defined(__cplusplus) +} +#endif + +#endif /* _SSCROLLVIEW_CPP_ */ + diff --git a/bepascal/bepascal/be/interface/font.h b/bepascal/bepascal/be/interface/font.h new file mode 100644 index 0000000..fcadc30 --- /dev/null +++ b/bepascal/bepascal/be/interface/font.h @@ -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 + +class BPFont : public BFont, public BPasObject +{ + public: + BPFont(TPasObject PasObject); + BPFont(TPasObject PasObject, const BFont &font); +}; + +#endif _FONT_H_ /* _FONT_H_ */ diff --git a/bepascal/bepascal/be/interface/font.pp b/bepascal/bepascal/be/interface/font.pp new file mode 100644 index 0000000..366ab06 --- /dev/null +++ b/bepascal/bepascal/be/interface/font.pp @@ -0,0 +1,494 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit font; + +interface + +uses + beobj,flattenable,interfacedefs,supportdefs,rect,bstring; + +type + Tfont_which= ( + font_which_nil, + B_PLAIN_FONT, + B_BOLD_FONT, + B_FIXED_FONT, + B_SYMBOL_FONT, + B_SERIF_FONT +); + +const + B__NUM_FONT = 5; + // Attention this is hexadecimal; need conversion !!!! + B_ITALIC_FACE = $0001; + B_UNDERSCORE_FACE = $0002; + B_NEGATIVE_FACE = $0004; + B_OUTLINED_FACE = $0008; + B_STRIKEOUT_FACE = $0010; + B_BOLD_FACE = $0020; + B_REGULAR_FACE = $0040; + +type + +Tfont_metric_mode = ( + B_SCREEN_METRIC, + B_PRINTING_METRIC); + + Tfont_file_format =( + B_TRUETYPE_WINDOWS , + B_POSTSCRIPT_TYPE1_WINDOWS +); + + +const B_FONT_FAMILY_LENGTH= 63; + +type TFONT_FAMILY = array[0..B_FONT_FAMILY_LENGTH] of char; + +const B_FONT_STYLE_LENGTH= 63; + +type Tfont_style = array[0..B_FONT_STYLE_LENGTH ] of char; + +type +Tescapement_delta = record + nonspace : real; + space: real; +end; +Tedge_info = record + left: real; + right: real; +end; +Ttuned_font_info = record + size : real; + shear: real ; + rotation : real; + flags: cardinal; + face : integer; +end; + + + +Tfont_height = record + ascent: real; + descent: real; + leading: real; +end; + +Tfont_direction =( + B_FONT_LEFT_TO_RIGHT , + B_FONT_RIGHT_TO_LEFT +); + + + +type + TFont = class(TBeObject) + private + public + constructor Create; + constructor Create(font : TFont);virtual; + destructor Destroy;override; + function SetFamilyAndStyle(family : TFONT_FAMILY; style : Tfont_style) : TStatus_t; + procedure SetFamilyAndStyle(code : Cardinal); + function SetFamilyAndFace(family : TFONT_FAMILY; aface : integer) : TStatus_t; + procedure SetSize(asize : single); + procedure SetShear(ashear : single); + procedure SetRotation(arotation : single); + procedure SetSpacing(aspacing : integer); + procedure SetEncoding(aencoding : integer); + procedure SetFace(aface :integer ); + procedure SetFlags(aflags : Cardinal); + procedure GetFamilyAndStyle(family : TFONT_FAMILY; style : Tfont_style); + function FamilyAndStyle : Cardinal; + function Size : single; + function Shear : single; + function Rotation : single; + function Spacing : integer; + function Encoding : integer; + function Face : integer; + function Flags : Cardinal; + function Direction : Tfont_direction; + function IsFixed : boolean; + function IsFullAndHalfFixed : boolean; + function BoundingBox : TRect; +// function Blocks : ; + function FileFormat : Tfont_file_format; + function CountTuned : integer; + procedure GetTunedInfo(index : integer; info : Ttuned_font_info); + procedure TruncateString(in_out : TString; mode : Cardinal; width : single); +// procedure GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : Pchar); +// procedure GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar); + function StringWidth(astring : PChar) : single; + function StringWidth(astring : PChar; length : integer) : single; +// procedure GetStringWidths(stringArray : PChar; lengthArray : integer; numStrings : integer; widthArray : single); +// procedure GetEscapements(charArray : ; numChars : integer; escapementArray : single); +// procedure GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : single); + // procedure GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint); + // procedure GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint; offsetArray : TPoint); + // procedure GetEdges(charArray : ; numBytes : integer; edgeArray : ); + procedure GetHeight(height : Tfont_height); + // procedure GetBoundingBoxesAsGlyphs(charArray : ; numChars : integer; mode : ; boundingBoxArray : TRect); + // procedure GetBoundingBoxesAsString(charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : TRect); + // procedure GetBoundingBoxesForStrings(stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : TRect); +// procedure GetGlyphShapes(charArray : ; numChars : integer; glyphShapeArray : ); + // procedure GetHasGlyphs(charArray : ; numChars : integer; hasArray : boolean); + procedure PrintToStream; + end; + +{procedure edge_info_float left(AObject : TCPlusObject); cdecl; external BePascalLibName name 'edge_info_float left'; +procedure edge_info_float right(AObject : TCPlusObject); cdecl; external BePascalLibName name 'edge_info_float right'; +procedure font_height_float ascent(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_height_float ascent'; +procedure font_height_float descent(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_height_float descent'; +procedure font_height_float leading(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_height_float leading'; +procedure escapement_delta_float nonspace(AObject : TCPlusObject); cdecl; external BePascalLibName name 'escapement_delta_float nonspace'; +procedure escapement_delta_float space(AObject : TCPlusObject); cdecl; external BePascalLibName name 'escapement_delta_float space'; +procedure font_cache_info_int32 sheared_font_penalty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 sheared_font_penalty'; +procedure font_cache_info_int32 rotated_font_penalty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 rotated_font_penalty'; +procedure font_cache_info_float oversize_threshold(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_float oversize_threshold'; +procedure font_cache_info_int32 oversize_penalty(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 oversize_penalty'; +procedure font_cache_info_int32 cache_size(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_int32 cache_size'; +procedure font_cache_info_float spacing_size_threshold(AObject : TCPlusObject); cdecl; external BePascalLibName name 'font_cache_info_float spacing_size_threshold'; +procedure tuned_font_info_float size(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_float size'; +procedure tuned_font_info_float shear(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_float shear'; +procedure tuned_font_info_float rotation(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_float rotation'; +procedure tuned_font_info_uint32 flags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_uint32 flags'; +procedure tuned_font_info_uint16 face(AObject : TCPlusObject); cdecl; external BePascalLibName name 'tuned_font_info_uint16 face'; +} + +function BFont_Create(AObject : TBeObject): TCPlusObject; cdecl; external BePascalLibName name 'BFont_Create'; +function BFont_Create(AObject : TBeObject; font : TFont): TCPlusObject; cdecl; external BePascalLibName name 'BFont_Create_1'; +procedure BFont_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_Free'; +function BFont_SetFamilyAndStyle(AObject : TCPlusObject; family : Tfont_family; style : Tfont_style) : TStatus_t; cdecl; external BePascalLibName name 'BFont_SetFamilyAndStyle'; +procedure BFont_SetFamilyAndStyle(AObject : TCPlusObject; code : Cardinal); cdecl; external BePascalLibName name 'BFont_SetFamilyAndStyle'; +function BFont_SetFamilyAndFace(AObject : TCPlusObject; family : Tfont_family; face : integer) : TStatus_t; cdecl; external BePascalLibName name 'BFont_SetFamilyAndFace'; +procedure BFont_SetSize(AObject : TCPlusObject; size : single); cdecl; external BePascalLibName name 'BFont_SetSize'; +procedure BFont_SetShear(AObject : TCPlusObject; shear : single); cdecl; external BePascalLibName name 'BFont_SetShear'; +procedure BFont_SetRotation(AObject : TCPlusObject; rotation : single); cdecl; external BePascalLibName name 'BFont_SetRotation'; +procedure BFont_SetSpacing(AObject : TCPlusObject; spacing : integer); cdecl; external BePascalLibName name 'BFont_SetSpacing'; +procedure BFont_SetEncoding(AObject : TCPlusObject; encoding : integer); cdecl; external BePascalLibName name 'BFont_SetEncoding'; +procedure BFont_SetFace(AObject : TCPlusObject; face :integer ); cdecl; external BePascalLibName name 'BFont_SetFace'; +procedure BFont_SetFlags(AObject : TCPlusObject; flags : Cardinal); cdecl; external BePascalLibName name 'BFont_SetFlags'; +procedure BFont_GetFamilyAndStyle(AObject : TCPlusObject; family : Tfont_family; style : Tfont_style); cdecl; external BePascalLibName name 'BFont_GetFamilyAndStyle'; +function BFont_FamilyAndStyle(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BFont_FamilyAndStyle'; +function BFont_Size(AObject : TCPlusObject) : single; cdecl; external BePascalLibName name 'BFont_Size'; +function BFont_Shear(AObject : TCPlusObject) : single; cdecl; external BePascalLibName name 'BFont_Shear'; +function BFont_Rotation(AObject : TCPlusObject) : single; cdecl; external BePascalLibName name 'BFont_Rotation'; +function BFont_Spacing(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_Spacing'; +function BFont_Encoding(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_Encoding'; +function BFont_Face(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_Face'; +function BFont_Flags(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BFont_Flags'; +function BFont_Direction(AObject : TCPlusObject) : Tfont_direction; cdecl; external BePascalLibName name 'BFont_Direction'; +function BFont_IsFixed(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BFont_IsFixed'; +function BFont_IsFullAndHalfFixed(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BFont_IsFullAndHalfFixed'; +function BFont_BoundingBox(AObject : TCPlusObject) : TRect; cdecl; external BePascalLibName name 'BFont_BoundingBox'; +//function BFont_Blocks(AObject : TCPlusObject) : ; cdecl; external BePascalLibName name 'BFont_Blocks'; +function BFont_FileFormat(AObject : TCPlusObject) :Tfont_file_format ; cdecl; external BePascalLibName name 'BFont_FileFormat'; +function BFont_CountTuned(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BFont_CountTuned'; +procedure BFont_GetTunedInfo(AObject : TCPlusObject; index : integer; info : Ttuned_font_info); cdecl; external BePascalLibName name 'BFont_GetTunedInfo'; +procedure BFont_TruncateString(AObject : TCPlusObject; in_out : TCPlusObject; mode : Cardinal; width : single); cdecl; external BePascalLibName name 'BFont_TruncateString'; +//procedure BFont_GetTruncatedStrings(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : ); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings'; +//procedure BFont_GetTruncatedStrings(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings'; +function BFont_StringWidth(AObject : TCPlusObject; astring : PChar) : single; cdecl; external BePascalLibName name 'BFont_StringWidth'; +function BFont_StringWidth(AObject : TCPlusObject; astring : PChar; length : integer) : single; cdecl; external BePascalLibName name 'BFont_StringWidth'; +//procedure BFont_GetStringWidths(AObject : TCPlusObject; stringArray : PChar; lengthArray : ; numStrings : integer; widthArray : single); cdecl; external BePascalLibName name 'BFont_GetStringWidths'; +//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; escapementArray : single); cdecl; external BePascalLibName name 'BFont_GetEscapements'; +//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; escapementArray : single); cdecl; external BePascalLibName name 'BFont_GetEscapements'; +//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; escapementArray : TPoint); cdecl; external BePascalLibName name 'BFont_GetEscapements'; +//procedure BFont_GetEscapements(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; escapementArray : TPoint; offsetArray : TPoint); cdecl; external BePascalLibName name 'BFont_GetEscapements'; +//procedure BFont_GetEdges(AObject : TCPlusObject; charArray : ; numBytes : integer; edgeArray : ); cdecl; external BePascalLibName name 'BFont_GetEdges'; +procedure BFont_GetHeight(AObject : TCPlusObject; height :Tfont_height ); cdecl; external BePascalLibName name 'BFont_GetHeight'; + +{procedure BFont_GetBoundingBoxesAsGlyphs(AObject : TCPlusObject; charArray : ; numChars : integer; mode : ; boundingBoxArray : TRect); cdecl; external BePascalLibName name 'BFont_GetBoundingBoxesAsGlyphs'; +procedure BFont_GetBoundingBoxesAsString(AObject : TCPlusObject; charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : TRect); cdecl; external BePascalLibName name 'BFont_GetBoundingBoxesAsString'; +procedure BFont_GetBoundingBoxesForStrings(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : TRect); cdecl; external BePascalLibName name 'BFont_GetBoundingBoxesForStrings'; +procedure BFont_GetGlyphShapes(AObject : TCPlusObject; charArray : ; numChars : integer; glyphShapeArray : ); cdecl; external BePascalLibName name 'BFont_GetGlyphShapes'; +procedure BFont_GetHasGlyphs(AObject : TCPlusObject; charArray : ; numChars : integer; hasArray : boolean); cdecl; external BePascalLibName name 'BFont_GetHasGlyphs'; +function BFont_operator=(AObject : TCPlusObject; font : ) : ; cdecl; external BePascalLibName name 'BFont_operator='; +function BFont_operator==(AObject : TCPlusObject; font : ) : boolean; cdecl; external BePascalLibName name 'BFont_operator=='; +function BFont_operator!=(AObject : TCPlusObject; font : ) : boolean; cdecl; external BePascalLibName name 'BFont_operator!='; +} +procedure BFont_PrintToStream(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_PrintToStream'; +{procedure BFont_uint16 fFamilyID(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint16 fFamilyID'; +procedure BFont_uint16 fStyleID(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint16 fStyleID'; +procedure BFont_float fSize(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_float fSize'; +procedure BFont_float fShear(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_float fShear'; +procedure BFont_float fRotation(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_float fRotation'; +procedure BFont_uint8 fSpacing(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint8 fSpacing'; +procedure BFont_uint8 fEncoding(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint8 fEncoding'; +procedure BFont_uint16 fFace(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint16 fFace'; +procedure BFont_uint32 fFlags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint32 fFlags'; +procedure BFont_font_height fHeight(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_font_height fHeight'; +procedure BFont_int32 fPrivateFlags(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_int32 fPrivateFlags'; +procedure BFont_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BFont_uint32 _reserved[2]'; +procedure BFont_SetPacket(AObject : TCPlusObject; packet : Pointer); cdecl; external BePascalLibName name 'BFont_SetPacket'; +procedure BFont_GetTruncatedStrings64(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings64'; +procedure BFont_GetTruncatedStrings64(AObject : TCPlusObject; stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : ); cdecl; external BePascalLibName name 'BFont_GetTruncatedStrings64'; +procedure BFont__GetEscapements_(AObject : TCPlusObject; charArray : ; numChars : integer; delta : ; mode : ; escapements : single; offsets : single); cdecl; external BePascalLibName name 'BFont__GetEscapements_'; +procedure BFont__GetBoundingBoxes_(AObject : TCPlusObject; charArray : ; numChars : integer; mode : ; string_escapement : boolean; delta : ; boundingBoxArray : TRect); cdecl; external BePascalLibName name 'BFont__GetBoundingBoxes_'; +} +implementation + + +constructor TFont.Create; +begin + inherited Create; + CPlusObject := BFont_Create(Self); +end; + +constructor TFont.Create(font : TFont); +begin + inherited Create; + CPlusObject := BFont_Create(Self, font); +end; + +destructor TFont.Destroy; +begin + if CPlusObject <> nil then + BFont_Free(CPlusObject); + inherited; +end; + +function TFont.SetFamilyAndStyle(family : Tfont_family; style :Tfont_style ) : TStatus_t; +begin + Result := BFont_SetFamilyAndStyle(CPlusObject, family, style); +end; + +procedure TFont.SetFamilyAndStyle(code : Cardinal); +begin + BFont_SetFamilyAndStyle(CPlusObject, code); +end; + +function TFont.SetFamilyAndFace(family : Tfont_family; aface : integer) : TStatus_t; +begin + Result := BFont_SetFamilyAndFace(CPlusObject, family, aface); +end; + +procedure TFont.SetSize(asize : single); +begin + BFont_SetSize(CPlusObject, asize); +end; + +procedure TFont.SetShear(ashear : single); +begin + BFont_SetShear(CPlusObject, ashear); +end; + +procedure TFont.SetRotation(arotation : single); +begin + BFont_SetRotation(CPlusObject, arotation); +end; + +procedure TFont.SetSpacing(aspacing : integer); +begin + BFont_SetSpacing(CPlusObject, aspacing); +end; + +procedure TFont.SetEncoding(aencoding : integer); +begin + BFont_SetEncoding(CPlusObject, aencoding); +end; + +procedure TFont.SetFace(aface : integer); +begin + BFont_SetFace(CPlusObject, aface); +end; + +procedure TFont.SetFlags(aflags : Cardinal); +begin + BFont_SetFlags(CPlusObject, aflags); +end; + +procedure TFont.GetFamilyAndStyle(family : Tfont_family; style :Tfont_style ); +begin + BFont_GetFamilyAndStyle(CPlusObject, family, style); +end; + +function TFont.FamilyAndStyle : Cardinal; +begin + Result := BFont_FamilyAndStyle(CPlusObject); +end; + +function TFont.Size : single; +begin + Result := BFont_Size(CPlusObject); +end; + +function TFont.Shear : single; +begin + Result := BFont_Shear(CPlusObject); +end; + +function TFont.Rotation : single; +begin + Result := BFont_Rotation(CPlusObject); +end; + +function TFont.Spacing : integer; +begin + Result := BFont_Spacing(CPlusObject); +end; + +function TFont.Encoding : integer; +begin + Result := BFont_Encoding(CPlusObject); +end; + +function TFont.Face : integer; +begin + Result := BFont_Face(CPlusObject); +end; + +function TFont.Flags : Cardinal; +begin + Result := BFont_Flags(CPlusObject); +end; + +function TFont.Direction : Tfont_direction; +begin + Result := BFont_Direction(CPlusObject); +end; + +function TFont.IsFixed : boolean; +begin + Result := BFont_IsFixed(CPlusObject); +end; + +function TFont.IsFullAndHalfFixed : boolean; +begin + Result := BFont_IsFullAndHalfFixed(CPlusObject); +end; + +function TFont.BoundingBox : TRect; +begin + Result := BFont_BoundingBox(CPlusObject); +end; + +{function TFont.Blocks : ; +begin + Result := BFont_Blocks(CPlusObject); +end; +} +function TFont.FileFormat : Tfont_file_format; +begin + Result := BFont_FileFormat(CPlusObject); +end; + +function TFont.CountTuned : integer; +begin + Result := BFont_CountTuned(CPlusObject); +end; + +procedure TFont.GetTunedInfo(index : integer; info : Ttuned_font_info); +begin + BFont_GetTunedInfo(CPlusObject, index, info); +end; + +procedure TFont.TruncateString(in_out : TString; mode : Cardinal; width : single); +begin + BFont_TruncateString(CPlusObject, in_out.CPlusObject, mode, width); +end; + +{procedure TFont.GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : ); +begin + BFont_GetTruncatedStrings(CPlusObject, stringArray, numStrings, mode, width, resultArray.CPlusObject); +end; + +procedure TFont.GetTruncatedStrings(stringArray : PChar; numStrings : integer; mode : Cardinal; width : single; resultArray : PChar); +begin + BFont_GetTruncatedStrings(CPlusObject, stringArray, numStrings, mode, width, resultArray); +end; +} + +function TFont.StringWidth(astring : PChar) : single; +begin + Result := BFont_StringWidth(CPlusObject, astring); +end; + +function TFont.StringWidth(astring : PChar; length : integer) : single; +begin + Result := BFont_StringWidth(CPlusObject, astring, length); +end; + +{procedure TFont.GetStringWidths(stringArray : PChar; lengthArray : integer ; numStrings : integer; widthArray : single); +begin + BFont_GetStringWidths(CPlusObject, stringArray, lengthArray, numStrings, widthArray); +end; + +procedure TFont.GetEscapements(charArray : PChar; numChars : integer; escapementArray : single); +begin + BFont_GetEscapements(CPlusObject, charArray, numChars, escapementArray); +end; + +procedure TFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : single); +begin + BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray); +end; + +procedure TFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint); +begin + BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray.CPlusObject); +end; + +procedure TFont.GetEscapements(charArray : ; numChars : integer; delta : ; escapementArray : TPoint; offsetArray : TPoint); +begin + BFont_GetEscapements(CPlusObject, charArray, numChars, delta, escapementArray.CPlusObject, offsetArray.CPlusObject); +end; + +procedure TFont.GetEdges(charArray : ; numBytes : integer; edgeArray : ); +begin + BFont_GetEdges(CPlusObject, charArray, numBytes, edgeArray); +end; +} +procedure TFont.GetHeight(height :Tfont_height ); +begin + BFont_GetHeight(CPlusObject, height); +end; + +{ +procedure TFont.GetBoundingBoxesAsGlyphs(charArray : ; numChars : integer; mode : ; boundingBoxArray : TRect); +begin + BFont_GetBoundingBoxesAsGlyphs(CPlusObject, charArray, numChars, mode, boundingBoxArray.CPlusObject); +end; + +procedure TFont.GetBoundingBoxesAsString(charArray : ; numChars : integer; mode : ; delta : ; boundingBoxArray : TRect); +begin + BFont_GetBoundingBoxesAsString(CPlusObject, charArray, numChars, mode, delta, boundingBoxArray.CPlusObject); +end; + +procedure TFont.GetBoundingBoxesForStrings(stringArray : PChar; numStrings : integer; mode : ; deltas : ; boundingBoxArray : TRect); +begin + BFont_GetBoundingBoxesForStrings(CPlusObject, stringArray, numStrings, mode, deltas, boundingBoxArray.CPlusObject); +end; + +procedure TFont.GetGlyphShapes(charArray : ; numChars : integer; glyphShapeArray : ); +begin + BFont_GetGlyphShapes(CPlusObject, charArray, numChars, glyphShapeArray.CPlusObject); +end; + +procedure TFont.GetHasGlyphs(charArray : ; numChars : integer; hasArray : boolean); +begin + BFont_GetHasGlyphs(CPlusObject, charArray, numChars, hasArray); +end; +} +procedure TFont.PrintToStream; +begin + BFont_PrintToStream(CPlusObject); +end; + + +end. diff --git a/bepascal/bepascal/be/interface/scrollbar.pp b/bepascal/bepascal/be/interface/scrollbar.pp new file mode 100644 index 0000000..e70a54b --- /dev/null +++ b/bepascal/bepascal/be/interface/scrollbar.pp @@ -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 + TScrollBar = class(TView) + private + public + constructor Create(frame : TRect; name : pchar; atarget : TView; min,max : real; direction : Torientation); + constructor Create_1(data : TMessage); + destructor Destroy;override; + function Instantiate(data : TMessage) : TArchivable; + function Archive(data : TMessage; deep : boolean) : TStatus_t; + procedure AttachedToWindow;override; + procedure SetValue(avalue : double); + function Value : double; + procedure SetProportion( avalue: double); + function Proportion : double; + procedure ValueChanged(newValue : double); + procedure SetRange(min : double; max : double); + procedure GetRange(min : double; max : double); + procedure SetSteps(smallStep : double; largeStep : double); + procedure GetSteps(smallStep : double; largeStep : double); + procedure SetTarget(atarget : TView); + procedure SetTarget(targetName : PChar); + function Target : TView; + function Orientation : TOrientation; + procedure MessageReceived(msg : TMessage);override; + procedure MouseDown(pt : TPoint);override; + procedure MouseUp(pt : TPoint);override; + procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);override; + procedure DetachedFromWindow;override; + procedure Draw(updateRect : TRect);override; + procedure FrameMoved(new_position : TPoint);override; + procedure FrameResized(new_width : double; new_height : double);override; + function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; + procedure ResizeToPreferred;override; + procedure GetPreferredSize(width : double; height : double); + procedure MakeFocus(state : boolean); + procedure AllAttached;override; + procedure AllDetached;override; + function GetSupportedSuites(data : TMessage) : TStatus_t; + function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; + end; + +function BScrollBar_Create(AObject : TBeObject;frame : TCPlusObject; name : pchar; target : TCPlusObject; min,max : real; direction : Torientation): TCPlusObject; cdecl; external BePascalLibName name 'BScrollBar_Create'; +function BScrollBar_Create_1(AObject : TBeObject; data : TCPlusObject):TCPlusObject; cdecl; external BePascalLibName name 'BScrollBar_Create_1'; +procedure BScrollBar_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_Free'; +function BScrollBar_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : TArchivable; cdecl; external BePascalLibName name 'BScrollBar_Instantiate'; +function BScrollBar_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BScrollBar_Archive'; +procedure BScrollBar_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_AttachedToWindow'; +procedure BScrollBar_SetValue(AObject : TCPlusObject; value : double); cdecl; external BePascalLibName name 'BScrollBar_SetValue'; +function BScrollBar_Value(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BScrollBar_Value'; +procedure BScrollBar_SetProportion(AObject : TCPlusObject; avalue: double); cdecl; external BePascalLibName name 'BScrollBar_SetProportion'; +function BScrollBar_Proportion(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BScrollBar_Proportion'; +procedure BScrollBar_ValueChanged(AObject : TCPlusObject; newValue : double); cdecl; external BePascalLibName name 'BScrollBar_ValueChanged'; +procedure BScrollBar_SetRange(AObject : TCPlusObject; min : double; max : double); cdecl; external BePascalLibName name 'BScrollBar_SetRange'; +procedure BScrollBar_GetRange(AObject : TCPlusObject; min : double; max : double); cdecl; external BePascalLibName name 'BScrollBar_GetRange'; +procedure BScrollBar_SetSteps(AObject : TCPlusObject; smallStep : double; largeStep : double); cdecl; external BePascalLibName name 'BScrollBar_SetSteps'; +procedure BScrollBar_GetSteps(AObject : TCPlusObject; smallStep : double; largeStep : double); cdecl; external BePascalLibName name 'BScrollBar_GetSteps'; +procedure BScrollBar_SetTarget(AObject : TCPlusObject; target : TView); cdecl; external BePascalLibName name 'BScrollBar_SetTarget'; +procedure BScrollBar_SetTarget(AObject : TCPlusObject; targetName : PChar); cdecl; external BePascalLibName name 'BScrollBar_SetTarget'; +function BScrollBar_Target(AObject : TCPlusObject) : TView; cdecl; external BePascalLibName name 'BScrollBar_Target'; +function BScrollBar_Orientation(AObject : TCPlusObject) : TOrientation; cdecl; external BePascalLibName name 'BScrollBar_Orientation'; +procedure BScrollBar_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_MessageReceived'; +procedure BScrollBar_MouseDown(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_MouseDown'; +procedure BScrollBar_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_MouseUp'; +procedure BScrollBar_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TMessage); cdecl; external BePascalLibName name 'BScrollBar_MouseMoved'; +procedure BScrollBar_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_DetachedFromWindow'; +procedure BScrollBar_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_Draw'; +procedure BScrollBar_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_FrameMoved'; +procedure BScrollBar_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BScrollBar_FrameResized'; +function BScrollBar_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : THandler; cdecl; external BePascalLibName name 'BScrollBar_ResolveSpecifier'; +procedure BScrollBar_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_ResizeToPreferred'; +procedure BScrollBar_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BScrollBar_GetPreferredSize'; +procedure BScrollBar_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BScrollBar_MakeFocus'; +procedure BScrollBar_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_AllAttached'; +procedure BScrollBar_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollBar_AllDetached'; +function BScrollBar_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BScrollBar_GetSupportedSuites'; +function BScrollBar_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BScrollBar_Perform'; + +implementation + +constructor TScrollBar.Create(frame : TRect; name : pchar; atarget : TView; min,max : real; direction : Torientation); +begin + CreatePas; + CPlusObject := BScrollBar_Create(Self,frame.CPlusObject, name, target.CPlusObject,min,max, direction ); +end; + +constructor TScrollBar.Create_1(data : TMessage); +begin + CreatePas; + CPlusObject := BScrollBar_Create_1(Self, data.CPlusObject); +end; + +destructor TScrollBar.Destroy; +begin + BScrollBar_Free(CPlusObject); + inherited; +end; + +function TScrollBar.Instantiate(data : TMessage) : TArchivable; +begin + Result := BScrollBar_Instantiate(CPlusObject, data.CPlusObject); +end; + +function TScrollBar.Archive(data : TMessage; deep : boolean) : TStatus_t; +begin + Result := BScrollBar_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure TScrollBar.AttachedToWindow; +begin + // BScrollBar_AttachedToWindow(CPlusObject); +end; + +procedure TScrollBar.SetValue(avalue : double); +begin + BScrollBar_SetValue(CPlusObject, avalue); +end; + +function TScrollBar.Value : double; +begin + Result := BScrollBar_Value(CPlusObject); +end; + +procedure TScrollBar.SetProportion( avalue: double); +begin + BScrollBar_SetProportion(CPlusObject, avalue); +end; + +function TScrollBar.Proportion : double; +begin + Result := BScrollBar_Proportion(CPlusObject); +end; + +procedure TScrollBar.ValueChanged(newValue : double); +begin + BScrollBar_ValueChanged(CPlusObject, newValue); +end; + +procedure TScrollBar.SetRange(min : double; max : double); +begin + BScrollBar_SetRange(CPlusObject, min, max); +end; + +procedure TScrollBar.GetRange(min : double; max : double); +begin + BScrollBar_GetRange(CPlusObject, min, max); +end; + +procedure TScrollBar.SetSteps(smallStep : double; largeStep : double); +begin + BScrollBar_SetSteps(CPlusObject, smallStep, largeStep); +end; + +procedure TScrollBar.GetSteps(smallStep : double; largeStep : double); +begin + BScrollBar_GetSteps(CPlusObject, smallStep, largeStep); +end; + +procedure TScrollBar.SetTarget(atarget : TView); +begin + BScrollBar_SetTarget(CPlusObject, target.CPlusObject); +end; + +procedure TScrollBar.SetTarget(targetName : PChar); +begin + BScrollBar_SetTarget(CPlusObject, targetName); +end; + +function TScrollBar.Target : TView; +begin + Result := BScrollBar_Target(CPlusObject); +end; + +function TScrollBar.Orientation : TOrientation; +begin + Result := BScrollBar_Orientation(CPlusObject); +end; + +procedure TScrollBar.MessageReceived(msg : TMessage); +begin + // BScrollBar_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure TScrollBar.MouseDown(pt : TPoint); +begin +// BScrollBar_MouseDown(CPlusObject, pt.CPlusObject); +end; + +procedure TScrollBar.MouseUp(pt : TPoint); +begin +// BScrollBar_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure TScrollBar.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); +begin +// BScrollBar_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure TScrollBar.DetachedFromWindow; +begin + // BScrollBar_DetachedFromWindow(CPlusObject); +end; + +procedure TScrollBar.Draw(updateRect : TRect); +begin + //BScrollBar_Draw(CPlusObject, updateRect.CPlusObject); +end; + +procedure TScrollBar.FrameMoved(new_position : TPoint); +begin +// BScrollBar_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure TScrollBar.FrameResized(new_width : double; new_height : double); +begin +// BScrollBar_FrameResized(CPlusObject, new_width, new_height); +end; + +function TScrollBar.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; +begin + Result := BScrollBar_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +procedure TScrollBar.ResizeToPreferred; +begin +// BScrollBar_ResizeToPreferred(CPlusObject); +end; + +procedure TScrollBar.GetPreferredSize(width : double; height : double); +begin + BScrollBar_GetPreferredSize(CPlusObject, width, height); +end; + +procedure TScrollBar.MakeFocus(state : boolean); +begin + BScrollBar_MakeFocus(CPlusObject, state); +end; + +procedure TScrollBar.AllAttached; +begin + BScrollBar_AllAttached(CPlusObject); +end; + +procedure TScrollBar.AllDetached; +begin + BScrollBar_AllDetached(CPlusObject); +end; + +function TScrollBar.GetSupportedSuites(data : TMessage) : TStatus_t; +begin + Result := BScrollBar_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function TScrollBar.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; +begin + Result := BScrollBar_Perform(CPlusObject, d, arg); +end; + + +end. diff --git a/bepascal/bepascal/be/interface/scrollview.pp b/bepascal/bepascal/be/interface/scrollview.pp new file mode 100644 index 0000000..a2e1dd0 --- /dev/null +++ b/bepascal/bepascal/be/interface/scrollview.pp @@ -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 + TScrollView = class(TView) + private + public + constructor Create(name : pchar; + atarget :TView; + resizeMask : longint; + flags : longint; + horizontal, + vertical : boolean; + aborder :Tborder_style ); virtual; + destructor Destroy;override; + function Instantiate(data : TMessage) : TArchivable; + function Archive(data : TMessage; deep : boolean) : TStatus_t; + procedure Draw(updateRect : TRect);override; + procedure AttachedToWindow;override; + function ScrollBar(flag : TOrientation) : TScrollBar; + procedure SetBorder(aborder : Tborder_style); + function Border : Tborder_style; + function SetBorderHighlighted(state : boolean) : TStatus_t; + function IsBorderHighlighted : boolean; + procedure SetTarget(new_target : TView); + function Target : TView; + procedure MessageReceived(msg : TMessage);override; + procedure MouseDown(pt : TPoint);override; + procedure WindowActivated(state : boolean);override; + procedure MouseUp(pt : TPoint);override; + procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage);override; + procedure DetachedFromWindow;override; + procedure AllAttached;override; + procedure AllDetached;override; + procedure FrameMoved(new_position : TPoint);override; + procedure FrameResized(new_width : double; new_height : double);override; + function ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; + procedure ResizeToPreferred;override; + procedure GetPreferredSize(width : double; height : double); + procedure MakeFocus(state : boolean); + function GetSupportedSuites(data : TMessage) : TStatus_t; + function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; + end; + +function BScrollView_Create(AObject : TBeObject;name : pchar;target :TCPlusObject; resizeMask : longint; flags : longint;horizontal,vertical : boolean;border :Tborder_style ):TCPlusObject; cdecl; external BePascalLibName name 'BScrollView_Create'; +//function BScrollView_Create_1(AObject : TBeObject):TCPlusObject; cdecl; external BePascalLibName name 'BScrollView_Create_1'; +procedure BScrollView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_Free'; +function BScrollView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : TArchivable; cdecl; external BePascalLibName name 'BScrollView_Instantiate'; +function BScrollView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BScrollView_Archive'; +procedure BScrollView_Draw(AObject : TCPlusObject; updateRect : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_Draw'; +procedure BScrollView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_AttachedToWindow'; +function BScrollView_ScrollBar(AObject : TCPlusObject; flag : TOrientation) : TScrollBar; cdecl; external BePascalLibName name 'BScrollView_ScrollBar'; +procedure BScrollView_SetBorder(AObject : TCPlusObject; border : Tborder_style); cdecl; external BePascalLibName name 'BScrollView_SetBorder'; +function BScrollView_Border(AObject : TCPlusObject) : Tborder_style; cdecl; external BePascalLibName name 'BScrollView_Border'; +function BScrollView_SetBorderHighlighted(AObject : TCPlusObject; state : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BScrollView_SetBorderHighlighted'; +function BScrollView_IsBorderHighlighted(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BScrollView_IsBorderHighlighted'; +procedure BScrollView_SetTarget(AObject : TCPlusObject; new_target : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_SetTarget'; +function BScrollView_Target(AObject : TCPlusObject) : TView; cdecl; external BePascalLibName name 'BScrollView_Target'; +procedure BScrollView_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MessageReceived'; +procedure BScrollView_MouseDown(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MouseDown'; +procedure BScrollView_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BScrollView_WindowActivated'; +procedure BScrollView_MouseUp(AObject : TCPlusObject; pt : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MouseUp'; +procedure BScrollView_MouseMoved(AObject : TCPlusObject; pt : TCPlusObject; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_MouseMoved'; +procedure BScrollView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_DetachedFromWindow'; +procedure BScrollView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_AllAttached'; +procedure BScrollView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_AllDetached'; +procedure BScrollView_FrameMoved(AObject : TCPlusObject; new_position : TPoint); cdecl; external BePascalLibName name 'BScrollView_FrameMoved'; +procedure BScrollView_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BScrollView_FrameResized'; +function BScrollView_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : THandler; cdecl; external BePascalLibName name 'BScrollView_ResolveSpecifier'; +procedure BScrollView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BScrollView_ResizeToPreferred'; +procedure BScrollView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BScrollView_GetPreferredSize'; +procedure BScrollView_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BScrollView_MakeFocus'; +function BScrollView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BScrollView_GetSupportedSuites'; +function BScrollView_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BScrollView_Perform'; + +implementation + +constructor TScrollView.Create(name : pchar; + atarget :TView; + resizeMask : longint; + flags : longint; + horizontal, + vertical : boolean; + aborder :Tborder_style ); +begin + CreatePas; + CPlusObject := BScrollView_Create(Self,name,atarget.CplusObject,resizeMask,flags,horizontal,vertical,aborder); + +end; + + + +destructor TScrollView.Destroy; +begin + BScrollView_Free(CPlusObject); + inherited; +end; + +function TScrollView.Instantiate(data : TMessage) : TArchivable; +begin + Result := BScrollView_Instantiate(CPlusObject, data.CPlusObject); +end; + +function TScrollView.Archive(data : TMessage; deep : boolean) : TStatus_t; +begin + Result := BScrollView_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure TScrollView.Draw(updateRect : TRect); +begin +// BScrollView_Draw(CPlusObject, updateRect.CPlusObject); +end; + +procedure TScrollView.AttachedToWindow; +begin + //BScrollView_AttachedToWindow(CPlusObject); +end; + +function TScrollView.ScrollBar(flag : TOrientation) : TScrollBar; +begin + Result := BScrollView_ScrollBar(CPlusObject, flag); +end; + +procedure TScrollView.SetBorder(aborder : Tborder_style); +begin + BScrollView_SetBorder(CPlusObject, aborder); +end; + +function TScrollView.Border : Tborder_style; +begin + Result := BScrollView_Border(CPlusObject); +end; + +function TScrollView.SetBorderHighlighted(state : boolean) : TStatus_t; +begin + Result := BScrollView_SetBorderHighlighted(CPlusObject, state); +end; + +function TScrollView.IsBorderHighlighted : boolean; +begin + Result := BScrollView_IsBorderHighlighted(CPlusObject); +end; + +procedure TScrollView.SetTarget(new_target : TView); +begin + BScrollView_SetTarget(CPlusObject, new_target.CPlusObject); +end; + +function TScrollView.Target : TView; +begin + Result := BScrollView_Target(CPlusObject); +end; + +procedure TScrollView.MessageReceived(msg : TMessage); +begin + inherited; + //BScrollView_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure TScrollView.MouseDown(pt : TPoint); +begin +// BScrollView_MouseDown(CPlusObject, pt.CPlusObject); +end; + +procedure TScrollView.WindowActivated(state : boolean); +begin + //BScrollView_WindowActivated(CPlusObject, state); +end; + +procedure TScrollView.MouseUp(pt : TPoint); +begin + //BScrollView_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure TScrollView.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); +begin + //BScrollView_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure TScrollView.DetachedFromWindow; +begin + //BScrollView_DetachedFromWindow(CPlusObject); +end; + +procedure TScrollView.AllAttached; +begin + //BScrollView_AllAttached(CPlusObject); +end; + +procedure TScrollView.AllDetached; +begin + //BScrollView_AllDetached(CPlusObject); +end; + +procedure TScrollView.FrameMoved(new_position : TPoint); +begin +// BScrollView_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure TScrollView.FrameResized(new_width : double; new_height : double); +begin + //BScrollView_FrameResized(CPlusObject, new_width, new_height); +end; + +function TScrollView.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; +begin + Result := BScrollView_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +procedure TScrollView.ResizeToPreferred; +begin + BScrollView_ResizeToPreferred(CPlusObject); +end; + +procedure TScrollView.GetPreferredSize(width : double; height : double); +begin + BScrollView_GetPreferredSize(CPlusObject, width, height); +end; + +procedure TScrollView.MakeFocus(state : boolean); +begin + BScrollView_MakeFocus(CPlusObject, state); +end; + +function TScrollView.GetSupportedSuites(data : TMessage) : TStatus_t; +begin + Result := BScrollView_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function TScrollView.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; +begin + Result := BScrollView_Perform(CPlusObject, d, arg); +end; + + +end.