diff --git a/src/apps/terminal/BasicTerminalBuffer.cpp b/src/apps/terminal/BasicTerminalBuffer.cpp index 535d0d8a6a..b3783e8224 100644 --- a/src/apps/terminal/BasicTerminalBuffer.cpp +++ b/src/apps/terminal/BasicTerminalBuffer.cpp @@ -267,7 +267,7 @@ BasicTerminalBuffer::IsFullWidthChar(int32 row, int32 column) const int BasicTerminalBuffer::GetChar(int32 row, int32 column, UTF8Char& character, - uint16& attributes) const + uint32& attributes) const { TerminalLine* lineBuffer = ALLOC_LINE_ON_STACK(fWidth); TerminalLine* line = _HistoryLineAt(row, lineBuffer); @@ -289,7 +289,7 @@ BasicTerminalBuffer::GetChar(int32 row, int32 column, UTF8Char& character, int32 BasicTerminalBuffer::GetString(int32 row, int32 firstColumn, int32 lastColumn, - char* buffer, uint16& attributes) const + char* buffer, uint32& attributes) const { TerminalLine* lineBuffer = ALLOC_LINE_ON_STACK(fWidth); TerminalLine* line = _HistoryLineAt(row, lineBuffer); diff --git a/src/apps/terminal/BasicTerminalBuffer.h b/src/apps/terminal/BasicTerminalBuffer.h index 0d9fe205b7..bd46152359 100644 --- a/src/apps/terminal/BasicTerminalBuffer.h +++ b/src/apps/terminal/BasicTerminalBuffer.h @@ -77,10 +77,10 @@ public: bool IsFullWidthChar(int32 row, int32 column) const; int GetChar(int32 row, int32 column, UTF8Char& character, - uint16& attributes) const; + uint32& attributes) const; int32 GetString(int32 row, int32 firstColumn, int32 lastColumn, char* buffer, - uint16& attributes) const; + uint32& attributes) const; void GetStringFromRegion(BString& string, const TermPos& start, const TermPos& end) const; diff --git a/src/apps/terminal/TermConst.h b/src/apps/terminal/TermConst.h index 59fa35120c..0163676a7a 100644 --- a/src/apps/terminal/TermConst.h +++ b/src/apps/terminal/TermConst.h @@ -183,9 +183,9 @@ enum{ #define FONT 0x0100 #define RESERVE 0x0080 #define DUMPCR 0x0040 -#define FORECOLOR 0x0038 -#define BACKCOLOR 0x0007 -#define CHAR_ATTRIBUTES 0x773f +#define FORECOLOR 0xFF0000 +#define BACKCOLOR 0xFF000000 +#define CHAR_ATTRIBUTES 0xFFFF7700 #define IS_WIDTH(x) (((x) & A_WIDTH) ) #define IS_BOLD(x) (((x) & BOLD) ) @@ -196,11 +196,11 @@ enum{ #define IS_BACKSET(x) (((x) & BACKSET) ) #define IS_FONT(x) (((x) & FONT) ) #define IS_CR(x) (((x) & DUMPCR) ) -#define IS_FORECOLOR(x) (((x) & FORECOLOR) >> 3) -#define IS_BACKCOLOR(x) (((x) & BACKCOLOR) ) +#define IS_FORECOLOR(x) (((x) & FORECOLOR) >> 16) +#define IS_BACKCOLOR(x) (((x) & BACKCOLOR) >> 24) -#define FORECOLORED(x) ((x) << 3) -#define BACKCOLORED(x) ((x) << 0) +#define FORECOLORED(x) ((x) << 16) +#define BACKCOLORED(x) ((x) << 24) #endif // TERMCONST_H_INCLUDED diff --git a/src/apps/terminal/TermParse.h b/src/apps/terminal/TermParse.h index 2f493ec423..6ba39bd845 100644 --- a/src/apps/terminal/TermParse.h +++ b/src/apps/terminal/TermParse.h @@ -84,8 +84,8 @@ private: int fFd; - ushort fAttr; - ushort fSavedAttr; + uint32 fAttr; + uint32 fSavedAttr; thread_id fParseThread; thread_id fReaderThread; diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index 7afe6706b5..e85af27b34 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -849,7 +849,7 @@ TermView::_Deactivate() //! Draw part of a line in the given view. void -TermView::_DrawLinePart(int32 x1, int32 y1, uint16 attr, char *buf, +TermView::_DrawLinePart(int32 x1, int32 y1, uint32 attr, char *buf, int32 width, bool mouse, bool cursor, BView *inView) { rgb_color rgb_fore = fTextForeColor, rgb_back = fTextBackColor; @@ -926,7 +926,7 @@ TermView::_DrawCursor() int32 firstVisible = _LineAt(0); UTF8Char character; - uint16 attr; + uint32 attr; bool cursorVisible = _IsCursorVisible(); @@ -1156,7 +1156,7 @@ TermView::Draw(BRect updateRect) for (int32 i = k; i <= x2;) { int32 lastColumn = x2; bool insideSelection = _CheckSelectedRegion(j, i, lastColumn); - uint16 attr; + uint32 attr; int32 count = fVisibleTextBuffer->GetString(j - firstVisible, i, lastColumn, buf, attr); @@ -1198,7 +1198,7 @@ void TermView::_DoPrint(BRect updateRect) { #if 0 - ushort attr; + uint32 attr; uchar buf[1024]; const int numLines = (int)((updateRect.Height()) / fFontHeight); diff --git a/src/apps/terminal/TermView.h b/src/apps/terminal/TermView.h index f394ede819..daf0b487da 100644 --- a/src/apps/terminal/TermView.h +++ b/src/apps/terminal/TermView.h @@ -139,7 +139,7 @@ private: void _Activate(); void _Deactivate(); - void _DrawLinePart(int32 x1, int32 y1, uint16 attr, + void _DrawLinePart(int32 x1, int32 y1, uint32 attr, char* buffer, int32 width, bool mouse, bool cursor, BView* inView); void _DrawCursor(); diff --git a/src/apps/terminal/TerminalLine.h b/src/apps/terminal/TerminalLine.h index 195069ec0c..a2b337b671 100644 --- a/src/apps/terminal/TerminalLine.h +++ b/src/apps/terminal/TerminalLine.h @@ -12,7 +12,7 @@ struct TerminalCell { UTF8Char character; - uint16 attributes; + uint32 attributes; };