Coding style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39585 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+166
-163
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2010, Haiku.
|
* Copyright 2001-2010, Haiku, Inc.
|
||||||
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
|
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
|
||||||
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
|
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
|
||||||
*
|
*
|
||||||
@@ -42,250 +42,253 @@ public:
|
|||||||
class Listener;
|
class Listener;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TermView(BRect frame,
|
TermView(BRect frame,
|
||||||
const ShellParameters& shellParameters,
|
const ShellParameters& shellParameters,
|
||||||
int32 historySize);
|
int32 historySize);
|
||||||
TermView(int rows, int columns,
|
TermView(int rows, int columns,
|
||||||
const ShellParameters& shellParameters,
|
const ShellParameters& shellParameters,
|
||||||
int32 historySize);
|
int32 historySize);
|
||||||
TermView(BMessage* archive);
|
TermView(BMessage* archive);
|
||||||
~TermView();
|
~TermView();
|
||||||
|
|
||||||
static BArchivable* Instantiate(BMessage* data);
|
static BArchivable* Instantiate(BMessage* data);
|
||||||
virtual status_t Archive(BMessage* data, bool deep = true) const;
|
virtual status_t Archive(BMessage* data, bool deep = true) const;
|
||||||
|
|
||||||
virtual void GetPreferredSize(float* _width, float* _height);
|
virtual void GetPreferredSize(float* _width, float* _height);
|
||||||
|
|
||||||
bool IsShellBusy() const;
|
bool IsShellBusy() const;
|
||||||
bool GetActiveProcessInfo(
|
bool GetActiveProcessInfo(
|
||||||
ActiveProcessInfo& _info) const;
|
ActiveProcessInfo& _info) const;
|
||||||
bool GetShellInfo(ShellInfo& _info) const;
|
bool GetShellInfo(ShellInfo& _info) const;
|
||||||
|
|
||||||
const char* TerminalName() const;
|
const char* TerminalName() const;
|
||||||
|
|
||||||
inline TerminalBuffer* TextBuffer() const { return fTextBuffer; }
|
inline TerminalBuffer* TextBuffer() const { return fTextBuffer; }
|
||||||
|
|
||||||
void GetTermFont(BFont* font) const;
|
void GetTermFont(BFont* font) const;
|
||||||
void SetTermFont(const BFont* font);
|
void SetTermFont(const BFont* font);
|
||||||
|
|
||||||
void GetFontSize(int* width, int* height);
|
void GetFontSize(int* width, int* height);
|
||||||
int Rows() const;
|
int Rows() const;
|
||||||
int Columns() const;
|
int Columns() const;
|
||||||
BRect SetTermSize(int rows, int cols);
|
BRect SetTermSize(int rows, int cols);
|
||||||
void SetTermSize(BRect rect);
|
void SetTermSize(BRect rect);
|
||||||
void GetTermSizeFromRect(const BRect &rect,
|
void GetTermSizeFromRect(const BRect &rect,
|
||||||
int *rows, int *columns);
|
int *rows, int *columns);
|
||||||
|
|
||||||
void SetTextColor(rgb_color fore, rgb_color back);
|
void SetTextColor(rgb_color fore, rgb_color back);
|
||||||
void SetSelectColor(rgb_color fore, rgb_color back);
|
void SetSelectColor(rgb_color fore, rgb_color back);
|
||||||
|
|
||||||
int Encoding() const;
|
int Encoding() const;
|
||||||
void SetEncoding(int encoding);
|
void SetEncoding(int encoding);
|
||||||
|
|
||||||
void SetScrollBar(BScrollBar* scrollBar);
|
void SetScrollBar(BScrollBar* scrollBar);
|
||||||
BScrollBar* ScrollBar() const { return fScrollBar; };
|
BScrollBar* ScrollBar() const { return fScrollBar; };
|
||||||
|
|
||||||
void SetMouseClipboard(BClipboard *);
|
void SetMouseClipboard(BClipboard *);
|
||||||
|
|
||||||
// edit functions
|
// edit functions
|
||||||
void Copy(BClipboard* clipboard);
|
void Copy(BClipboard* clipboard);
|
||||||
void Paste(BClipboard* clipboard);
|
void Paste(BClipboard* clipboard);
|
||||||
void SelectAll();
|
void SelectAll();
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
void GetFrameSize(float* width, float* height);
|
void GetFrameSize(float* width, float* height);
|
||||||
bool Find(const BString& str, bool forwardSearch,
|
bool Find(const BString& str, bool forwardSearch,
|
||||||
bool matchCase, bool matchWord);
|
bool matchCase, bool matchWord);
|
||||||
void GetSelection(BString& string);
|
void GetSelection(BString& string);
|
||||||
|
|
||||||
bool CheckShellGone() const;
|
bool CheckShellGone() const;
|
||||||
|
|
||||||
void InitiateDrag();
|
void InitiateDrag();
|
||||||
|
|
||||||
void DisableResizeView(int32 disableCount = 1);
|
void DisableResizeView(int32 disableCount = 1);
|
||||||
static void AboutRequested();
|
static void AboutRequested();
|
||||||
|
|
||||||
void SetListener(Listener* listener)
|
void SetListener(Listener* listener)
|
||||||
{ fListener = listener; }
|
{ fListener = listener; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
virtual void DetachedFromWindow();
|
virtual void DetachedFromWindow();
|
||||||
virtual void Draw(BRect updateRect);
|
virtual void Draw(BRect updateRect);
|
||||||
virtual void WindowActivated(bool active);
|
virtual void WindowActivated(bool active);
|
||||||
virtual void MakeFocus(bool focusState = true);
|
virtual void MakeFocus(bool focusState = true);
|
||||||
virtual void KeyDown(const char* bytes, int32 numBytes);
|
virtual void KeyDown(const char* bytes, int32 numBytes);
|
||||||
|
|
||||||
virtual void MouseDown(BPoint where);
|
virtual void MouseDown(BPoint where);
|
||||||
virtual void MouseMoved(BPoint where, uint32 transit,
|
virtual void MouseMoved(BPoint where, uint32 transit,
|
||||||
const BMessage* message);
|
const BMessage* message);
|
||||||
virtual void MouseUp(BPoint where);
|
virtual void MouseUp(BPoint where);
|
||||||
|
|
||||||
virtual void FrameResized(float width, float height);
|
virtual void FrameResized(float width, float height);
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
|
|
||||||
virtual void ScrollTo(BPoint where);
|
virtual void ScrollTo(BPoint where);
|
||||||
virtual void TargetedByScrollView(BScrollView *scrollView);
|
virtual void TargetedByScrollView(BScrollView *scrollView);
|
||||||
|
|
||||||
virtual status_t GetSupportedSuites(BMessage* msg);
|
virtual status_t GetSupportedSuites(BMessage* msg);
|
||||||
virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index,
|
virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index,
|
||||||
BMessage* specifier, int32 form,
|
BMessage* specifier, int32 form,
|
||||||
const char* property);
|
const char* property);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class CharClassifier;
|
class CharClassifier;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// point and text offset conversion
|
// point and text offset conversion
|
||||||
inline int32 _LineAt(float y);
|
inline int32 _LineAt(float y);
|
||||||
inline float _LineOffset(int32 index);
|
inline float _LineOffset(int32 index);
|
||||||
inline TermPos _ConvertToTerminal(const BPoint& point);
|
inline TermPos _ConvertToTerminal(const BPoint& point);
|
||||||
inline BPoint _ConvertFromTerminal(const TermPos& pos);
|
inline BPoint _ConvertFromTerminal(const TermPos& pos);
|
||||||
|
|
||||||
inline void _InvalidateTextRect(int32 x1, int32 y1, int32 x2,
|
inline void _InvalidateTextRect(int32 x1, int32 y1,
|
||||||
int32 y2);
|
int32 x2, int32 y2);
|
||||||
|
|
||||||
status_t _InitObject(const ShellParameters& shellParameters);
|
status_t _InitObject(
|
||||||
|
const ShellParameters& shellParameters);
|
||||||
|
|
||||||
status_t _AttachShell(Shell* shell);
|
status_t _AttachShell(Shell* shell);
|
||||||
void _DetachShell();
|
void _DetachShell();
|
||||||
|
|
||||||
void _Activate();
|
void _Activate();
|
||||||
void _Deactivate();
|
void _Deactivate();
|
||||||
|
|
||||||
void _DrawLinePart(int32 x1, int32 y1, uint32 attr,
|
void _DrawLinePart(int32 x1, int32 y1, uint32 attr,
|
||||||
char* buffer, int32 width, bool mouse,
|
char* buffer, int32 width, bool mouse,
|
||||||
bool cursor, BView* inView);
|
bool cursor, BView* inView);
|
||||||
void _DrawCursor();
|
void _DrawCursor();
|
||||||
void _InvalidateTextRange(TermPos start, TermPos end);
|
void _InvalidateTextRange(TermPos start,
|
||||||
|
TermPos end);
|
||||||
|
|
||||||
bool _IsCursorVisible() const;
|
bool _IsCursorVisible() const;
|
||||||
void _BlinkCursor();
|
void _BlinkCursor();
|
||||||
void _ActivateCursor(bool invalidate);
|
void _ActivateCursor(bool invalidate);
|
||||||
|
|
||||||
void _DoPrint(BRect updateRect);
|
void _DoPrint(BRect updateRect);
|
||||||
void _UpdateScrollBarRange();
|
void _UpdateScrollBarRange();
|
||||||
void _SecondaryMouseButtonDropped(BMessage* msg);
|
void _SecondaryMouseButtonDropped(BMessage* msg);
|
||||||
void _DoSecondaryMouseDropAction(BMessage* msg);
|
void _DoSecondaryMouseDropAction(BMessage* msg);
|
||||||
void _DoFileDrop(entry_ref &ref);
|
void _DoFileDrop(entry_ref &ref);
|
||||||
|
|
||||||
void _SynchronizeWithTextBuffer(int32 visibleDirtyTop,
|
void _SynchronizeWithTextBuffer(
|
||||||
int32 visibleDirtyBottom);
|
int32 visibleDirtyTop,
|
||||||
|
int32 visibleDirtyBottom);
|
||||||
|
|
||||||
void _WritePTY(const char* text, int32 numBytes);
|
void _WritePTY(const char* text, int32 numBytes);
|
||||||
|
|
||||||
// selection
|
// selection
|
||||||
float _MouseDistanceSinceLastClick(BPoint where);
|
float _MouseDistanceSinceLastClick(BPoint where);
|
||||||
void _Select(TermPos start, TermPos end, bool inclusive,
|
void _Select(TermPos start, TermPos end,
|
||||||
bool setInitialSelection);
|
bool inclusive, bool setInitialSelection);
|
||||||
void _ExtendSelection(TermPos, bool inclusive,
|
void _ExtendSelection(TermPos, bool inclusive,
|
||||||
bool useInitialSelection);
|
bool useInitialSelection);
|
||||||
void _Deselect();
|
void _Deselect();
|
||||||
bool _HasSelection() const;
|
bool _HasSelection() const;
|
||||||
void _SelectWord(BPoint where, bool extend,
|
void _SelectWord(BPoint where, bool extend,
|
||||||
bool useInitialSelection);
|
bool useInitialSelection);
|
||||||
void _SelectLine(BPoint where, bool extend,
|
void _SelectLine(BPoint where, bool extend,
|
||||||
bool useInitialSelection);
|
bool useInitialSelection);
|
||||||
|
|
||||||
void _AutoScrollUpdate();
|
void _AutoScrollUpdate();
|
||||||
|
|
||||||
bool _CheckSelectedRegion(const TermPos& pos) const;
|
bool _CheckSelectedRegion(const TermPos& pos) const;
|
||||||
bool _CheckSelectedRegion(int32 row, int32 firstColumn,
|
bool _CheckSelectedRegion(int32 row,
|
||||||
int32& lastColumn) const;
|
int32 firstColumn, int32& lastColumn) const;
|
||||||
|
|
||||||
void _UpdateSIGWINCH();
|
void _UpdateSIGWINCH();
|
||||||
|
|
||||||
void _ScrollTo(float y, bool scrollGfx);
|
void _ScrollTo(float y, bool scrollGfx);
|
||||||
void _ScrollToRange(TermPos start, TermPos end);
|
void _ScrollToRange(TermPos start, TermPos end);
|
||||||
|
|
||||||
void _SendMouseEvent(int32 button, int32 mode, int32 x,
|
void _SendMouseEvent(int32 button, int32 mode,
|
||||||
int32 y, bool motion);
|
int32 x, int32 y, bool motion);
|
||||||
|
|
||||||
void _DrawInlineMethodString();
|
void _DrawInlineMethodString();
|
||||||
void _HandleInputMethodChanged(BMessage* message);
|
void _HandleInputMethodChanged(BMessage* message);
|
||||||
void _HandleInputMethodLocationRequest();
|
void _HandleInputMethodLocationRequest();
|
||||||
void _CancelInputMethod();
|
void _CancelInputMethod();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Listener* fListener;
|
Listener* fListener;
|
||||||
Shell* fShell;
|
Shell* fShell;
|
||||||
|
|
||||||
BMessageRunner* fWinchRunner;
|
BMessageRunner* fWinchRunner;
|
||||||
BMessageRunner* fCursorBlinkRunner;
|
BMessageRunner* fCursorBlinkRunner;
|
||||||
BMessageRunner* fAutoScrollRunner;
|
BMessageRunner* fAutoScrollRunner;
|
||||||
BMessageRunner* fResizeRunner;
|
BMessageRunner* fResizeRunner;
|
||||||
BStringView* fResizeView;
|
BStringView* fResizeView;
|
||||||
CharClassifier* fCharClassifier;
|
CharClassifier* fCharClassifier;
|
||||||
|
|
||||||
// Font and Width
|
// Font and Width
|
||||||
BFont fHalfFont;
|
BFont fHalfFont;
|
||||||
int fFontWidth;
|
int fFontWidth;
|
||||||
int fFontHeight;
|
int fFontHeight;
|
||||||
int fFontAscent;
|
int fFontAscent;
|
||||||
struct escapement_delta fEscapement;
|
struct escapement_delta fEscapement;
|
||||||
|
|
||||||
// frame resized flag.
|
// frame resized flag.
|
||||||
bool fFrameResized;
|
bool fFrameResized;
|
||||||
int32 fResizeViewDisableCount;
|
int32 fResizeViewDisableCount;
|
||||||
|
|
||||||
// Cursor Blinking, draw flag.
|
// Cursor Blinking, draw flag.
|
||||||
bigtime_t fLastActivityTime;
|
bigtime_t fLastActivityTime;
|
||||||
int32 fCursorState;
|
int32 fCursorState;
|
||||||
int fCursorHeight;
|
int fCursorHeight;
|
||||||
|
|
||||||
// Cursor position.
|
// Cursor position.
|
||||||
TermPos fCursor;
|
TermPos fCursor;
|
||||||
|
|
||||||
int32 fMouseButtons;
|
int32 fMouseButtons;
|
||||||
|
|
||||||
// Terminal rows and columns.
|
// Terminal rows and columns.
|
||||||
int fColumns;
|
int fColumns;
|
||||||
int fRows;
|
int fRows;
|
||||||
|
|
||||||
int fEncoding;
|
int fEncoding;
|
||||||
bool fActive;
|
bool fActive;
|
||||||
|
|
||||||
// Object pointer.
|
// Object pointer.
|
||||||
TerminalBuffer* fTextBuffer;
|
TerminalBuffer* fTextBuffer;
|
||||||
BasicTerminalBuffer* fVisibleTextBuffer;
|
BasicTerminalBuffer* fVisibleTextBuffer;
|
||||||
BScrollBar* fScrollBar;
|
BScrollBar* fScrollBar;
|
||||||
InlineInput* fInline;
|
InlineInput* fInline;
|
||||||
|
|
||||||
// Color and Attribute.
|
// Color and Attribute.
|
||||||
rgb_color fSelectForeColor;
|
rgb_color fSelectForeColor;
|
||||||
rgb_color fSelectBackColor;
|
rgb_color fSelectBackColor;
|
||||||
|
|
||||||
// Scroll Region
|
// Scroll Region
|
||||||
float fScrollOffset;
|
float fScrollOffset;
|
||||||
int32 fScrBufSize;
|
int32 fScrBufSize;
|
||||||
// TODO: That's the history capacity -- only needed
|
// TODO: That's the history capacity -- only needed
|
||||||
// until the text buffer is created.
|
// until the text buffer is created.
|
||||||
float fAutoScrollSpeed;
|
float fAutoScrollSpeed;
|
||||||
|
|
||||||
// redraw management
|
// redraw management
|
||||||
bigtime_t fLastSyncTime;
|
bigtime_t fLastSyncTime;
|
||||||
int32 fScrolledSinceLastSync;
|
int32 fScrolledSinceLastSync;
|
||||||
BMessageRunner* fSyncRunner;
|
BMessageRunner* fSyncRunner;
|
||||||
bool fConsiderClockedSync;
|
bool fConsiderClockedSync;
|
||||||
|
|
||||||
// selection
|
// selection
|
||||||
TermPos fSelStart;
|
TermPos fSelStart;
|
||||||
TermPos fSelEnd;
|
TermPos fSelEnd;
|
||||||
TermPos fInitialSelectionStart;
|
TermPos fInitialSelectionStart;
|
||||||
TermPos fInitialSelectionEnd;
|
TermPos fInitialSelectionEnd;
|
||||||
bool fMouseTracking;
|
bool fMouseTracking;
|
||||||
bool fCheckMouseTracking;
|
bool fCheckMouseTracking;
|
||||||
int fSelectGranularity;
|
int fSelectGranularity;
|
||||||
BPoint fLastClickPoint;
|
BPoint fLastClickPoint;
|
||||||
|
|
||||||
// mouse
|
// mouse
|
||||||
TermPos fPrevPos;
|
TermPos fPrevPos;
|
||||||
bool fReportX10MouseEvent;
|
bool fReportX10MouseEvent;
|
||||||
bool fReportNormalMouseEvent;
|
bool fReportNormalMouseEvent;
|
||||||
bool fReportButtonMouseEvent;
|
bool fReportButtonMouseEvent;
|
||||||
bool fReportAnyMouseEvent;
|
bool fReportAnyMouseEvent;
|
||||||
BClipboard* fMouseClipboard;
|
BClipboard* fMouseClipboard;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user