Update header indentation style.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27643 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, Haiku, Inc.
|
* Copyright (c) 2007-2008, Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT license.
|
* Distributed under the terms of the MIT license.
|
||||||
*/
|
*/
|
||||||
#ifndef _TEXTVIEW_H
|
#ifndef _TEXTVIEW_H
|
||||||
@@ -47,13 +47,17 @@ enum undo_state {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class BTextView : public BView {
|
class BTextView : public BView {
|
||||||
public:
|
public:
|
||||||
BTextView(BRect frame, const char* name, BRect textRect,
|
BTextView(BRect frame, const char* name,
|
||||||
uint32 resizeMask, uint32 flags = B_WILL_DRAW | B_PULSE_NEEDED);
|
BRect textRect, uint32 resizeMask,
|
||||||
BTextView(BRect frame, const char* name, BRect textRect,
|
uint32 flags
|
||||||
const BFont* initialFont, const rgb_color* initialColor,
|
= B_WILL_DRAW | B_PULSE_NEEDED);
|
||||||
|
BTextView(BRect frame, const char* name,
|
||||||
|
BRect textRect, const BFont* initialFont,
|
||||||
|
const rgb_color* initialColor,
|
||||||
uint32 resizeMask, uint32 flags);
|
uint32 resizeMask, uint32 flags);
|
||||||
BTextView(BMessage* data);
|
BTextView(BMessage* data);
|
||||||
|
|
||||||
virtual ~BTextView();
|
virtual ~BTextView();
|
||||||
|
|
||||||
static BArchivable* Instantiate(BMessage* data);
|
static BArchivable* Instantiate(BMessage* data);
|
||||||
@@ -61,11 +65,11 @@ class BTextView : public BView {
|
|||||||
|
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
virtual void DetachedFromWindow();
|
virtual void DetachedFromWindow();
|
||||||
virtual void Draw(BRect inRect);
|
virtual void Draw(BRect updateRect);
|
||||||
virtual void MouseDown(BPoint where);
|
virtual void MouseDown(BPoint where);
|
||||||
virtual void MouseUp(BPoint where);
|
virtual void MouseUp(BPoint where);
|
||||||
virtual void MouseMoved(BPoint where, uint32 code,
|
virtual void MouseMoved(BPoint where, uint32 code,
|
||||||
const BMessage* message);
|
const BMessage* dragMessage);
|
||||||
virtual void WindowActivated(bool state);
|
virtual void WindowActivated(bool state);
|
||||||
virtual void KeyDown(const char* bytes, int32 numBytes);
|
virtual void KeyDown(const char* bytes, int32 numBytes);
|
||||||
virtual void Pulse();
|
virtual void Pulse();
|
||||||
@@ -74,31 +78,39 @@ class BTextView : public BView {
|
|||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
|
|
||||||
virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
|
virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
|
||||||
BMessage* specifier, int32 form, const char* property);
|
BMessage* specifier, int32 form,
|
||||||
|
const char* property);
|
||||||
virtual status_t GetSupportedSuites(BMessage* data);
|
virtual status_t GetSupportedSuites(BMessage* data);
|
||||||
virtual status_t Perform(perform_code d, void* arg);
|
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,
|
||||||
|
const text_run_array* inRuns = NULL);
|
||||||
void SetText(const char* inText, int32 inLength,
|
void SetText(const char* inText, int32 inLength,
|
||||||
const text_run_array* inRuns = NULL);
|
const text_run_array* inRuns = NULL);
|
||||||
void SetText(BFile* inFile, int32 startOffset, int32 inLength,
|
void SetText(BFile* inFile,
|
||||||
|
int32 startOffset, int32 inLength,
|
||||||
const text_run_array* inRuns = NULL);
|
const text_run_array* inRuns = NULL);
|
||||||
|
|
||||||
void Insert(const char* inText, const text_run_array* inRuns = NULL);
|
void Insert(const char* inText,
|
||||||
void Insert(const char* inText, int32 inLength, const text_run_array* inRuns = NULL);
|
const text_run_array* inRuns = NULL);
|
||||||
void Insert(int32 startOffset, const char* inText, int32 inLength, 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();
|
||||||
void Delete(int32 startOffset, int32 endOffset);
|
void Delete(int32 startOffset, int32 endOffset);
|
||||||
|
|
||||||
const char* Text() const;
|
const char* Text() const;
|
||||||
int32 TextLength() const;
|
int32 TextLength() const;
|
||||||
void GetText(int32 offset, int32 length, char* buffer) const;
|
void GetText(int32 offset, int32 length,
|
||||||
|
char* buffer) const;
|
||||||
uint8 ByteAt(int32 offset) const;
|
uint8 ByteAt(int32 offset) const;
|
||||||
|
|
||||||
int32 CountLines() const;
|
int32 CountLines() const;
|
||||||
int32 CurrentLine() const;
|
int32 CurrentLine() const;
|
||||||
void GoToLine(int32 lineNum);
|
void GoToLine(int32 lineIndex);
|
||||||
|
|
||||||
virtual void Cut(BClipboard* clipboard);
|
virtual void Cut(BClipboard* clipboard);
|
||||||
virtual void Copy(BClipboard* clipboard);
|
virtual void Copy(BClipboard* clipboard);
|
||||||
@@ -110,18 +122,23 @@ class BTextView : public BView {
|
|||||||
|
|
||||||
virtual void Select(int32 startOffset, int32 endOffset);
|
virtual void Select(int32 startOffset, int32 endOffset);
|
||||||
void SelectAll();
|
void SelectAll();
|
||||||
void GetSelection(int32* outStart, int32* outEnd) const;
|
void GetSelection(int32* outStart,
|
||||||
|
int32* outEnd) const;
|
||||||
|
|
||||||
void SetFontAndColor(const BFont* inFont, uint32 inMode = B_FONT_ALL,
|
void SetFontAndColor(const BFont* inFont,
|
||||||
|
uint32 inMode = B_FONT_ALL,
|
||||||
const rgb_color* inColor = NULL);
|
const rgb_color* inColor = NULL);
|
||||||
void SetFontAndColor(int32 startOffset, int32 endOffset,
|
void SetFontAndColor(int32 startOffset,
|
||||||
const BFont* inFont, uint32 inMode = B_FONT_ALL,
|
int32 endOffset, const BFont* inFont,
|
||||||
|
uint32 inMode = B_FONT_ALL,
|
||||||
const rgb_color* inColor = NULL);
|
const rgb_color* inColor = NULL);
|
||||||
|
|
||||||
void GetFontAndColor(int32 inOffset, BFont* outFont,
|
void GetFontAndColor(int32 inOffset, BFont* outFont,
|
||||||
rgb_color* outColor = NULL) const;
|
rgb_color* outColor = NULL) const;
|
||||||
void GetFontAndColor(BFont* outFont, uint32* sameProperties,
|
void GetFontAndColor(BFont* outFont,
|
||||||
rgb_color* outColor = NULL, bool* sameColor = NULL) const;
|
uint32* sameProperties,
|
||||||
|
rgb_color* outColor = NULL,
|
||||||
|
bool* sameColor = NULL) const;
|
||||||
|
|
||||||
void SetRunArray(int32 startOffset, int32 endOffset,
|
void SetRunArray(int32 startOffset, int32 endOffset,
|
||||||
const text_run_array* inRuns);
|
const text_run_array* inRuns);
|
||||||
@@ -130,7 +147,8 @@ class BTextView : public BView {
|
|||||||
|
|
||||||
int32 LineAt(int32 offset) const;
|
int32 LineAt(int32 offset) const;
|
||||||
int32 LineAt(BPoint point) const;
|
int32 LineAt(BPoint point) const;
|
||||||
BPoint PointAt(int32 inOffset, float* outHeight = NULL) const;
|
BPoint PointAt(int32 inOffset,
|
||||||
|
float* outHeight = NULL) const;
|
||||||
int32 OffsetAt(BPoint point) const;
|
int32 OffsetAt(BPoint point) const;
|
||||||
int32 OffsetAt(int32 line) const;
|
int32 OffsetAt(int32 line) const;
|
||||||
|
|
||||||
@@ -139,12 +157,13 @@ class BTextView : public BView {
|
|||||||
|
|
||||||
virtual bool CanEndLine(int32 offset);
|
virtual bool CanEndLine(int32 offset);
|
||||||
|
|
||||||
float LineWidth(int32 lineNum = 0) const;
|
float LineWidth(int32 lineIndex = 0) const;
|
||||||
float LineHeight(int32 lineNum = 0) const;
|
float LineHeight(int32 lineIndex = 0) const;
|
||||||
float TextHeight(int32 startLine, int32 endLine) const;
|
float TextHeight(int32 startLine,
|
||||||
|
int32 endLine) const;
|
||||||
|
|
||||||
void GetTextRegion(int32 startOffset, int32 endOffset,
|
void GetTextRegion(int32 startOffset,
|
||||||
BRegion* outRegion) const;
|
int32 endOffset, BRegion* outRegion) const;
|
||||||
|
|
||||||
virtual void ScrollToOffset(int32 inOffset);
|
virtual void ScrollToOffset(int32 inOffset);
|
||||||
void ScrollToSelection();
|
void ScrollToSelection();
|
||||||
@@ -173,7 +192,8 @@ class BTextView : public BView {
|
|||||||
bool DoesAutoindent() const;
|
bool DoesAutoindent() const;
|
||||||
void SetColorSpace(color_space colors);
|
void SetColorSpace(color_space colors);
|
||||||
color_space ColorSpace() const;
|
color_space ColorSpace() const;
|
||||||
void MakeResizable(bool resize, BView* resizeView = NULL);
|
void MakeResizable(bool resize,
|
||||||
|
BView* resizeView = NULL);
|
||||||
bool IsResizable() const;
|
bool IsResizable() const;
|
||||||
void SetDoesUndo(bool undo);
|
void SetDoesUndo(bool undo);
|
||||||
bool DoesUndo() const;
|
bool DoesUndo() const;
|
||||||
@@ -195,20 +215,22 @@ class BTextView : public BView {
|
|||||||
static text_run_array* UnflattenRunArray(const void* data,
|
static text_run_array* UnflattenRunArray(const void* data,
|
||||||
int32* outSize = NULL);
|
int32* outSize = NULL);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void InsertText(const char* inText, int32 inLength,
|
virtual void InsertText(const char* inText, int32 inLength,
|
||||||
int32 inOffset, const text_run_array* inRuns);
|
int32 inOffset,
|
||||||
|
const text_run_array* inRuns);
|
||||||
virtual void DeleteText(int32 fromOffset, int32 toOffset);
|
virtual void DeleteText(int32 fromOffset, int32 toOffset);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void Undo(BClipboard* clipboard);
|
virtual void Undo(BClipboard* clipboard);
|
||||||
undo_state UndoState(bool* isRedo) const;
|
undo_state UndoState(bool* isRedo) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void GetDragParameters(BMessage* drag, BBitmap** _bitmap,
|
virtual void GetDragParameters(BMessage* drag,
|
||||||
BPoint* point, BHandler** _handler);
|
BBitmap** _bitmap, BPoint* point,
|
||||||
|
BHandler** _handler);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend status_t _init_interface_kit_();
|
friend status_t _init_interface_kit_();
|
||||||
friend class _BTextTrackState_;
|
friend class _BTextTrackState_;
|
||||||
|
|
||||||
@@ -223,40 +245,48 @@ class BTextView : public BView {
|
|||||||
virtual void _ReservedTextView11();
|
virtual void _ReservedTextView11();
|
||||||
virtual void _ReservedTextView12();
|
virtual void _ReservedTextView12();
|
||||||
|
|
||||||
void _InitObject(BRect textRect, const BFont* initialFont,
|
void _InitObject(BRect textRect,
|
||||||
|
const BFont* initialFont,
|
||||||
const rgb_color* initialColor);
|
const rgb_color* initialColor);
|
||||||
|
|
||||||
void _HandleBackspace();
|
void _HandleBackspace();
|
||||||
void _HandleArrowKey(uint32 inArrowKey);
|
void _HandleArrowKey(uint32 inArrowKey);
|
||||||
void _HandleDelete();
|
void _HandleDelete();
|
||||||
void _HandlePageKey(uint32 inPageKey);
|
void _HandlePageKey(uint32 inPageKey);
|
||||||
void _HandleAlphaKey(const char* bytes, int32 numBytes);
|
void _HandleAlphaKey(const char* bytes,
|
||||||
|
int32 numBytes);
|
||||||
|
|
||||||
void _Refresh(int32 fromOffset, int32 toOffset, bool erase, bool scroll);
|
void _Refresh(int32 fromOffset, int32 toOffset,
|
||||||
void _RecalculateLineBreaks(int32* startLine, int32* endLine);
|
bool erase, bool scroll);
|
||||||
int32 _FindLineBreak(int32 fromOffset, float* outAscent,
|
void _RecalculateLineBreaks(int32* startLine,
|
||||||
float* outDescent, float* ioWidth);
|
int32* endLine);
|
||||||
|
int32 _FindLineBreak(int32 fromOffset,
|
||||||
|
float* outAscent, float* outDescent,
|
||||||
|
float* ioWidth);
|
||||||
|
|
||||||
float _StyledWidth(int32 fromOffset, int32 length,
|
float _StyledWidth(int32 fromOffset, int32 length,
|
||||||
float* outAscent = NULL, float* outDescent = NULL) const;
|
float* outAscent = NULL,
|
||||||
|
float* outDescent = NULL) const;
|
||||||
float _StyledWidthUTF8Safe(int32 fromOffset, int32 numChars,
|
float _StyledWidthUTF8Safe(int32 fromOffset,
|
||||||
float* outAscent = NULL, float* outDescent = NULL) const;
|
int32 numChars, float* outAscent = NULL,
|
||||||
|
float* outDescent = NULL) const;
|
||||||
|
|
||||||
float _ActualTabWidth(float location) const;
|
float _ActualTabWidth(float location) const;
|
||||||
|
|
||||||
void _DoInsertText(const char* inText, int32 inLength, int32 inOffset,
|
void _DoInsertText(const char* inText,
|
||||||
const text_run_array* inRuns, _BTextChangeResult_* outResult);
|
int32 inLength, int32 inOffset,
|
||||||
|
const text_run_array* inRuns,
|
||||||
|
_BTextChangeResult_* outResult);
|
||||||
|
|
||||||
void _DoDeleteText(int32 fromOffset, int32 toOffset,
|
void _DoDeleteText(int32 fromOffset, int32 toOffset,
|
||||||
_BTextChangeResult_* outResult);
|
_BTextChangeResult_* outResult);
|
||||||
|
|
||||||
void _DrawLine(BView* view, const int32 &startLine,
|
void _DrawLine(BView* view, const int32 &startLine,
|
||||||
const int32& startOffset, const bool& erase, BRect& eraseRect,
|
const int32& startOffset, const bool& erase,
|
||||||
BRegion& inputRegion);
|
BRect& eraseRect, BRegion& inputRegion);
|
||||||
|
|
||||||
void _DrawLines(int32 startLine, int32 endLine, int32 startOffset = -1,
|
void _DrawLines(int32 startLine, int32 endLine,
|
||||||
bool erase = false);
|
int32 startOffset = -1, bool erase = false);
|
||||||
void _DrawCaret(int32 offset);
|
void _DrawCaret(int32 offset);
|
||||||
void _ShowCaret();
|
void _ShowCaret();
|
||||||
void _HideCaret();
|
void _HideCaret();
|
||||||
@@ -267,18 +297,20 @@ class BTextView : public BView {
|
|||||||
bool _PerformMouseUp(BPoint where);
|
bool _PerformMouseUp(BPoint where);
|
||||||
bool _PerformMouseMoved(BPoint where, uint32 code);
|
bool _PerformMouseMoved(BPoint where, uint32 code);
|
||||||
|
|
||||||
void _TrackMouse(BPoint where, const BMessage* message,
|
void _TrackMouse(BPoint where,
|
||||||
|
const BMessage* message,
|
||||||
bool force = false);
|
bool force = false);
|
||||||
|
|
||||||
void _TrackDrag(BPoint where);
|
void _TrackDrag(BPoint where);
|
||||||
void _InitiateDrag();
|
void _InitiateDrag();
|
||||||
bool _MessageDropped(BMessage* inMessage, BPoint where, BPoint offset);
|
bool _MessageDropped(BMessage* inMessage,
|
||||||
|
BPoint where, BPoint offset);
|
||||||
|
|
||||||
void _PerformAutoScrolling();
|
void _PerformAutoScrolling();
|
||||||
void _UpdateScrollbars();
|
void _UpdateScrollbars();
|
||||||
void _AutoResize(bool doRedraw = true);
|
void _AutoResize(bool doRedraw = true);
|
||||||
|
|
||||||
void _NewOffscreen(float padding = 0.0F);
|
void _NewOffscreen(float padding = 0.0);
|
||||||
void _DeleteOffscreen();
|
void _DeleteOffscreen();
|
||||||
|
|
||||||
void _Activate();
|
void _Activate();
|
||||||
@@ -293,14 +325,13 @@ class BTextView : public BView {
|
|||||||
int32 _NextInitialByte(int32 offset) const;
|
int32 _NextInitialByte(int32 offset) const;
|
||||||
int32 _PreviousInitialByte(int32 offset) const;
|
int32 _PreviousInitialByte(int32 offset) const;
|
||||||
|
|
||||||
bool _GetProperty(BMessage* specifier, int32 form, const char* property,
|
bool _GetProperty(BMessage* specifier, int32 form,
|
||||||
BMessage* reply);
|
|
||||||
|
|
||||||
bool _SetProperty(BMessage* specifier, int32 form, const char* property,
|
|
||||||
BMessage* reply);
|
|
||||||
|
|
||||||
bool _CountProperties(BMessage* specifier, int32 form,
|
|
||||||
const char* property, BMessage* reply);
|
const char* property, BMessage* reply);
|
||||||
|
bool _SetProperty(BMessage* specifier, int32 form,
|
||||||
|
const char* property, BMessage* reply);
|
||||||
|
bool _CountProperties(BMessage* specifier,
|
||||||
|
int32 form, const char* property,
|
||||||
|
BMessage* reply);
|
||||||
|
|
||||||
void _HandleInputMethodChanged(BMessage* message);
|
void _HandleInputMethodChanged(BMessage* message);
|
||||||
void _HandleInputMethodLocationRequest();
|
void _HandleInputMethodLocationRequest();
|
||||||
@@ -344,6 +375,7 @@ class BTextView : public BView {
|
|||||||
BPoint fWhere;
|
BPoint fWhere;
|
||||||
_BTextTrackState_* fTrackingMouse;
|
_BTextTrackState_* fTrackingMouse;
|
||||||
_BTextChangeResult_* fTextChange;
|
_BTextChangeResult_* fTextChange;
|
||||||
|
|
||||||
uint32 _reserved[8];
|
uint32 _reserved[8];
|
||||||
|
|
||||||
static _BWidthBuffer_* sWidths;
|
static _BWidthBuffer_* sWidths;
|
||||||
|
|||||||
Reference in New Issue
Block a user