From 056bdc3373a46b628f97d7e9d0265274cfee0664 Mon Sep 17 00:00:00 2001 From: ocoursiere Date: Wed, 22 Jan 2003 23:39:29 +0000 Subject: [PATCH] BTextView and BRadioButton support --- .../bepascal/be/interface/RadioButton.cpp | 628 +++++++ bepascal/bepascal/be/interface/TextView.cpp | 1672 +++++++++++++++++ bepascal/bepascal/be/interface/radiobutton.pp | 270 +++ bepascal/bepascal/be/interface/textview.pp | 835 ++++++++ 4 files changed, 3405 insertions(+) create mode 100644 bepascal/bepascal/be/interface/RadioButton.cpp create mode 100644 bepascal/bepascal/be/interface/TextView.cpp create mode 100644 bepascal/bepascal/be/interface/radiobutton.pp create mode 100644 bepascal/bepascal/be/interface/textview.pp diff --git a/bepascal/bepascal/be/interface/RadioButton.cpp b/bepascal/bepascal/be/interface/RadioButton.cpp new file mode 100644 index 0000000..a411770 --- /dev/null +++ b/bepascal/bepascal/be/interface/RadioButton.cpp @@ -0,0 +1,628 @@ +/* BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2003 Olivier Coursiere + Eric Jourde + Oscar Lesta + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _RADIOBUTTON_CPP_ +#define _RADIOBUTTON_CPP_ + +/*********************************************************************** + * AUTHOR: nobody + * FILE: RadioButton.cpp + * DATE: Mon Jan 20 02:30:54 2003 + * DESCR: + ***********************************************************************/ +#include "RadioButton.h" + +#include "control.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(__cplusplus) +} +#endif + +class BPRadioButton : public BRadioButton, virtual public BPControl { + +public: + BPRadioButton(TPasObject PasObject, + BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizMask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + //virtual ~BRadioButton(); + +/* Archiving */ + BPRadioButton(TPasObject PasObject, BMessage *data); + + //static BArchivable *Instantiate(BMessage *data); + //virtual status_t Archive(BMessage *data, bool deep = true) const; + virtual void Draw(BRect updateRect); + virtual void MouseDown(BPoint where); + virtual void AttachedToWindow(); + virtual void KeyDown(const char *bytes, int32 numBytes); + virtual void SetValue(int32 value); + virtual void GetPreferredSize(float *width, float *height); + virtual void ResizeToPreferred(); + //virtual status_t Invoke(BMessage *msg = NULL); + + virtual void MessageReceived(BMessage *msg); + virtual void WindowActivated(bool state); + virtual void MouseUp(BPoint pt); + virtual void MouseMoved(BPoint pt, uint32 code, const BMessage *msg); + virtual void DetachedFromWindow(); + virtual void FrameMoved(BPoint new_position); + virtual void FrameResized(float new_width, float new_height); +/* + virtual BHandler *ResolveSpecifier(BMessage *msg, + int32 index, + BMessage *specifier, + int32 form, + const char *property); +*/ + //virtual void MakeFocus(bool state = true); + virtual void AllAttached(); +// virtual void AllDetached(); +// virtual status_t GetSupportedSuites(BMessage *data); + + +/*----- Private or reserved -----------------------------------------*/ +//virtual status_t Perform(perform_code d, void *arg); + +private: + /*friend status_t _init_interface_kit_(); + + virtual void _ReservedRadioButton1(); + virtual void _ReservedRadioButton2(); + + BRadioButton &operator=(const BRadioButton &); + static BBitmap *sBitmaps[2][3]; + + bool fOutlined; + uint32 _reserved[2];*/ +}; + +BPRadioButton::BPRadioButton(TPasObject PasObject, + BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 rmask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE) + : + BRadioButton(frame,name,label, + message,rmask,flags), + BPControl(PasObject, frame, name, label, message, + rmask, flags), + BPView(PasObject, frame, name, rmask, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + + +BPRadioButton::BPRadioButton(TPasObject PasObject, BMessage *archive) + :BRadioButton(archive), + BPControl(PasObject, archive), + BPView(PasObject, archive), + BPHandler(PasObject, archive), + BPasObject(PasObject) +{ + +} + + +void BPRadioButton::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BRadioButton::MessageReceived(message); +} + +void BPRadioButton::Draw(BRect updateRect) +{ + BRadioButton::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPRadioButton::AttachedToWindow(void) +{ + BRadioButton::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + +void BPRadioButton::WindowActivated(bool active) +{ + BRadioButton::WindowActivated(active); +} + +void BPRadioButton::KeyDown(const char *bytes, int32 numBytes) +{ + BRadioButton::KeyDown(bytes, numBytes); +} + + +void BPRadioButton::AllAttached(void) +{ + BRadioButton::AllAttached(); +} +/* +void BPRadioButton::AllDetached(void) +{ + BRadioButton::AllDetached(); +} +*/ +void BPRadioButton::DetachedFromWindow(void) +{ + BRadioButton::DetachedFromWindow(); +} + + +void BPRadioButton::FrameMoved(BPoint parentPoint) +{ + BRadioButton::FrameMoved(parentPoint); +} + +void BPRadioButton::FrameResized(float width, float height) +{ + BRadioButton::FrameResized(width, height); +} + +void BPRadioButton::GetPreferredSize(float *width, float *height) +{ + BRadioButton::GetPreferredSize(width, height); +} + +void BPRadioButton::ResizeToPreferred(void) +{ + BRadioButton::ResizeToPreferred(); +} + + +void BPRadioButton::MouseDown(BPoint point) +{ + BRadioButton::MouseDown(point); +} + +void BPRadioButton::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BRadioButton::MouseMoved(point, transit, message); +} + +void BPRadioButton::MouseUp(BPoint point) +{ + BRadioButton::MouseUp(point); +} + + +//void BPButton::TargetedByScrollView(BScrollView *scroller) +//{ +// BButton::TargetedByScrollView(scroller); +//} + + +void BPRadioButton::SetValue(int32 value) +{ + BRadioButton::SetValue(value); +} + + + +#if defined(__cplusplus) +extern "C" { +#endif + + +/*********************************************************************** + * Method: BRadioButton::~BRadioButton + * Params: + * Effects: + ***********************************************************************/ +void BRadioButton_FREE(BRadioButton *RadioButton) +{ + delete RadioButton; +} + +TCPlusObject BRadioButton_Create(TPasObject PasObject, BRect frame, + const char *name, + const char *label, + BMessage *message, + uint32 resizeMask , + uint32 flags ) +{ + return new BPRadioButton( PasObject, frame, + name, + label, + message, + resizeMask , + flags ); +} + + +/*********************************************************************** + * Method: BRadioButton::BRadioButton + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BRadioButton_Create_1(TPasObject PasObject, BMessage *data) +{ + return new BPRadioButton(PasObject, data); +} + + +/*********************************************************************** + * Method: BRadioButton::~BRadioButton + * Params: + * Effects: + ***********************************************************************/ +/*BRadioButton_~BRadioButton(BRadioButton *RadioButton) +{ + return RadioButton->~BRadioButton(); +} +*/ + +/*********************************************************************** + * Method: BRadioButton::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BRadioButton_Instantiate(BRadioButton *RadioButton, BMessage *data) +{ + return RadioButton->Instantiate(data); +} + + +/*********************************************************************** + * Method: BRadioButton::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRadioButton_Archive(BRadioButton *RadioButton, BMessage *data, bool deep) +{ + return RadioButton->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BRadioButton::Draw + * Params: BRect updateRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_Draw(BRadioButton *RadioButton, BRect updateRect) +{ + RadioButton->Draw(updateRect); +} + + +/*********************************************************************** + * Method: BRadioButton::MouseDown + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_MouseDown(BRadioButton *RadioButton, BPoint where) +{ + RadioButton->MouseDown(where); +} + + +/*********************************************************************** + * Method: BRadioButton::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_AttachedToWindow(BRadioButton *RadioButton) +{ + RadioButton->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BRadioButton::KeyDown + * Params: const char *bytes, int32 numBytes + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_KeyDown(BRadioButton *RadioButton, const char *bytes, int32 numBytes) +{ + RadioButton->KeyDown(bytes, numBytes); +} + + +/*********************************************************************** + * Method: BRadioButton::SetValue + * Params: int32 value + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_SetValue(BRadioButton *RadioButton, int32 value) +{ + RadioButton->SetValue(value); +} + + +/*********************************************************************** + * Method: BRadioButton::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_GetPreferredSize(BRadioButton *RadioButton, float *width, float *height) +{ + RadioButton->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BRadioButton::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_ResizeToPreferred(BRadioButton *RadioButton) +{ + RadioButton->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BRadioButton::Invoke + * Params: BMessage *msg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRadioButton_Invoke(BRadioButton *RadioButton, BMessage *msg) +{ + return RadioButton->Invoke(msg); +} + + +/*********************************************************************** + * Method: BRadioButton::MessageReceived + * Params: BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_MessageReceived(BRadioButton *RadioButton, BMessage *msg) +{ + RadioButton->MessageReceived(msg); +} + + +/*********************************************************************** + * Method: BRadioButton::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_WindowActivated(BRadioButton *RadioButton, bool state) +{ + RadioButton->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BRadioButton::MouseUp + * Params: BPoint pt + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_MouseUp(BRadioButton *RadioButton, BPoint pt) +{ + RadioButton->MouseUp(pt); +} + + +/*********************************************************************** + * Method: BRadioButton::MouseMoved + * Params: BPoint pt, uint32 code, const BMessage *msg + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_MouseMoved(BRadioButton *RadioButton, BPoint pt, uint32 code, const BMessage *msg) +{ + RadioButton->MouseMoved(pt, code, msg); +} + + +/*********************************************************************** + * Method: BRadioButton::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_DetachedFromWindow(BRadioButton *RadioButton) +{ + RadioButton->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BRadioButton::FrameMoved + * Params: BPoint new_position + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_FrameMoved(BRadioButton *RadioButton, BPoint new_position) +{ + RadioButton->FrameMoved(new_position); +} + + +/*********************************************************************** + * Method: BRadioButton::FrameResized + * Params: float new_width, float new_height + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_FrameResized(BRadioButton *RadioButton, float new_width, float new_height) +{ + RadioButton->FrameResized(new_width, new_height); +} + + +/*********************************************************************** + * Method: BRadioButton::ResolveSpecifier + * Params: BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BRadioButton_ResolveSpecifier(BRadioButton *RadioButton, BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return RadioButton->ResolveSpecifier(msg, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BRadioButton::MakeFocus + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_MakeFocus(BRadioButton *RadioButton, bool state) +{ + RadioButton->MakeFocus(state); +} + + +/*********************************************************************** + * Method: BRadioButton::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_AllAttached(BRadioButton *RadioButton) +{ + RadioButton->AllAttached(); +} + + +/*********************************************************************** + * Method: BRadioButton::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BRadioButton_AllDetached(BRadioButton *RadioButton) +{ + RadioButton->AllDetached(); +} + + +/*********************************************************************** + * Method: BRadioButton::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRadioButton_GetSupportedSuites(BRadioButton *RadioButton, BMessage *data) +{ + return RadioButton->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BRadioButton::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BRadioButton_Perform(BRadioButton *RadioButton, perform_code d, void *arg) +{ + return RadioButton->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BRadioButton::_ReservedRadioButton1 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRadioButton__ReservedRadioButton1(BRadioButton *RadioButton) +{ + RadioButton->_ReservedRadioButton1(); +} +*/ + +/*********************************************************************** + * Method: BRadioButton::_ReservedRadioButton2 + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +/*void +BRadioButton__ReservedRadioButton2(BRadioButton *RadioButton) +{ + RadioButton->_ReservedRadioButton2(); +} +*/ + +/*********************************************************************** + * Method: BRadioButton::operator= + * Params: const BRadioButton & + * Returns: BRadioButton & + * Effects: + ***********************************************************************/ +/*BRadioButton & +BRadioButton_operator=(BRadioButton *RadioButton, const BRadioButton &) +{ + return RadioButton->operator=(); +} +*/ +#if defined(__cplusplus) +} +#endif + +#endif /* _RADIOBUTTON_CPP_ */ diff --git a/bepascal/bepascal/be/interface/TextView.cpp b/bepascal/bepascal/be/interface/TextView.cpp new file mode 100644 index 0000000..3bb9544 --- /dev/null +++ b/bepascal/bepascal/be/interface/TextView.cpp @@ -0,0 +1,1672 @@ +/* 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 _TEXTVIEW_CPP_ +#define _TEXTVIEW_CPP_ +/*********************************************************************** + * AUTHOR: nobody + * FILE: StringView.cpp + * DATE: Mon Jan 13 21:52:29 2003 + * DESCR: + ***********************************************************************/ +#include "TextView.h" +#include "view.h" +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(__cplusplus) +} +#endif + +class BPTextView : public BTextView, virtual public BPView { +public: + BPTextView(TPasObject PasObject, + BRect frame, + const char *name, + BRect textRect, + uint32 resizeMask, + uint32 flags = B_WILL_DRAW | B_PULSE_NEEDED); + BPTextView(TPasObject PasObject, + BRect frame, + const char *name, + BRect textRect, + const BFont *initialFont, + const rgb_color *initialColor, + uint32 resizeMask, + uint32 flags); + BPTextView(TPasObject PasObject,BMessage *data); + +static BArchivable* Instantiate(BMessage *data); +//virtual status_t Archive(BMessage *data, bool deep = true) const; + +virtual void AttachedToWindow(); +virtual void DetachedFromWindow(); +virtual void Draw(BRect inRect); +virtual void MouseDown(BPoint where); +virtual void MouseUp(BPoint where); +virtual void MouseMoved(BPoint where, + uint32 code, + const BMessage *message); +virtual void WindowActivated(bool state); +virtual void KeyDown(const char *bytes, int32 numBytes); +virtual void Pulse(); +virtual void FrameResized(float width, float height); +//virtual void MakeFocus(bool focusState = true); +virtual void MessageReceived(BMessage *message); +/*virtual BHandler* ResolveSpecifier(BMessage *message, + int32 index, + BMessage *specifier, + int32 form, + const char *property);*/ +//virtual status_t GetSupportedSuites(BMessage *data); +//virtual status_t Perform(perform_code d, void *arg); + + void SetText(const char *inText, + const text_run_array *inRuns = NULL); + void SetText(const char *inText, + int32 inLength, + const text_run_array *inRuns = NULL); + void SetText(BFile *inFile, + int32 startOffset, + int32 inLength, + const text_run_array *inRuns = NULL); + + void Insert(const char *inText, + const text_run_array *inRuns = NULL); + void Insert(const char *inText, + int32 inLength, + const text_run_array *inRuns = NULL); + void Insert(int32 startOffset, + const char *inText, + int32 inLength, + const text_run_array *inRuns = NULL); + + void Delete(); + void Delete(int32 startOffset, int32 endOffset); + + const char* Text() const; + int32 TextLength() const; + void GetText(int32 offset, + int32 length, + char *buffer) const; + uchar ByteAt(int32 offset) const; + + int32 CountLines() const; + int32 CurrentLine() const; + void GoToLine(int32 lineNum); + +//virtual void Cut(BClipboard *clipboard); +//virtual void Copy(BClipboard *clipboard); +//virtual void Paste(BClipboard *clipboard); + void Clear(); + +//virtual bool AcceptsPaste(BClipboard *clipboard); +//virtual bool AcceptsDrop(const BMessage *inMessage); + +//virtual void Select(int32 startOffset, int32 endOffset); + void SelectAll(); + void GetSelection(int32 *outStart, int32 *outEnd) const; + + void SetFontAndColor(const BFont *inFont, + uint32 inMode = B_FONT_ALL, + const rgb_color *inColor = NULL); + void SetFontAndColor(int32 startOffset, + int32 endOffset, + const BFont *inFont, + uint32 inMode = B_FONT_ALL, + const rgb_color *inColor = NULL); + + void GetFontAndColor(int32 inOffset, + BFont *outFont, + rgb_color *outColor = NULL) const; + void GetFontAndColor(BFont *outFont, + uint32 *outMode, + rgb_color *outColor = NULL, + bool *outEqColor = NULL) const; + + void SetRunArray(int32 startOffset, + int32 endOffset, + const text_run_array *inRuns); + text_run_array* RunArray(int32 startOffset, + int32 endOffset, + int32 *outSize = NULL) const; + + int32 LineAt(int32 offset) const; + int32 LineAt(BPoint point) const; + BPoint PointAt(int32 inOffset, float *outHeight = NULL) const; + int32 OffsetAt(BPoint point) const; + int32 OffsetAt(int32 line) const; + +/*virtual void FindWord(int32 inOffset, + int32 *outFromOffset, + int32 *outToOffset); + +virtual bool CanEndLine(int32 offset); +*/ + float LineWidth(int32 lineNum = 0) const; + float LineHeight(int32 lineNum = 0) const; + float TextHeight(int32 startLine, int32 endLine) const; + + void GetTextRegion(int32 startOffset, + int32 endOffset, + BRegion *outRegion) const; + +//virtual void ScrollToOffset(int32 inOffset); + void ScrollToSelection(); + + void Highlight(int32 startOffset, int32 endOffset); + + void SetTextRect(BRect rect); + BRect TextRect() const; + void SetStylable(bool stylable); + bool IsStylable() const; + void SetTabWidth(float width); + float TabWidth() const; + void MakeSelectable(bool selectable = true); + bool IsSelectable() const; + void MakeEditable(bool editable = true); + bool IsEditable() const; + void SetWordWrap(bool wrap); + bool DoesWordWrap() const; + void SetMaxBytes(int32 max); + int32 MaxBytes() const; + void DisallowChar(uint32 aChar); + void AllowChar(uint32 aChar); + void SetAlignment(alignment flag); + alignment Alignment() const; + void SetAutoindent(bool state); + bool DoesAutoindent() const; + void SetColorSpace(color_space colors); + color_space ColorSpace() const; + void MakeResizable(bool resize, BView *resizeView = NULL); + bool IsResizable() const; + void SetDoesUndo(bool undo); + bool DoesUndo() const; + void HideTyping(bool enabled); + bool IsTypingHidden(void) const; + +//virtual void ResizeToPreferred(); +//virtual void GetPreferredSize(float *width, float *height); +virtual void AllAttached(); +virtual void AllDetached(); + +static void* FlattenRunArray(const text_run_array *inArray, + int32 *outSize = NULL); +static text_run_array* UnflattenRunArray(const void *data, + int32 *outSize = NULL); + private : +}; + +BPTextView::BPTextView(TPasObject PasObject, + BRect frame, + const char *name, + BRect textRect, + uint32 resizeMask, + uint32 flags = B_WILL_DRAW | B_PULSE_NEEDED) + : + BTextView( frame, + name, + textRect, + resizeMask, + flags), + BPView(PasObject, BRect(0,0,0,0), name, 0, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + +BPTextView::BPTextView(TPasObject PasObject, + BRect frame, + const char *name, + BRect textRect, + const BFont *initialFont, + const rgb_color *initialColor, + uint32 resizeFlags, + uint32 flags) + : + BTextView( frame, + name, + textRect, + initialFont, + initialColor, + resizeFlags, + flags), + BPView(PasObject, BRect(0,0,0,0), name, 0, flags), + BPHandler(PasObject, name), + BPasObject(PasObject) +{ + +} + + +BPTextView::BPTextView(TPasObject PasObject, BMessage *data) + :BTextView(data), + BPView(PasObject, data), + BPHandler(PasObject, data), + BPasObject(PasObject) +{ +} +void BPTextView::Pulse(void) +{ + BTextView::Pulse(); +} + + + +void BPTextView::MessageReceived(BMessage *message) +{ + MessageReceived_hookCall(message); + BTextView::MessageReceived(message); +} + +void BPTextView::Draw(BRect updateRect) +{ + BTextView::Draw(updateRect); + Draw_hookCall(updateRect); +} + +void BPTextView::AttachedToWindow(void) +{ + //BTextView::AttachedToWindow(); + AttachedToWindow_hookCall(); +} + + + +void BPTextView::AllAttached(void) +{ + BTextView::AllAttached(); +} + +void BPTextView::AllDetached(void) +{ + BTextView::AllDetached(); +} + + +void BPTextView::WindowActivated(bool active) +{ + BTextView::WindowActivated(active); +} + +void BPTextView::KeyDown(const char *bytes, int32 numBytes) +{ + BTextView::KeyDown(bytes, numBytes); +} + + +void BPTextView::FrameResized(float width, float height) +{ + BTextView::FrameResized(width, height); +} + +void BPTextView::DetachedFromWindow(void) +{ + BTextView::DetachedFromWindow(); +} + + + +void BPTextView::MouseDown(BPoint point) +{ + BTextView::MouseDown(point); +} + +void BPTextView::MouseMoved(BPoint point, uint32 transit, const BMessage *message) +{ + BTextView::MouseMoved(point, transit, message); +} + +void BPTextView::MouseUp(BPoint point) +{ + BTextView::MouseUp(point); +} + + + + +#if defined(__cplusplus) +extern "C" { +#endif + +/*********************************************************************** + * Method: BTextView::BTextView + * Params: BRect frame, const char *name, BRect textRect, const BFont *initialFont, const rgb_color *initialColor, uint32 resizeMask, uint32 flags + * Effects: + ***********************************************************************/ +TCPlusObject BTextView_Create(TPasObject PasObject, + BRect frame, + const char *name, + BRect textRect, + uint32 resizeMask, + uint32 flags ) + +{ + return new BPTextView(PasObject, frame, name, textRect, resizeMask, flags); +} + +TCPlusObject BTextView_Create_1(TPasObject PasObject, BRect frame, const char *name, BRect textRect, const BFont *initialFont, const rgb_color *initialColor, uint32 resizeMask, uint32 flags) +{ + return new BPTextView(PasObject, frame, name, textRect, initialFont, initialColor, resizeMask, flags); +} + + +/*********************************************************************** + * Method: BTextView::BTextView + * Params: BMessage *data + * Effects: + ***********************************************************************/ +TCPlusObject BTextView_Create_2 +(TPasObject PasObject, BMessage *data) +{ + return new BPTextView(PasObject, data); +} + + +/*********************************************************************** + * Method: BTextView::~BTextView + * Params: + * Effects: + ***********************************************************************/ +void BTextView_FREE(BTextView *TextView) +{ + delete TextView; +} + + +/*********************************************************************** + * Method: BTextView::Instantiate + * Params: BMessage *data + * Returns: BArchivable * + * Effects: + ***********************************************************************/ +BArchivable * +BTextView_Instantiate(BTextView *TextView, BMessage *data) +{ + return TextView->Instantiate(data); +} + + +/*********************************************************************** + * Method: BTextView::Archive + * Params: BMessage *data, bool deep + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTextView_Archive(BTextView *TextView, BMessage *data, bool deep) +{ + return TextView->Archive(data, deep); +} + + +/*********************************************************************** + * Method: BTextView::AttachedToWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_AttachedToWindow(BTextView *TextView) +{ + TextView->AttachedToWindow(); +} + + +/*********************************************************************** + * Method: BTextView::DetachedFromWindow + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_DetachedFromWindow(BTextView *TextView) +{ + TextView->DetachedFromWindow(); +} + + +/*********************************************************************** + * Method: BTextView::Draw + * Params: BRect inRect + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Draw(BTextView *TextView, BRect inRect) +{ + TextView->Draw(inRect); +} + + +/*********************************************************************** + * Method: BTextView::MouseDown + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MouseDown(BTextView *TextView, BPoint where) +{ + TextView->MouseDown(where); +} + + +/*********************************************************************** + * Method: BTextView::MouseUp + * Params: BPoint where + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MouseUp(BTextView *TextView, BPoint where) +{ + TextView->MouseUp(where); +} + + +/*********************************************************************** + * Method: BTextView::MouseMoved + * Params: BPoint where, uint32 code, const BMessage *message + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MouseMoved(BTextView *TextView, BPoint where, uint32 code, const BMessage *message) +{ + TextView->MouseMoved(where, code, message); +} + + +/*********************************************************************** + * Method: BTextView::WindowActivated + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_WindowActivated(BTextView *TextView, bool state) +{ + TextView->WindowActivated(state); +} + + +/*********************************************************************** + * Method: BTextView::KeyDown + * Params: const char *bytes, int32 numBytes + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_KeyDown(BTextView *TextView, const char *bytes, int32 numBytes) +{ + TextView->KeyDown(bytes, numBytes); +} + + +/*********************************************************************** + * Method: BTextView::Pulse + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Pulse(BTextView *TextView) +{ + TextView->Pulse(); +} + + +/*********************************************************************** + * Method: BTextView::FrameResized + * Params: float width, float height + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_FrameResized(BTextView *TextView, float width, float height) +{ + TextView->FrameResized(width, height); +} + + +/*********************************************************************** + * Method: BTextView::MakeFocus + * Params: bool focusState + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MakeFocus(BTextView *TextView, bool focusState) +{ + TextView->MakeFocus(focusState); +} + + +/*********************************************************************** + * Method: BTextView::MessageReceived + * Params: BMessage *message + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MessageReceived(BTextView *TextView, BMessage *message) +{ + TextView->MessageReceived(message); +} + + +/*********************************************************************** + * Method: BTextView::ResolveSpecifier + * Params: BMessage *message, int32 index, BMessage *specifier, int32 form, const char *property + * Returns: BHandler * + * Effects: + ***********************************************************************/ +BHandler * +BTextView_ResolveSpecifier(BTextView *TextView, BMessage *message, int32 index, BMessage *specifier, int32 form, const char *property) +{ + return TextView->ResolveSpecifier(message, index, specifier, form, property); +} + + +/*********************************************************************** + * Method: BTextView::GetSupportedSuites + * Params: BMessage *data + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTextView_GetSupportedSuites(BTextView *TextView, BMessage *data) +{ + return TextView->GetSupportedSuites(data); +} + + +/*********************************************************************** + * Method: BTextView::Perform + * Params: perform_code d, void *arg + * Returns: status_t + * Effects: + ***********************************************************************/ +status_t +BTextView_Perform(BTextView *TextView, perform_code d, void *arg) +{ + return TextView->Perform(d, arg); +} + + +/*********************************************************************** + * Method: BTextView::SetText + * Params: const char *inText, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetText(BTextView *TextView, const char *inText, const text_run_array *inRuns) +{ + TextView->SetText(inText, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::SetText + * Params: const char *inText, int32 inLength, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetText_1 +(BTextView *TextView, const char *inText, int32 inLength, const text_run_array *inRuns) +{ + TextView->SetText(inText, inLength, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::SetText + * Params: BFile *inFile, int32 startOffset, int32 inLength, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetText_2 +(BTextView *TextView, BFile *inFile, int32 startOffset, int32 inLength, const text_run_array *inRuns) +{ + TextView->SetText(inFile, startOffset, inLength, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::Insert + * Params: const char *inText, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Insert(BTextView *TextView, const char *inText, const text_run_array *inRuns) +{ + TextView->Insert(inText, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::Insert + * Params: const char *inText, int32 inLength, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Insert_1 +(BTextView *TextView, const char *inText, int32 inLength, const text_run_array *inRuns) +{ + TextView->Insert(inText, inLength, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::Insert + * Params: int32 startOffset, const char *inText, int32 inLength, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Insert_2 +(BTextView *TextView, int32 startOffset, const char *inText, int32 inLength, const text_run_array *inRuns) +{ + TextView->Insert(startOffset, inText, inLength, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::Delete + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Delete(BTextView *TextView) +{ + TextView->Delete(); +} + + +/*********************************************************************** + * Method: BTextView::Delete + * Params: int32 startOffset, int32 endOffset + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Delete_1 +(BTextView *TextView, int32 startOffset, int32 endOffset) +{ + TextView->Delete(startOffset, endOffset); +} + + +/*********************************************************************** + * Method: BTextView::Text + * Params: + * Returns: const char * + * Effects: + ***********************************************************************/ +const char * +BTextView_Text(BTextView *TextView) +{ + return TextView->Text(); +} + + +/*********************************************************************** + * Method: BTextView::TextLength + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_TextLength +(BTextView *TextView) +{ + return TextView->TextLength(); +} + + +/*********************************************************************** + * Method: BTextView::GetText + * Params: int32 offset, int32 length, char *buffer + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetText(BTextView *TextView, int32 offset, int32 length, char *buffer) +{ + TextView->GetText(offset, length, buffer); +} + + +/*********************************************************************** + * Method: BTextView::ByteAt + * Params: int32 offset + * Returns: uchar + * Effects: + ***********************************************************************/ +uchar +BTextView_ByteAt(BTextView *TextView, int32 offset) +{ + return TextView->ByteAt(offset); +} + + +/*********************************************************************** + * Method: BTextView::CountLines + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_CountLines(BTextView *TextView) +{ + return TextView->CountLines(); +} + + +/*********************************************************************** + * Method: BTextView::CurrentLine + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_CurrentLine(BTextView *TextView) +{ + return TextView->CurrentLine(); +} + + +/*********************************************************************** + * Method: BTextView::GoToLine + * Params: int32 lineNum + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GoToLine(BTextView *TextView, int32 lineNum) +{ + TextView->GoToLine(lineNum); +} + + +/*********************************************************************** + * Method: BTextView::Cut + * Params: BClipboard *clipboard + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Cut(BTextView *TextView, BClipboard *clipboard) +{ + TextView->Cut(clipboard); +} + + +/*********************************************************************** + * Method: BTextView::Copy + * Params: BClipboard *clipboard + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Copy(BTextView *TextView, BClipboard *clipboard) +{ + TextView->Copy(clipboard); +} + + +/*********************************************************************** + * Method: BTextView::Paste + * Params: BClipboard *clipboard + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Paste(BTextView *TextView, BClipboard *clipboard) +{ + TextView->Paste(clipboard); +} + + +/*********************************************************************** + * Method: BTextView::Clear + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Clear(BTextView *TextView) +{ + TextView->Clear(); +} + + +/*********************************************************************** + * Method: BTextView::AcceptsPaste + * Params: BClipboard *clipboard + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_AcceptsPaste(BTextView *TextView, BClipboard *clipboard) +{ + return TextView->AcceptsPaste(clipboard); +} + + +/*********************************************************************** + * Method: BTextView::AcceptsDrop + * Params: const BMessage *inMessage + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_AcceptsDrop(BTextView *TextView, const BMessage *inMessage) +{ + return TextView->AcceptsDrop(inMessage); +} + + +/*********************************************************************** + * Method: BTextView::Select + * Params: int32 startOffset, int32 endOffset + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Select(BTextView *TextView, int32 startOffset, int32 endOffset) +{ + TextView->Select(startOffset, endOffset); +} + + +/*********************************************************************** + * Method: BTextView::SelectAll + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SelectAll +(BTextView *TextView) +{ + TextView->SelectAll(); +} + + +/*********************************************************************** + * Method: BTextView::GetSelection + * Params: int32 *outStart, int32 *outEnd + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetSelection(BTextView *TextView, int32 *outStart, int32 *outEnd) +{ + TextView->GetSelection(outStart, outEnd); +} + + +/*********************************************************************** + * Method: BTextView::SetFontAndColor + * Params: const BFont *inFont, uint32 inMode, const rgb_color *inColor + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetFontAndColor(BTextView *TextView, const BFont *inFont, uint32 inMode, const rgb_color *inColor) +{ + TextView->SetFontAndColor(inFont, inMode, inColor); +} + + +/*********************************************************************** + * Method: BTextView::SetFontAndColor + * Params: int32 startOffset, int32 endOffset, const BFont *inFont, uint32 inMode, const rgb_color *inColor + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetFontAndColor_1 +(BTextView *TextView, int32 startOffset, int32 endOffset, const BFont *inFont, uint32 inMode, const rgb_color *inColor) +{ + TextView->SetFontAndColor(startOffset, endOffset, inFont, inMode, inColor); +} + + +/*********************************************************************** + * Method: BTextView::GetFontAndColor + * Params: int32 inOffset, BFont *outFont, rgb_color *outColor + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetFontAndColor(BTextView *TextView, int32 inOffset, BFont *outFont, rgb_color *outColor) +{ + TextView->GetFontAndColor(inOffset, outFont, outColor); +} + + +/*********************************************************************** + * Method: BTextView::GetFontAndColor + * Params: BFont *outFont, uint32 *outMode, rgb_color *outColor, bool *outEqColor + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetFontAndColor_1 +(BTextView *TextView, BFont *outFont, uint32 *outMode, rgb_color *outColor, bool *outEqColor) +{ + TextView->GetFontAndColor(outFont, outMode, outColor, outEqColor); +} + + +/*********************************************************************** + * Method: BTextView::SetRunArray + * Params: int32 startOffset, int32 endOffset, const text_run_array *inRuns + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetRunArray(BTextView *TextView, int32 startOffset, int32 endOffset, const text_run_array *inRuns) +{ + TextView->SetRunArray(startOffset, endOffset, inRuns); +} + + +/*********************************************************************** + * Method: BTextView::RunArray + * Params: int32 startOffset, int32 endOffset, int32 *outSize + * Returns: text_run_array * + * Effects: + ***********************************************************************/ +text_run_array * +BTextView_RunArray(BTextView *TextView, int32 startOffset, int32 endOffset, int32 *outSize) +{ + return TextView->RunArray(startOffset, endOffset, outSize); +} + + +/*********************************************************************** + * Method: BTextView::LineAt + * Params: int32 offset + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_LineAt(BTextView *TextView, int32 offset) +{ + return TextView->LineAt(offset); +} + + +/*********************************************************************** + * Method: BTextView::LineAt + * Params: BPoint point + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_LineAt_1 +(BTextView *TextView, BPoint point) +{ + return TextView->LineAt(point); +} + + +/*********************************************************************** + * Method: BTextView::PointAt + * Params: int32 inOffset, float *outHeight + * Returns: BPoint + * Effects: + ***********************************************************************/ +BPoint +BTextView_PointAt(BTextView *TextView, int32 inOffset, float *outHeight) +{ + return TextView->PointAt(inOffset, outHeight); +} + + +/*********************************************************************** + * Method: BTextView::OffsetAt + * Params: BPoint point + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_OffsetAt(BTextView *TextView, BPoint point) +{ + return TextView->OffsetAt(point); +} + + +/*********************************************************************** + * Method: BTextView::OffsetAt + * Params: int32 line + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_OffsetAt_1 +(BTextView *TextView, int32 line) +{ + return TextView->OffsetAt(line); +} + + +/*********************************************************************** + * Method: BTextView::FindWord + * Params: int32 inOffset, int32 *outFromOffset, int32 *outToOffset + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_FindWord(BTextView *TextView, int32 inOffset, int32 *outFromOffset, int32 *outToOffset) +{ + TextView->FindWord(inOffset, outFromOffset, outToOffset); +} + + +/*********************************************************************** + * Method: BTextView::CanEndLine + * Params: int32 offset + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_CanEndLine(BTextView *TextView, int32 offset) +{ + return TextView->CanEndLine(offset); +} + + +/*********************************************************************** + * Method: BTextView::LineWidth + * Params: int32 lineNum + * Returns: float + * Effects: + ***********************************************************************/ +float +BTextView_LineWidth(BTextView *TextView, int32 lineNum) +{ + return TextView->LineWidth(lineNum); +} + + +/*********************************************************************** + * Method: BTextView::LineHeight + * Params: int32 lineNum + * Returns: float + * Effects: + ***********************************************************************/ +float +BTextView_LineHeight(BTextView *TextView, int32 lineNum) +{ + return TextView->LineHeight(lineNum); +} + + +/*********************************************************************** + * Method: BTextView::TextHeight + * Params: int32 startLine, int32 endLine + * Returns: float + * Effects: + ***********************************************************************/ +float +BTextView_TextHeight(BTextView *TextView, int32 startLine, int32 endLine) +{ + return TextView->TextHeight(startLine, endLine); +} + + +/*********************************************************************** + * Method: BTextView::GetTextRegion + * Params: int32 startOffset, int32 endOffset, BRegion *outRegion + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetTextRegion(BTextView *TextView, int32 startOffset, int32 endOffset, BRegion *outRegion) +{ + TextView->GetTextRegion(startOffset, endOffset, outRegion); +} + + +/*********************************************************************** + * Method: BTextView::ScrollToOffset + * Params: int32 inOffset + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_ScrollToOffset(BTextView *TextView, int32 inOffset) +{ + TextView->ScrollToOffset(inOffset); +} + + +/*********************************************************************** + * Method: BTextView::ScrollToSelection + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_ScrollToSelection(BTextView *TextView) +{ + TextView->ScrollToSelection(); +} + + +/*********************************************************************** + * Method: BTextView::Highlight + * Params: int32 startOffset, int32 endOffset + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_Highlight(BTextView *TextView, int32 startOffset, int32 endOffset) +{ + TextView->Highlight(startOffset, endOffset); +} + + +/*********************************************************************** + * Method: BTextView::SetTextRect + * Params: BRect rect + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetTextRect(BTextView *TextView, BRect rect) +{ + TextView->SetTextRect(rect); +} + + +/*********************************************************************** + * Method: BTextView::TextRect + * Params: + * Returns: BRect + * Effects: + ***********************************************************************/ +BRect +BTextView_TextRect(BTextView *TextView) +{ + return TextView->TextRect(); +} + + +/*********************************************************************** + * Method: BTextView::SetStylable + * Params: bool stylable + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetStylable(BTextView *TextView, bool stylable) +{ + TextView->SetStylable(stylable); +} + + +/*********************************************************************** + * Method: BTextView::IsStylable + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_IsStylable(BTextView *TextView) +{ + return TextView->IsStylable(); +} + + +/*********************************************************************** + * Method: BTextView::SetTabWidth + * Params: float width + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetTabWidth(BTextView *TextView, float width) +{ + TextView->SetTabWidth(width); +} + + +/*********************************************************************** + * Method: BTextView::TabWidth + * Params: + * Returns: float + * Effects: + ***********************************************************************/ +float +BTextView_TabWidth(BTextView *TextView) +{ + return TextView->TabWidth(); +} + + +/*********************************************************************** + * Method: BTextView::MakeSelectable + * Params: bool selectable + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MakeSelectable(BTextView *TextView, bool selectable) +{ + TextView->MakeSelectable(selectable); +} + + +/*********************************************************************** + * Method: BTextView::IsSelectable + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_IsSelectable(BTextView *TextView) +{ + return TextView->IsSelectable(); +} + + +/*********************************************************************** + * Method: BTextView::MakeEditable + * Params: bool editable + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MakeEditable(BTextView *TextView, bool editable) +{ + TextView->MakeEditable(editable); +} + + +/*********************************************************************** + * Method: BTextView::IsEditable + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_IsEditable(BTextView *TextView) +{ + return TextView->IsEditable(); +} + + +/*********************************************************************** + * Method: BTextView::SetWordWrap + * Params: bool wrap + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetWordWrap(BTextView *TextView, bool wrap) +{ + TextView->SetWordWrap(wrap); +} + + +/*********************************************************************** + * Method: BTextView::DoesWordWrap + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_DoesWordWrap(BTextView *TextView) +{ + return TextView->DoesWordWrap(); +} + + +/*********************************************************************** + * Method: BTextView::SetMaxBytes + * Params: int32 max + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetMaxBytes(BTextView *TextView, int32 max) +{ + TextView->SetMaxBytes(max); +} + + +/*********************************************************************** + * Method: BTextView::MaxBytes + * Params: + * Returns: int32 + * Effects: + ***********************************************************************/ +int32 +BTextView_MaxBytes(BTextView *TextView) +{ + return TextView->MaxBytes(); +} + + +/*********************************************************************** + * Method: BTextView::DisallowChar + * Params: uint32 aChar + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_DisallowChar(BTextView *TextView, uint32 aChar) +{ + TextView->DisallowChar(aChar); +} + + +/*********************************************************************** + * Method: BTextView::AllowChar + * Params: uint32 aChar + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_AllowChar(BTextView *TextView, uint32 aChar) +{ + TextView->AllowChar(aChar); +} + + +/*********************************************************************** + * Method: BTextView::SetAlignment + * Params: alignment flag + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetAlignment(BTextView *TextView, alignment flag) +{ + TextView->SetAlignment(flag); +} + + +/*********************************************************************** + * Method: BTextView::Alignment + * Params: + * Returns: alignment + * Effects: + ***********************************************************************/ +alignment +BTextView_Alignment(BTextView *TextView) +{ + return TextView->Alignment(); +} + + +/*********************************************************************** + * Method: BTextView::SetAutoindent + * Params: bool state + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetAutoindent(BTextView *TextView, bool state) +{ + TextView->SetAutoindent(state); +} + + +/*********************************************************************** + * Method: BTextView::DoesAutoindent + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_DoesAutoindent(BTextView *TextView) +{ + return TextView->DoesAutoindent(); +} + + +/*********************************************************************** + * Method: BTextView::SetColorSpace + * Params: color_space colors + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetColorSpace(BTextView *TextView, color_space colors) +{ + TextView->SetColorSpace(colors); +} + + +/*********************************************************************** + * Method: BTextView::ColorSpace + * Params: + * Returns: color_space + * Effects: + ***********************************************************************/ +color_space +BTextView_ColorSpace(BTextView *TextView) +{ + return TextView->ColorSpace(); +} + + +/*********************************************************************** + * Method: BTextView::MakeResizable + * Params: bool resize, BView *resizeView + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_MakeResizable(BTextView *TextView, bool resize, BView *resizeView) +{ + TextView->MakeResizable(resize, resizeView); +} + + +/*********************************************************************** + * Method: BTextView::IsResizable + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_IsResizable(BTextView *TextView) +{ + return TextView->IsResizable(); +} + + +/*********************************************************************** + * Method: BTextView::SetDoesUndo + * Params: bool undo + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_SetDoesUndo(BTextView *TextView, bool undo) +{ + TextView->SetDoesUndo(undo); +} + + +/*********************************************************************** + * Method: BTextView::DoesUndo + * Params: + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_DoesUndo(BTextView *TextView) +{ + return TextView->DoesUndo(); +} + + +/*********************************************************************** + * Method: BTextView::HideTyping + * Params: bool enabled + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_HideTyping(BTextView *TextView, bool enabled) +{ + TextView->HideTyping(enabled); +} + + +/*********************************************************************** + * Method: BTextView::IsTypingHidden + * Params: void + * Returns: bool + * Effects: + ***********************************************************************/ +bool +BTextView_IsTypingHidden(BTextView *TextView, void) +{ + return TextView->IsTypingHidden(); +} + + +/*********************************************************************** + * Method: BTextView::ResizeToPreferred + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_ResizeToPreferred(BTextView *TextView) +{ + TextView->ResizeToPreferred(); +} + + +/*********************************************************************** + * Method: BTextView::GetPreferredSize + * Params: float *width, float *height + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_GetPreferredSize(BTextView *TextView, float *width, float *height) +{ + TextView->GetPreferredSize(width, height); +} + + +/*********************************************************************** + * Method: BTextView::AllAttached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_AllAttached(BTextView *TextView) +{ + TextView->AllAttached(); +} + + +/*********************************************************************** + * Method: BTextView::AllDetached + * Params: + * Returns: void + * Effects: + ***********************************************************************/ +void +BTextView_AllDetached(BTextView *TextView) +{ + TextView->AllDetached(); +} + + +/*********************************************************************** + * Method: BTextView::FlattenRunArray + * Params: const text_run_array *inArray, int32 *outSize + * Returns: void * + * Effects: + ***********************************************************************/ +void * +BTextView_FlattenRunArray(BTextView *TextView, const text_run_array *inArray, int32 *outSize) +{ + TextView->FlattenRunArray(inArray, outSize); +} + + +/*********************************************************************** + * Method: BTextView::UnflattenRunArray + * Params: const void *data, int32 *outSize + * Returns: text_run_array * + * Effects: + ***********************************************************************/ +text_run_array * +BTextView_UnflattenRunArray(BTextView *TextView, const void *data, int32 *outSize) +{ + return TextView->UnflattenRunArray(data, outSize); +} + + + +/*void +BTextView_InsertText(BTextView *TextView, const char *inText, int32 inLength, int32 inOffset, const text_run_array *inRuns) +{ + TextView->InsertText(inText, inLength, inOffset, inRuns); +} + + +void +BTextView_DeleteText(BTextView *TextView, int32 fromOffset, int32 toOffset) +{ + TextView->DeleteText(fromOffset, toOffset); +} +*/ + + +void +BTextView_Undo(BTextView *TextView, BClipboard *clipboard) +{ + TextView->Undo(clipboard); +} + + +#if defined(__cplusplus) +} +#endif + +#endif /* _TEXTVIEW_CPP_ */ + diff --git a/bepascal/bepascal/be/interface/radiobutton.pp b/bepascal/bepascal/be/interface/radiobutton.pp new file mode 100644 index 0000000..f689f9e --- /dev/null +++ b/bepascal/bepascal/be/interface/radiobutton.pp @@ -0,0 +1,270 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2003 Olivier Coursiere + Eric Jourde + Oscar Lesta + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit radiobutton; + +interface + +uses + beobj, Control, Message, Archivable, SupportDefs, Rect, Handler; + +type + TRadioButton = class(TControl) + private + public + constructor Create(frame : TRect; name, aLabel : PChar; message : TMessage; resizingMode, flags : Cardinal); virtual; + constructor Create(data : TMessage); override; + destructor Destroy; override; + function Instantiate(data : TMessage) : TArchivable; + function Archive(data : TMessage; deep : boolean) : TStatus_t; + procedure Draw(updateRect : TRect); override; + procedure MouseDown(where : TPoint); override; + procedure AttachedToWindow; override; + procedure KeyDown(bytes : PChar; numBytes : integer); override; + procedure SetValue(aValue : integer); + procedure GetPreferredSize(width : double; height : double); + procedure ResizeToPreferred; override; + function Invoke(msg : TMessage) : TStatus_t; + procedure MessageReceived(msg : TMessage); override; + procedure WindowActivated(state : boolean); override; + procedure MouseUp(pt : TPoint); override; + procedure MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); override; + procedure DetachedFromWindow; 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 MakeFocus(state : boolean); override; + procedure AllAttached; override; + procedure AllDetached; override; + function GetSupportedSuites(data : TMessage) : TStatus_t; + function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; +// procedure _ReservedRadioButton1; +// procedure _ReservedRadioButton2; +// function operator=( : TRadioButton) : TRadioButton; +// procedure BBitmap *sBitmaps[2][3]; +// procedure bool fOutlined; +// procedure uint32 _reserved[2]; + end; + +function BRadioButton_Create(AObject : TBeObject; frame : TCPlusObject; + name, aLabel : PChar; message : TCPlusObject; + resizingMode, flags : Cardinal) : TCPlusObject; + cdecl; external BePascalLibName name 'BRadioButton_Create'; +function BRadioButton_Create_1(AObject : TBeObject; data : TCPlusObject) : TCPlusObject; cdecl; external BePascalLibName name 'BRadioButton_Create_1'; + +procedure BRadioButton_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_FREE'; + +function BRadioButton_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : TArchivable; cdecl; external BePascalLibName name 'BRadioButton_Instantiate'; +function BRadioButton_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BRadioButton_Archive'; +procedure BRadioButton_Draw(AObject : TCPlusObject; updateRect : TRect); cdecl; external BePascalLibName name 'BRadioButton_Draw'; +procedure BRadioButton_MouseDown(AObject : TCPlusObject; where : TPoint); cdecl; external BePascalLibName name 'BRadioButton_MouseDown'; +procedure BRadioButton_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AttachedToWindow'; +procedure BRadioButton_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BRadioButton_KeyDown'; +procedure BRadioButton_SetValue(AObject : TCPlusObject; value : integer); cdecl; external BePascalLibName name 'BRadioButton_SetValue'; +procedure BRadioButton_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BRadioButton_GetPreferredSize'; +procedure BRadioButton_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_ResizeToPreferred'; +function BRadioButton_Invoke(AObject : TCPlusObject; msg : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BRadioButton_Invoke'; +procedure BRadioButton_MessageReceived(AObject : TCPlusObject; msg : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_MessageReceived'; +procedure BRadioButton_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BRadioButton_WindowActivated'; +procedure BRadioButton_MouseUp(AObject : TCPlusObject; pt : TPoint); cdecl; external BePascalLibName name 'BRadioButton_MouseUp'; +procedure BRadioButton_MouseMoved(AObject : TCPlusObject; pt : TPoint; code : Cardinal; msg : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_MouseMoved'; +procedure BRadioButton_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_DetachedFromWindow'; +procedure BRadioButton_FrameMoved(AObject : TCPlusObject; new_position : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_FrameMoved'; +procedure BRadioButton_FrameResized(AObject : TCPlusObject; new_width : double; new_height : double); cdecl; external BePascalLibName name 'BRadioButton_FrameResized'; +function BRadioButton_ResolveSpecifier(AObject : TCPlusObject; msg : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : THandler; cdecl; external BePascalLibName name 'BRadioButton_ResolveSpecifier'; +procedure BRadioButton_MakeFocus(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BRadioButton_MakeFocus'; +procedure BRadioButton_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AllAttached'; +procedure BRadioButton_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_AllDetached'; +function BRadioButton_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BRadioButton_GetSupportedSuites'; +function BRadioButton_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BRadioButton_Perform'; +//procedure BRadioButton__ReservedRadioButton1(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton__ReservedRadioButton1'; +//procedure BRadioButton__ReservedRadioButton2(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton__ReservedRadioButton2'; +//function BRadioButton_operator=(AObject : TCPlusObject; : TRadioButton) : TRadioButton; cdecl; external BePascalLibName name 'BRadioButton_operator='; +//procedure BRadioButton_BBitmap *sBitmaps[2][3](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_BBitmap *sBitmaps[2][3]'; +//procedure BRadioButton_bool fOutlined(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_bool fOutlined'; +//procedure BRadioButton_uint32 _reserved[2](AObject : TCPlusObject); cdecl; external BePascalLibName name 'BRadioButton_uint32 _reserved[2]'; + +implementation + +constructor TRadioButton.Create(frame : TRect; name, aLabel : PChar; message : TMessage; resizingMode, flags : Cardinal); +begin + CreatePas; + CPlusObject := BRadioButton_Create(Self, frame.CPlusObject, name, aLabel, message.CPlusObject, resizingMode, flags); +end; + +constructor TRadioButton.Create(data : TMessage); +begin + CreatePas; + CPlusObject := BRadioButton_Create_1(Self, data.CPlusObject); +end; + +destructor TRadioButton.Destroy; +begin + BRadioButton_Free(CPlusObject); + inherited; +end; + +function TRadioButton.Instantiate(data : TMessage) : TArchivable; +begin + Result := BRadioButton_Instantiate(CPlusObject, data.CPlusObject); +end; + +function TRadioButton.Archive(data : TMessage; deep : boolean) : TStatus_t; +begin + Result := BRadioButton_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure TRadioButton.Draw(updateRect : TRect); +begin +// BRadioButton_Draw(CPlusObject, updateRect.CPlusObject); +end; + +procedure TRadioButton.MouseDown(where : TPoint); +begin +// BRadioButton_MouseDown(CPlusObject, where.CPlusObject); +end; + +procedure TRadioButton.AttachedToWindow; +begin +// BRadioButton_AttachedToWindow(CPlusObject); +end; + +procedure TRadioButton.KeyDown(bytes : PChar; numBytes : integer); +begin +// BRadioButton_KeyDown(CPlusObject, bytes, numBytes); +end; + +procedure TRadioButton.SetValue(aValue : integer); +begin +// BRadioButton_SetValue(CPlusObject, aValue); +end; + +procedure TRadioButton.GetPreferredSize(width : double; height : double); +begin + BRadioButton_GetPreferredSize(CPlusObject, width, height); +end; + +procedure TRadioButton.ResizeToPreferred; +begin + BRadioButton_ResizeToPreferred(CPlusObject); +end; + +function TRadioButton.Invoke(msg : TMessage) : TStatus_t; +begin + Result := BRadioButton_Invoke(CPlusObject, msg.CPlusObject); +end; + +procedure TRadioButton.MessageReceived(msg : TMessage); +begin +// BRadioButton_MessageReceived(CPlusObject, msg.CPlusObject); +end; + +procedure TRadioButton.WindowActivated(state : boolean); +begin +// BRadioButton_WindowActivated(CPlusObject, state); +end; + +procedure TRadioButton.MouseUp(pt : TPoint); +begin +// BRadioButton_MouseUp(CPlusObject, pt.CPlusObject); +end; + +procedure TRadioButton.MouseMoved(pt : TPoint; code : Cardinal; msg : TMessage); +begin +// BRadioButton_MouseMoved(CPlusObject, pt.CPlusObject, code, msg); +end; + +procedure TRadioButton.DetachedFromWindow; +begin +// BRadioButton_DetachedFromWindow(CPlusObject); +end; + +procedure TRadioButton.FrameMoved(new_position : TPoint); +begin +// BRadioButton_FrameMoved(CPlusObject, new_position.CPlusObject); +end; + +procedure TRadioButton.FrameResized(new_width : double; new_height : double); +begin +// BRadioButton_FrameResized(CPlusObject, new_width, new_height); +end; + +function TRadioButton.ResolveSpecifier(msg : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; +begin + Result := BRadioButton_ResolveSpecifier(CPlusObject, msg.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +procedure TRadioButton.MakeFocus(state : boolean); +begin + BRadioButton_MakeFocus(CPlusObject, state); +end; + +procedure TRadioButton.AllAttached; +begin +// BRadioButton_AllAttached(CPlusObject); +end; + +procedure TRadioButton.AllDetached; +begin +// BRadioButton_AllDetached(CPlusObject); +end; + +function TRadioButton.GetSupportedSuites(data : TMessage) : TStatus_t; +begin + Result := BRadioButton_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function TRadioButton.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; +begin + Result := BRadioButton_Perform(CPlusObject, d, arg); +end; + +{ +procedure TRadioButton._ReservedRadioButton1; +begin + BRadioButton__ReservedRadioButton1(CPlusObject); +end; + +procedure TRadioButton._ReservedRadioButton2; +begin + BRadioButton__ReservedRadioButton2(CPlusObject); +end; + +function TRadioButton.operator=( : TRadioButton) : TRadioButton; +begin + Result := BRadioButton_operator=(CPlusObject, ); +end; + +procedure TRadioButton.BBitmap *sBitmaps[2][3]; +begin + BRadioButton_BBitmap *sBitmaps[2][3](CPlusObject); +end; + +procedure TRadioButton.bool fOutlined; +begin + BRadioButton_bool fOutlined(CPlusObject); +end; + +procedure TRadioButton.uint32 _reserved[2]; +begin + BRadioButton_uint32 _reserved[2](CPlusObject); +end; +} + +end. diff --git a/bepascal/bepascal/be/interface/textview.pp b/bepascal/bepascal/be/interface/textview.pp new file mode 100644 index 0000000..804b957 --- /dev/null +++ b/bepascal/bepascal/be/interface/textview.pp @@ -0,0 +1,835 @@ +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002 Olivier Coursiere + Eric Jourde + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +} +unit textview; + +interface + +uses + beobj, interfacedefs,view,Message, Archivable, SupportDefs, Rect, Handler; + +{type + Ttext_run = Record + offset : Integer; + font TFont; + color : Trgb_color; +end; + +type + Ttext_run_array = Record + count : Integer; + runs : Ttext_run runs; + end; +} +type +Tundo_state =(undo_state_nil, + B_UNDO_UNAVAILABLE, + B_UNDO_TYPING, + B_UNDO_CUT, + B_UNDO_PASTE, + B_UNDO_CLEAR, + B_UNDO_DROP); + +type + TTextView = class(TView) + private + public + constructor Create(frame : TRect; name : pchar;atextRect: TRect ; resizeMask, flags : cardinal); virtual; +// constructor Create(bounds : TRect; name : pchar; texte : pchar; resizeflags, flags : cardinal); virtual; + constructor Create(data : TMessage);virtual; + destructor Destroy;override; + function Instantiate(data : TMessage) : TArchivable; + function Archive(data : TMessage; deep : boolean) : TStatus_t; + procedure AttachedToWindow;override; + procedure DetachedFromWindow;override; + procedure Draw(inRect : TRect);override; + procedure MouseDown(where : TPoint);override; + procedure MouseUp(where : TPoint);override; + procedure MouseMoved(where : TPoint; code : Cardinal; message : TMessage);override; + procedure WindowActivated(state : boolean);override; + procedure KeyDown(bytes : PChar; numBytes : integer);override; + procedure Pulse;override; + procedure FrameResized(width : double; height : double);override; + procedure MakeFocus(focusState : boolean); + procedure MessageReceived(message : TMessage);override; + function ResolveSpecifier(message : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; + function GetSupportedSuites(data : TMessage) : TStatus_t; + function Perform(d : TPerform_code; arg : Pointer) : TStatus_t; +{ procedure SetText(inText : PChar; inRuns : Ttext_tun_array); + procedure SetText(inText : PChar; inLength : integer; inRuns : Ttext_tun_array); + procedure SetText(inFile : TFile; startOffset : integer; inLength : integer; inRuns : Ttext_tun_array); + procedure Insert(inText : PChar; inRuns : Ttext_tun_array); + procedure Insert(inText : PChar; inLength : integer; inRuns : Ttext_tun_array); + procedure Insert(startOffset : integer; inText : PChar; inLength : integer; inRuns : Ttext_tun_array); +} procedure Delete; + procedure Delete(startOffset : integer; endOffset : integer); + function Text : PChar; + function TextLength : integer; + procedure GetText(offset : integer; length : integer; buffer : PChar); + function ByteAt(offset : integer) : PChar; + function CountLines : integer; + function CurrentLine : integer; + procedure GoToLine(lineNum : integer); +{ procedure Cut(clipboard : TClipboard); + procedure Copy(clipboard : TClipboard); + procedure Paste(clipboard : TClipboard); + procedure Clear; + function AcceptsPaste(clipboard : TClipboard) : boolean; +} function AcceptsDrop(inMessage : TMessage) : boolean; + procedure Select(startOffset : integer; endOffset : integer); + procedure SelectAll; +// procedure GetSelection(outStart : integer; outEnd : integer); +{ procedure SetFontAndColor(inFont : TFont; inMode : Cardinal; inColor : Trgb_color); + procedure SetFontAndColor(startOffset : integer; endOffset : integer; inFont : TFont; inMode : Cardinal; inColor : Trgb_color); + procedure GetFontAndColor(inOffset : integer; outFont : TFont; outColor : Trgb_color); + procedure GetFontAndColor(outFont : TFont; outMode : integer; outColor : Trgb_color; outEqColor : boolean); + procedure SetRunArray(startOffset : integer; endOffset : integer; inRuns : Ttext_tun_array); + function RunArray(startOffset : integer; endOffset : integer; outSize : ^integer) : Ttext_run_array; +} function LineAt(offset : integer) : integer; + function LineAt(point : TPoint) : integer; + function PointAt(inOffset : integer; outHeight : double) : TPoint; + function OffsetAt(point : TPoint) : integer; + function OffsetAt(line : integer) : integer; + procedure FindWord(inOffset : integer; outFromOffset : integer; outToOffset : integer); + function CanEndLine(offset : integer) : boolean; + function LineWidth(lineNum : integer) : double; + function LineHeight(lineNum : integer) : double; + function TextHeight(startLine : integer; endLine : integer) : double; +// procedure GetTextRegion(startOffset : integer; endOffset : integer; outRegion : TRegion); + procedure ScrollToOffset(inOffset : integer); + procedure ScrollToSelection; + procedure Highlight(startOffset : integer; endOffset : integer); + procedure SetTextRect(rect : TRect); + function TextRect : TRect; + procedure SetStylable(stylable : boolean); + function IsStylable : boolean; + procedure SetTabWidth(width : double); + function TabWidth : double; + procedure MakeSelectable(selectable : boolean); + function IsSelectable : boolean; + procedure MakeEditable(editable : boolean); + function IsEditable : boolean; + procedure SetWordWrap(awrap : boolean); + function DoesWordWrap : boolean; + procedure SetMaxBytes(max : integer); + function MaxBytes : integer; + procedure DisallowChar(aChar : Cardinal); + procedure AllowChar(aChar : Cardinal); + procedure SetAlignment(flag : Talignment); + function Alignment : Talignment; + procedure SetAutoindent(state : boolean); + function DoesAutoindent : boolean; +{ procedure SetColorSpace(colors : TColor_Space); + function ColorSpace : TColor_Space; +} procedure MakeResizable(resize : boolean; resizeView : TView); + function IsResizable : boolean; + procedure SetDoesUndo(undo : boolean); + function DoesUndo : boolean; + procedure HideTyping(enabled : boolean); + function IsTypingHidden : boolean; + procedure ResizeToPreferred;override; + procedure GetPreferredSize(width : double; height : double);virtual; + procedure AllAttached;override; + procedure AllDetached;override; +{ function FlattenRunArray(inArray : Ttext_tun_array; outSize : ^integer) : Pointer; + function UnflattenRunArray(data : Pointer; outSize : ^integer) : Ttext_run_array; + procedure InsertText(inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array); +} + // procedure Undo(clipboard : TClipboard); +// procedure GetDragParameters(drag : TMessage; bitmap : TBitmap; point : TPoint; handler : THandler); +// procedure InitObject(atextRect : TRect; initialFont : TFont; initialColor : Trgb_color); + end; + +function BTextView_Create(AObject : TBeObject;frame : TCPlusObject; name : pchar; atextRect: TCPlusObject ; resizeMask, flags : cardinal): TCPlusObject; cdecl; external BePascalLibName name 'BTextView_Create'; + +function BTextView_Create(AObject : TBeObject; data : TCPlusObject): TCPlusObject; cdecl; external BePascalLibName name 'BTextView_Create_1'; +procedure BTextView_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_FREE'; +function BTextView_Instantiate(AObject : TCPlusObject; data : TCPlusObject) : TArchivable; cdecl; external BePascalLibName name 'BTextView_Instantiate'; +function BTextView_Archive(AObject : TCPlusObject; data : TCPlusObject; deep : boolean) : TStatus_t; cdecl; external BePascalLibName name 'BTextView_Archive'; +procedure BTextView_AttachedToWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_AttachedToWindow'; +procedure BTextView_DetachedFromWindow(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_DetachedFromWindow'; +procedure BTextView_Draw(AObject : TCPlusObject; inRect : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Draw'; +procedure BTextView_MouseDown(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MouseDown'; +procedure BTextView_MouseUp(AObject : TCPlusObject; where : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MouseUp'; +procedure BTextView_MouseMoved(AObject : TCPlusObject; where : TCPlusObject; code : Cardinal; message : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MouseMoved'; +procedure BTextView_WindowActivated(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BTextView_WindowActivated'; +procedure BTextView_KeyDown(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BTextView_KeyDown'; +procedure BTextView_Pulse(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Pulse'; +procedure BTextView_FrameResized(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BTextView_FrameResized'; +procedure BTextView_MakeFocus(AObject : TCPlusObject; focusState : boolean); cdecl; external BePascalLibName name 'BTextView_MakeFocus'; +procedure BTextView_MessageReceived(AObject : TCPlusObject; message : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MessageReceived'; +function BTextView_ResolveSpecifier(AObject : TCPlusObject; message : TCPlusObject; index : integer; specifier : TCPlusObject; form : integer; properti : PChar) : THandler; cdecl; external BePascalLibName name 'BTextView_ResolveSpecifier'; +function BTextView_GetSupportedSuites(AObject : TCPlusObject; data : TCPlusObject) : TStatus_t; cdecl; external BePascalLibName name 'BTextView_GetSupportedSuites'; +function BTextView_Perform(AObject : TCPlusObject; d : TPerform_code; arg : Pointer) : TStatus_t; cdecl; external BePascalLibName name 'BTextView_Perform'; +//procedure BTextView_SetText(AObject : TCPlusObject; inText : PChar; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_SetText'; +//procedure BTextView_SetText(AObject : TCPlusObject; inText : PChar; inLength : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_SetText'; +//procedure BTextView_SetText(AObject : TCPlusObject; inFile : TFile; startOffset : integer; inLength : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_SetText'; +//procedure BTextView_Insert(AObject : TCPlusObject; inText : PChar; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_Insert'; +//procedure BTextView_Insert(AObject : TCPlusObject; inText : PChar; inLength : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_Insert'; +//procedure BTextView_Insert(AObject : TCPlusObject; startOffset : integer; inText : PChar; inLength : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_Insert'; +procedure BTextView_Delete(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Delete'; +procedure BTextView_Delete(AObject : TCPlusObject; startOffset : integer; endOffset : integer); cdecl; external BePascalLibName name 'BTextView_Delete'; +function BTextView_Text(AObject : TCPlusObject) : PChar; cdecl; external BePascalLibName name 'BTextView_Text'; +function BTextView_TextLength(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_TextLength'; +procedure BTextView_GetText(AObject : TCPlusObject; offset : integer; length : integer; buffer : PChar); cdecl; external BePascalLibName name 'BTextView_GetText'; +function BTextView_ByteAt(AObject : TCPlusObject; offset : integer) : PChar; cdecl; external BePascalLibName name 'BTextView_ByteAt'; +function BTextView_CountLines(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_CountLines'; +function BTextView_CurrentLine(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_CurrentLine'; +procedure BTextView_GoToLine(AObject : TCPlusObject; lineNum : integer); cdecl; external BePascalLibName name 'BTextView_GoToLine'; +//procedure BTextView_Cut(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Cut'; +//procedure BTextView_Copy(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Copy'; +//procedure BTextView_Paste(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Paste'; +procedure BTextView_Clear(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Clear'; +//function BTextView_AcceptsPaste(AObject : TCPlusObject; clipboard : TClipboard) : boolean; cdecl; external BePascalLibName name 'BTextView_AcceptsPaste'; +function BTextView_AcceptsDrop(AObject : TCPlusObject; inMessage : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_AcceptsDrop'; +procedure BTextView_Select(AObject : TCPlusObject; startOffset : integer; endOffset : integer); cdecl; external BePascalLibName name 'BTextView_Select'; +procedure BTextView_SelectAll(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_SelectAll'; +//procedure BTextView_GetSelection(AObject : TCPlusObject; outStart : ^integer; outEnd : ^integer); cdecl; external BePascalLibName name 'BTextView_GetSelection'; +//procedure BTextView_SetFontAndColor(AObject : TCPlusObject; inFont : TFont; inMode : Cardinal; inColor : Trgb_color); cdecl; external BePascalLibName name 'BTextView_SetFontAndColor'; +//procedure BTextView_SetFontAndColor(AObject : TCPlusObject; startOffset : integer; endOffset : integer; inFont : TFont; inMode : Cardinal; inColor : Trgb_color); cdecl; external BePascalLibName name 'BTextView_SetFontAndColor'; +//procedure BTextView_GetFontAndColor(AObject : TCPlusObject; inOffset : integer; outFont : TFont; outColor : Trgb_color); cdecl; external BePascalLibName name 'BTextView_GetFontAndColor'; +//procedure BTextView_GetFontAndColor(AObject : TCPlusObject; outFont : TFont; outMode : integer; outColor : Trgb_color; outEqColor : boolean); cdecl; external BePascalLibName name 'BTextView_GetFontAndColor'; +//procedure BTextView_SetRunArray(AObject : TCPlusObject; startOffset : integer; endOffset : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_SetRunArray'; +//function BTextView_RunArray(AObject : TCPlusObject; startOffset : integer; endOffset : integer; outSize : ^integer) : Ttext_run_array; cdecl; external BePascalLibName name 'BTextView_RunArray'; +function BTextView_LineAt(AObject : TCPlusObject; offset : integer) : integer; cdecl; external BePascalLibName name 'BTextView_LineAt'; +function BTextView_LineAt(AObject : TCPlusObject; point : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_LineAt'; +function BTextView_PointAt(AObject : TCPlusObject; inOffset : integer; outHeight : double) : TPoint; cdecl; external BePascalLibName name 'BTextView_PointAt'; +function BTextView_OffsetAt(AObject : TCPlusObject; point : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_OffsetAt'; +function BTextView_OffsetAt(AObject : TCPlusObject; line : integer) : integer; cdecl; external BePascalLibName name 'BTextView_OffsetAt'; +procedure BTextView_FindWord(AObject : TCPlusObject; inOffset : integer; outFromOffset : integer; outToOffset : integer); cdecl; external BePascalLibName name 'BTextView_FindWord'; +function BTextView_CanEndLine(AObject : TCPlusObject; offset : integer) : boolean; cdecl; external BePascalLibName name 'BTextView_CanEndLine'; +function BTextView_LineWidth(AObject : TCPlusObject; lineNum : integer) : double; cdecl; external BePascalLibName name 'BTextView_LineWidth'; +function BTextView_LineHeight(AObject : TCPlusObject; lineNum : integer) : double; cdecl; external BePascalLibName name 'BTextView_LineHeight'; +function BTextView_TextHeight(AObject : TCPlusObject; startLine : integer; endLine : integer) : double; cdecl; external BePascalLibName name 'BTextView_TextHeight'; +//procedure BTextView_GetTextRegion(AObject : TCPlusObject; startOffset : integer; endOffset : integer; outRegion : TRegion); cdecl; external BePascalLibName name 'BTextView_GetTextRegion'; +procedure BTextView_ScrollToOffset(AObject : TCPlusObject; inOffset : integer); cdecl; external BePascalLibName name 'BTextView_ScrollToOffset'; +procedure BTextView_ScrollToSelection(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_ScrollToSelection'; +procedure BTextView_Highlight(AObject : TCPlusObject; startOffset : integer; endOffset : integer); cdecl; external BePascalLibName name 'BTextView_Highlight'; +procedure BTextView_SetTextRect(AObject : TCPlusObject; rect : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_SetTextRect'; +function BTextView_TextRect(AObject : TCPlusObject) : TRect; cdecl; external BePascalLibName name 'BTextView_TextRect'; +procedure BTextView_SetStylable(AObject : TCPlusObject; stylable : boolean); cdecl; external BePascalLibName name 'BTextView_SetStylable'; +function BTextView_IsStylable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsStylable'; +procedure BTextView_SetTabWidth(AObject : TCPlusObject; width : double); cdecl; external BePascalLibName name 'BTextView_SetTabWidth'; +function BTextView_TabWidth(AObject : TCPlusObject) : double; cdecl; external BePascalLibName name 'BTextView_TabWidth'; +procedure BTextView_MakeSelectable(AObject : TCPlusObject; selectable : boolean); cdecl; external BePascalLibName name 'BTextView_MakeSelectable'; +function BTextView_IsSelectable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsSelectable'; +procedure BTextView_MakeEditable(AObject : TCPlusObject; editable : boolean); cdecl; external BePascalLibName name 'BTextView_MakeEditable'; +function BTextView_IsEditable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsEditable'; +procedure BTextView_SetWordWrap(AObject : TCPlusObject; wrap : boolean); cdecl; external BePascalLibName name 'BTextView_SetWordWrap'; +function BTextView_DoesWordWrap(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_DoesWordWrap'; +procedure BTextView_SetMaxBytes(AObject : TCPlusObject; max : integer); cdecl; external BePascalLibName name 'BTextView_SetMaxBytes'; +function BTextView_MaxBytes(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BTextView_MaxBytes'; +procedure BTextView_DisallowChar(AObject : TCPlusObject; aChar : Cardinal); cdecl; external BePascalLibName name 'BTextView_DisallowChar'; +procedure BTextView_AllowChar(AObject : TCPlusObject; aChar : Cardinal); cdecl; external BePascalLibName name 'BTextView_AllowChar'; +procedure BTextView_SetAlignment(AObject : TCPlusObject; flag : Talignment); cdecl; external BePascalLibName name 'BTextView_SetAlignment'; +function BTextView_Alignment(AObject : TCPlusObject) : Talignment; cdecl; external BePascalLibName name 'BTextView_Alignment'; +procedure BTextView_SetAutoindent(AObject : TCPlusObject; state : boolean); cdecl; external BePascalLibName name 'BTextView_SetAutoindent'; +function BTextView_DoesAutoindent(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_DoesAutoindent'; +//procedure BTextView_SetColorSpace(AObject : TCPlusObject; colors : TColor_Space); cdecl; external BePascalLibName name 'BTextView_SetColorSpace'; +//function BTextView_ColorSpace(AObject : TCPlusObject) : TColor_Space; cdecl; external BePascalLibName name 'BTextView_ColorSpace'; +procedure BTextView_MakeResizable(AObject : TCPlusObject; resize : boolean; resizeView : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_MakeResizable'; +function BTextView_IsResizable(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsResizable'; +procedure BTextView_SetDoesUndo(AObject : TCPlusObject; undo : boolean); cdecl; external BePascalLibName name 'BTextView_SetDoesUndo'; +function BTextView_DoesUndo(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_DoesUndo'; +procedure BTextView_HideTyping(AObject : TCPlusObject; enabled : boolean); cdecl; external BePascalLibName name 'BTextView_HideTyping'; +function BTextView_IsTypingHidden(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BTextView_IsTypingHidden'; +procedure BTextView_ResizeToPreferred(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_ResizeToPreferred'; +procedure BTextView_GetPreferredSize(AObject : TCPlusObject; width : double; height : double); cdecl; external BePascalLibName name 'BTextView_GetPreferredSize'; +procedure BTextView_AllAttached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_AllAttached'; +procedure BTextView_AllDetached(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_AllDetached'; +//function BTextView_FlattenRunArray(AObject : TCPlusObject; inArray : Ttext_tun_array; outSize : ^integer) : Pointer; cdecl; external BePascalLibName name 'BTextView_FlattenRunArray'; +//function BTextView_UnflattenRunArray(AObject : TCPlusObject; data : Pointer; outSize : ^integer) : Ttext_run_array; cdecl; external BePascalLibName name 'BTextView_UnflattenRunArray'; +//procedure BTextView_InsertText(AObject : TCPlusObject; inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array); cdecl; external BePascalLibName name 'BTextView_InsertText'; +//procedure BTextView_Undo(AObject : TCPlusObject; clipboard : TClipboard); cdecl; external BePascalLibName name 'BTextView_Undo'; +//function BTextView_UndoState(AObject : TCPlusObject; isRedo : boolean) : Tunde_state; cdecl; external BePascalLibName name 'BTextView_UndoState'; +//procedure BTextView_GetDragParameters(AObject : TCPlusObject; drag : TMessage; bitmap : TBitmap; point : TPoint; handler : THandler); cdecl; external BePascalLibName name 'BTextView_GetDragParameters'; +procedure BTextView__ReservedTextView3(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView3'; +procedure BTextView__ReservedTextView4(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView4'; +procedure BTextView__ReservedTextView5(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView5'; +procedure BTextView__ReservedTextView6(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView6'; +procedure BTextView__ReservedTextView7(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView7'; +procedure BTextView__ReservedTextView8(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView8'; +procedure BTextView__ReservedTextView9(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView9'; +procedure BTextView__ReservedTextView10(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView10'; +procedure BTextView__ReservedTextView11(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView11'; +procedure BTextView__ReservedTextView12(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView__ReservedTextView12'; +//procedure BTextView_InitObject(AObject : TCPlusObject; textRect : TRect; initialFont : TFont; initialColor : Trgb_color); cdecl; external BePascalLibName name 'BTextView_InitObject'; +procedure BTextView_HandleBackspace(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_HandleBackspace'; +procedure BTextView_HandleArrowKey(AObject : TCPlusObject; inArrowKey : Cardinal); cdecl; external BePascalLibName name 'BTextView_HandleArrowKey'; +procedure BTextView_HandleDelete(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_HandleDelete'; +procedure BTextView_HandlePageKey(AObject : TCPlusObject; inPageKey : Cardinal); cdecl; external BePascalLibName name 'BTextView_HandlePageKey'; +procedure BTextView_HandleAlphaKey(AObject : TCPlusObject; bytes : PChar; numBytes : integer); cdecl; external BePascalLibName name 'BTextView_HandleAlphaKey'; +procedure BTextView_Refresh(AObject : TCPlusObject; fromOffset : integer; toOffset : integer; erase : boolean; scroll : boolean); cdecl; external BePascalLibName name 'BTextView_Refresh'; +//procedure BTextView_RecalLineBreaks(AObject : TCPlusObject; startLine : ^integer; endLine : ^integer); cdecl; external BePascalLibName name 'BTextView_RecalLineBreaks'; +function BTextView_FindLineBreak(AObject : TCPlusObject; fromOffset : integer; outAscent : double; outDescent : double; ioWidth : double) : integer; cdecl; external BePascalLibName name 'BTextView_FindLineBreak'; +function BTextView_StyledWidth(AObject : TCPlusObject; fromOffset : integer; length : integer; outAscent : double; outDescent : double) : double; cdecl; external BePascalLibName name 'BTextView_StyledWidth'; +function BTextView_ActualTabWidth(AObject : TCPlusObject; location : double) : double; cdecl; external BePascalLibName name 'BTextView_ActualTabWidth'; +//procedure BTextView_DoInsertText(AObject : TCPlusObject; inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array; outResult : ); cdecl; external BePascalLibName name 'BTextView_DoInsertText'; +//procedure BTextView_DoDeleteText(AObject : TCPlusObject; fromOffset : integer; toOffset : integer; outResult : ); cdecl; external BePascalLibName name 'BTextView_DoDeleteText'; +procedure BTextView_DrawLines(AObject : TCPlusObject; startLine : integer; endLine : integer; startOffset : integer; erase : boolean); cdecl; external BePascalLibName name 'BTextView_DrawLines'; +procedure BTextView_DrawCaret(AObject : TCPlusObject; offset : integer); cdecl; external BePascalLibName name 'BTextView_DrawCaret'; +procedure BTextView_InvertCaret(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_InvertCaret'; +procedure BTextView_DragCaret(AObject : TCPlusObject; offset : integer); cdecl; external BePascalLibName name 'BTextView_DragCaret'; +procedure BTextView_StopMouseTracking(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_StopMouseTracking'; +function BTextView_PerformMouseUp(AObject : TCPlusObject; where : TPoint) : boolean; cdecl; external BePascalLibName name 'BTextView_PerformMouseUp'; +function BTextView_PerformMouseMoved(AObject : TCPlusObject; where : TPoint; code : Cardinal) : boolean; cdecl; external BePascalLibName name 'BTextView_PerformMouseMoved'; +procedure BTextView_TrackMouse(AObject : TCPlusObject; where : TPoint; message : TMessage; force : boolean); cdecl; external BePascalLibName name 'BTextView_TrackMouse'; +procedure BTextView_TrackDrag(AObject : TCPlusObject; where : TPoint); cdecl; external BePascalLibName name 'BTextView_TrackDrag'; +procedure BTextView_InitiateDrag(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_InitiateDrag'; +function BTextView_MessageDropped(AObject : TCPlusObject; inMessage : TMessage; where : TPoint; offset : TPoint) : boolean; cdecl; external BePascalLibName name 'BTextView_MessageDropped'; +procedure BTextView_UpdateScrollbars(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_UpdateScrollbars'; +procedure BTextView_AutoResize(AObject : TCPlusObject; doredraw : boolean); cdecl; external BePascalLibName name 'BTextView_AutoResize'; +procedure BTextView_NewOffscreen(AObject : TCPlusObject; padding : double); cdecl; external BePascalLibName name 'BTextView_NewOffscreen'; +procedure BTextView_DeleteOffscreen(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_DeleteOffscreen'; +procedure BTextView_Activate(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Activate'; +procedure BTextView_Deactivate(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_Deactivate'; +//procedure BTextView_NormalizeFont(AObject : TCPlusObject; font : TFont); cdecl; external BePascalLibName name 'BTextView_NormalizeFont'; +function BTextView_CharClassification(AObject : TCPlusObject; offset : integer) : Cardinal; cdecl; external BePascalLibName name 'BTextView_CharClassification'; +function BTextView_NextInitialByte(AObject : TCPlusObject; offset : integer) : integer; cdecl; external BePascalLibName name 'BTextView_NextInitialByte'; +function BTextView_PreviousInitialByte(AObject : TCPlusObject; offset : integer) : integer; cdecl; external BePascalLibName name 'BTextView_PreviousInitialByte'; +//function BTextView_GetProperty(AObject : TCPlusObject; specifier : TMessage; form : integer; property : PChar; reply : TMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_GetProperty'; +function BTextView_SetProperty(AObject : TCPlusObject; specifier : TMessage; form : integer; properti : PChar; reply : TMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_SetProperty'; +function BTextView_CountProperties(AObject : TCPlusObject; specifier : TMessage; form : integer; properti : PChar; reply : TMessage) : boolean; cdecl; external BePascalLibName name 'BTextView_CountProperties'; +procedure BTextView_HandleInputMethodChanged(AObject : TCPlusObject; message : TMessage); cdecl; external BePascalLibName name 'BTextView_HandleInputMethodChanged'; +procedure BTextView_HandleInputMethodLocationRequest(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_HandleInputMethodLocationRequest'; +procedure BTextView_CancelInputMethod(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_CancelInputMethod'; +procedure BTextView_LockWidthBuffer(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_LockWidthBuffer'; +procedure BTextView_UnlockWidthBuffer(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BTextView_UnlockWidthBuffer'; + +implementation + + +constructor TTextView.Create(frame : TRect; name : pchar;atextRect: TRect ; resizeMask, flags : cardinal); +begin + CreatePas; + CPlusObject := BTextView_Create(Self, frame.CplusObject,name,atextRect.CPlusObject,resizeMask,flags); +end; + +constructor TTextView.Create(data : TMessage); +begin + CreatePas; + CPlusObject := BTextView_Create(Self, data.CPlusObject); +end; + +destructor TTextView.Destroy; +begin + BTextView_Free(CPlusObject); + inherited; +end; + +function TTextView.Instantiate(data : TMessage) : TArchivable; +begin + Result := BTextView_Instantiate(CPlusObject, data.CPlusObject); +end; + +function TTextView.Archive(data : TMessage; deep : boolean) : TStatus_t; +begin + Result := BTextView_Archive(CPlusObject, data.CPlusObject, deep); +end; + +procedure TTextView.AttachedToWindow; +begin +// BTextView_AttachedToWindow(CPlusObject); +end; + +procedure TTextView.DetachedFromWindow; +begin +// BTextView_DetachedFromWindow(CPlusObject); +end; + +procedure TTextView.Draw(inRect : TRect); +begin + // BTextView_Draw(CPlusObject, inRect.CPlusObject); +end; + +procedure TTextView.MouseDown(where : TPoint); +begin +// BTextView_MouseDown(CPlusObject, where.CPlusObject); +end; + +procedure TTextView.MouseUp(where : TPoint); +begin + //BTextView_MouseUp(CPlusObject, where.CPlusObject); +end; + +procedure TTextView.MouseMoved(where : TPoint; code : Cardinal; message : TMessage); +begin + //BTextView_MouseMoved(CPlusObject, where.CPlusObject, code, message); +end; + +procedure TTextView.WindowActivated(state : boolean); +begin + //BTextView_WindowActivated(CPlusObject, state); +end; + +procedure TTextView.KeyDown(bytes : PChar; numBytes : integer); +begin + writeln(self.countlines); + //BTextView_KeyDown(CPlusObject, bytes, numBytes); +end; + +procedure TTextView.Pulse; +begin + //BTextView_Pulse(CPlusObject); +end; + +procedure TTextView.FrameResized(width : double; height : double); +begin + // BTextView_FrameResized(CPlusObject, width, height); +end; + +procedure TTextView.MakeFocus(focusState : boolean); +begin + BTextView_MakeFocus(CPlusObject, focusState); +end; + +procedure TTextView.MessageReceived(message : TMessage); +begin +// BTextView_MessageReceived(CPlusObject, message.CPlusObject); +end; + +function TTextView.ResolveSpecifier(message : TMessage; index : integer; specifier : TMessage; form : integer; properti : PChar) : THandler; +begin + //Result := BTextView_ResolveSpecifier(CPlusObject, message.CPlusObject, index, specifier.CPlusObject, form, properti); +end; + +function TTextView.GetSupportedSuites(data : TMessage) : TStatus_t; +begin + Result := BTextView_GetSupportedSuites(CPlusObject, data.CPlusObject); +end; + +function TTextView.Perform(d : TPerform_code; arg : Pointer) : TStatus_t; +begin + Result := BTextView_Perform(CPlusObject, d, arg); +end; + +{procedure TTextView.SetText(inText : PChar; inRuns : Ttext_tun_array); +begin + BTextView_SetText(CPlusObject, inText, inRuns); +end; + +procedure TTextView.SetText(inText : PChar; inLength : integer; inRuns : Ttext_tun_array); +begin + BTextView_SetText(CPlusObject, inText, inLength, inRuns); +end; + +procedure TTextView.SetText(inFile : TFile; startOffset : integer; inLength : integer; inRuns : Ttext_tun_array); +begin + BTextView_SetText(CPlusObject, inFile.CPlusObject, startOffset, inLength, inRuns); +end; + +procedure TTextView.Insert(inText : PChar; inRuns : Ttext_tun_array); +begin + BTextView_Insert(CPlusObject, inText, inRuns); +end; + +procedure TTextView.Insert(inText : PChar; inLength : integer; inRuns : Ttext_tun_array); +begin + BTextView_Insert(CPlusObject, inText, inLength, inRuns); +end; + +procedure TTextView.Insert(startOffset : integer; inText : PChar; inLength : integer; inRuns : Ttext_tun_array); +begin + BTextView_Insert(CPlusObject, startOffset, inText, inLength, inRuns); +end; +} +procedure TTextView.Delete; +begin + BTextView_Delete(CPlusObject); +end; + +procedure TTextView.Delete(startOffset : integer; endOffset : integer); +begin + BTextView_Delete(CPlusObject, startOffset, endOffset); +end; + +function TTextView.Text : PChar; +begin + Result := BTextView_Text(CPlusObject); +end; + +function TTextView.TextLength : integer; +begin + Result := BTextView_TextLength(CPlusObject); +end; + +procedure TTextView.GetText(offset : integer; length : integer; buffer : PChar); +begin + BTextView_GetText(CPlusObject, offset, length, buffer); +end; + +function TTextView.ByteAt(offset : integer) : PChar; +begin + Result := BTextView_ByteAt(CPlusObject, offset); +end; + +function TTextView.CountLines : integer; +begin + Result := BTextView_CountLines(CPlusObject); +end; + +function TTextView.CurrentLine : integer; +begin + Result := BTextView_CurrentLine(CPlusObject); +end; + +procedure TTextView.GoToLine(lineNum : integer); +begin + BTextView_GoToLine(CPlusObject, lineNum); +end; + +{procedure TTextView.Cut(clipboard : TClipboard); +begin + BTextView_Cut(CPlusObject, clipboard.CPlusObject); +end; + +procedure TTextView.Copy(clipboard : TClipboard); +begin + BTextView_Copy(CPlusObject, clipboard.CPlusObject); +end; + +procedure TTextView.Paste(clipboard : TClipboard); +begin + BTextView_Paste(CPlusObject, clipboard.CPlusObject); +end; + +procedure TTextView.Clear; +begin + BTextView_Clear(CPlusObject); +end; + +function TTextView.AcceptsPaste(clipboard : TClipboard) : boolean; +begin + Result := BTextView_AcceptsPaste(CPlusObject, clipboard.CPlusObject); +end; +} +function TTextView.AcceptsDrop(inMessage : TMessage) : boolean; +begin + Result := BTextView_AcceptsDrop(CPlusObject, inMessage); +end; + +procedure TTextView.Select(startOffset : integer; endOffset : integer); +begin + BTextView_Select(CPlusObject, startOffset, endOffset); +end; + +procedure TTextView.SelectAll; +begin + BTextView_SelectAll(CPlusObject); +end; + +{procedure TTextView.GetSelection(outStart : integer; outEnd : integer); +begin + BTextView_GetSelection(CPlusObject, outStart, outEnd); +end; + +procedure TTextView.SetFontAndColor(inFont : TFont; inMode : Cardinal; inColor : Trgb_color); +begin + BTextView_SetFontAndColor(CPlusObject, inFont, inMode, inColor); +end; + +procedure TTextView.SetFontAndColor(startOffset : integer; endOffset : integer; inFont : TFont; inMode : Cardinal; inColor : Trgb_color); +begin + BTextView_SetFontAndColor(CPlusObject, startOffset, endOffset, inFont, inMode, inColor); +end; + +procedure TTextView.GetFontAndColor(inOffset : integer; outFont : TFont; outColor : Trgb_color); +begin + BTextView_GetFontAndColor(CPlusObject, inOffset, outFont.CPlusObject, outColor); +end; + +procedure TTextView.GetFontAndColor(outFont : TFont; outMode : integer; outColor : Trgb_color; outEqColor : boolean); +begin + BTextView_GetFontAndColor(CPlusObject, outFont.CPlusObject, outMode, outColor, outEqColor); +end; + +procedure TTextView.SetRunArray(startOffset : integer; endOffset : integer; inRuns : Ttext_tun_array); +begin + BTextView_SetRunArray(CPlusObject, startOffset, endOffset, inRuns); +end; + +function TTextView.RunArray(startOffset : integer; endOffset : integer; outSize : ^integer) : Ttext_run_array; +begin + Result := BTextView_RunArray(CPlusObject, startOffset, endOffset, outSize); +end; +} +function TTextView.LineAt(offset : integer) : integer; +begin + Result := BTextView_LineAt(CPlusObject, offset); +end; + +function TTextView.LineAt(point : TPoint) : integer; +begin + Result := BTextView_LineAt(CPlusObject, point.CPlusObject); +end; + +function TTextView.PointAt(inOffset : integer; outHeight : double) : TPoint; +begin + Result := BTextView_PointAt(CPlusObject, inOffset, outHeight); +end; + +function TTextView.OffsetAt(point : TPoint) : integer; +begin + Result := BTextView_OffsetAt(CPlusObject, point.CPlusObject); +end; + +function TTextView.OffsetAt(line : integer) : integer; +begin + Result := BTextView_OffsetAt(CPlusObject, line); +end; + +procedure TTextView.FindWord(inOffset : integer; outFromOffset : integer; outToOffset : integer); +begin + BTextView_FindWord(CPlusObject, inOffset, outFromOffset, outToOffset); +end; + +function TTextView.CanEndLine(offset : integer) : boolean; +begin + Result := BTextView_CanEndLine(CPlusObject, offset); +end; + +function TTextView.LineWidth(lineNum : integer) : double; +begin + Result := BTextView_LineWidth(CPlusObject, lineNum); +end; + +function TTextView.LineHeight(lineNum : integer) : double; +begin + Result := BTextView_LineHeight(CPlusObject, lineNum); +end; + +function TTextView.TextHeight(startLine : integer; endLine : integer) : double; +begin + Result := BTextView_TextHeight(CPlusObject, startLine, endLine); +end; + +{procedure TTextView.GetTextRegion(startOffset : integer; endOffset : integer; outRegion : TRegion); +begin + BTextView_GetTextRegion(CPlusObject, startOffset, endOffset, outRegion.CPlusObject); +end; +} +procedure TTextView.ScrollToOffset(inOffset : integer); +begin + BTextView_ScrollToOffset(CPlusObject, inOffset); +end; + +procedure TTextView.ScrollToSelection; +begin + BTextView_ScrollToSelection(CPlusObject); +end; + +procedure TTextView.Highlight(startOffset : integer; endOffset : integer); +begin + BTextView_Highlight(CPlusObject, startOffset, endOffset); +end; + +procedure TTextView.SetTextRect(rect : TRect); +begin + BTextView_SetTextRect(CPlusObject, rect.CPlusObject); +end; + +function TTextView.TextRect : TRect; +begin + Result := BTextView_TextRect(CPlusObject); +end; + +procedure TTextView.SetStylable(stylable : boolean); +begin + BTextView_SetStylable(CPlusObject, stylable); +end; + +function TTextView.IsStylable : boolean; +begin + Result := BTextView_IsStylable(CPlusObject); +end; + +procedure TTextView.SetTabWidth(width : double); +begin + BTextView_SetTabWidth(CPlusObject, width); +end; + +function TTextView.TabWidth : double; +begin + Result := BTextView_TabWidth(CPlusObject); +end; + +procedure TTextView.MakeSelectable(selectable : boolean); +begin + BTextView_MakeSelectable(CPlusObject, selectable); +end; + +function TTextView.IsSelectable : boolean; +begin + Result := BTextView_IsSelectable(CPlusObject); +end; + +procedure TTextView.MakeEditable(editable : boolean); +begin + BTextView_MakeEditable(CPlusObject, editable); +end; + +function TTextView.IsEditable : boolean; +begin + Result := BTextView_IsEditable(CPlusObject); +end; + +procedure TTextView.SetWordWrap(awrap : boolean); +begin + BTextView_SetWordWrap(CPlusObject, awrap); +end; + +function TTextView.DoesWordWrap : boolean; +begin + Result := BTextView_DoesWordWrap(CPlusObject); +end; + +procedure TTextView.SetMaxBytes(max : integer); +begin + BTextView_SetMaxBytes(CPlusObject, max); +end; + +function TTextView.MaxBytes : integer; +begin + Result := BTextView_MaxBytes(CPlusObject); +end; + +procedure TTextView.DisallowChar(aChar : Cardinal); +begin + BTextView_DisallowChar(CPlusObject, aChar); +end; + +procedure TTextView.AllowChar(aChar : Cardinal); +begin + BTextView_AllowChar(CPlusObject, aChar); +end; + +procedure TTextView.SetAlignment(flag : Talignment); +begin + BTextView_SetAlignment(CPlusObject, flag); +end; + +function TTextView.Alignment : Talignment; +begin + Result := BTextView_Alignment(CPlusObject); +end; + +procedure TTextView.SetAutoindent(state : boolean); +begin + BTextView_SetAutoindent(CPlusObject, state); +end; + +function TTextView.DoesAutoindent : boolean; +begin + Result := BTextView_DoesAutoindent(CPlusObject); +end; + +{procedure TTextView.SetColorSpace(colors : TColor_Space); +begin + BTextView_SetColorSpace(CPlusObject, colors); +end; + +function TTextView.ColorSpace : TColor_Space; +begin + Result := BTextView_ColorSpace(CPlusObject); +end; +} +procedure TTextView.MakeResizable(resize : boolean; resizeView : TView); +begin + BTextView_MakeResizable(CPlusObject, resize, resizeView.CPlusObject); +end; + +function TTextView.IsResizable : boolean; +begin + Result := BTextView_IsResizable(CPlusObject); +end; + +procedure TTextView.SetDoesUndo(undo : boolean); +begin + BTextView_SetDoesUndo(CPlusObject, undo); +end; + +function TTextView.DoesUndo : boolean; +begin + Result := BTextView_DoesUndo(CPlusObject); +end; + +procedure TTextView.HideTyping(enabled : boolean); +begin + BTextView_HideTyping(CPlusObject, enabled); +end; + +function TTextView.IsTypingHidden : boolean; +begin + Result := BTextView_IsTypingHidden(CPlusObject); +end; + +procedure TTextView.ResizeToPreferred; +begin + BTextView_ResizeToPreferred(CPlusObject); +end; + +procedure TTextView.GetPreferredSize(width : double; height : double); +begin + BTextView_GetPreferredSize(CPlusObject, width, height); +end; + +procedure TTextView.AllAttached; +begin + BTextView_AllAttached(CPlusObject); +end; + +procedure TTextView.AllDetached; +begin + BTextView_AllDetached(CPlusObject); +end; + +{function TTextView.FlattenRunArray(inArray : Ttext_tun_array; outSize : integer) : Pointer; +begin + Result := BTextView_FlattenRunArray(CPlusObject, inArray, outSize); +end; + + +function TTextView.UnflattenRunArray(data : Pointer; outSize : integer) : Ttext_run_array; +begin + Result := BTextView_UnflattenRunArray(CPlusObject, data, outSize); +end; + +procedure TTextView.InsertText(inText : PChar; inLength : integer; inOffset : integer; inRuns : Ttext_tun_array); +begin + BTextView_InsertText(CPlusObject, inText, inLength, inOffset, inRuns); +end; +} + +{procedure TTextView.Undo(clipboard : TClipboard); +begin + BTextView_Undo(CPlusObject, clipboard.CPlusObject); +end; + +function TTextView.UndoState(isRedo : boolean) : Tundo_state; +begin + Result := BTextView_UndoState(CPlusObject, isRedo); +end; + +procedure TTextView.GetDragParameters(drag : TMessage; bitmap : TBitmap; point : TPoint; handler : THandler); +begin + BTextView_GetDragParameters(CPlusObject, drag.CPlusObject, bitmap.CPlusObject, point.CPlusObject, handler.CPlusObject); +end; +} + + +end.