Author: pulkomandy Date: 2010-08-13 17:53:34 +0200 (Fri, 13 Aug 2010) New Revision: 38089 Changeset: http://dev.haiku-os.org/changeset/38089 Modified: haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp haiku/trunk/src/apps/terminal/BasicTerminalBuffer.h haiku/trunk/src/apps/terminal/TermConst.h haiku/trunk/src/apps/terminal/TermParse.h haiku/trunk/src/apps/terminal/TermView.cpp haiku/trunk/src/apps/terminal/TermView.h haiku/trunk/src/apps/terminal/TerminalLine.h Log: Enlarge attributes to 32 bit instead of 16. This prepares 256-color support for terminal. Modified: haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp =================================================================== --- haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp 2010-08-13 15:19:36 UTC (rev 38088) +++ haiku/trunk/src/apps/terminal/BasicTerminalBuffer.cpp 2010-08-13 15:53:34 UTC (rev 38089) @@ -267,7 +267,7 @@ 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 @@ 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); Modified: haiku/trunk/src/apps/terminal/BasicTerminalBuffer.h =================================================================== --- haiku/trunk/src/apps/terminal/BasicTerminalBuffer.h 2010-08-13 15:19:36 UTC (rev 38088) +++ haiku/trunk/src/apps/terminal/BasicTerminalBuffer.h 2010-08-13 15:53:34 UTC (rev 38089) @@ -77,10 +77,10 @@ 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; Modified: haiku/trunk/src/apps/terminal/TermConst.h =================================================================== --- haiku/trunk/src/apps/terminal/TermConst.h 2010-08-13 15:19:36 UTC (rev 38088) +++ haiku/trunk/src/apps/terminal/TermConst.h 2010-08-13 15:53:34 UTC (rev 38089) @@ -183,9 +183,9 @@ #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 @@ #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 Modified: haiku/trunk/src/apps/terminal/TermParse.h =================================================================== --- haiku/trunk/src/apps/terminal/TermParse.h 2010-08-13 15:19:36 UTC (rev 38088) +++ haiku/trunk/src/apps/terminal/TermParse.h 2010-08-13 15:53:34 UTC (rev 38089) @@ -84,8 +84,8 @@ int fFd; - ushort fAttr; - ushort fSavedAttr; + uint32 fAttr; + uint32 fSavedAttr; thread_id fParseThread; thread_id fReaderThread; Modified: haiku/trunk/src/apps/terminal/TermView.cpp =================================================================== --- haiku/trunk/src/apps/terminal/TermView.cpp 2010-08-13 15:19:36 UTC (rev 38088) +++ haiku/trunk/src/apps/terminal/TermView.cpp 2010-08-13 15:53:34 UTC (rev 38089) @@ -849,7 +849,7 @@ //! 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 @@ int32 firstVisible = _LineAt(0); UTF8Char character; - uint16 attr; + uint32 attr; bool cursorVisible = _IsCursorVisible(); @@ -1156,7 +1156,7 @@ 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 @@ TermView::_DoPrint(BRect updateRect) { #if 0 - ushort attr; + uint32 attr; uchar buf[1024]; const int numLines = (int)((updateRect.Height()) / fFontHeight); Modified: haiku/trunk/src/apps/terminal/TermView.h =================================================================== --- haiku/trunk/src/apps/terminal/TermView.h 2010-08-13 15:19:36 UTC (rev 38088) +++ haiku/trunk/src/apps/terminal/TermView.h 2010-08-13 15:53:34 UTC (rev 38089) @@ -139,7 +139,7 @@ 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(); Modified: haiku/trunk/src/apps/terminal/TerminalLine.h =================================================================== --- haiku/trunk/src/apps/terminal/TerminalLine.h 2010-08-13 15:19:36 UTC (rev 38088) +++ haiku/trunk/src/apps/terminal/TerminalLine.h 2010-08-13 15:53:34 UTC (rev 38089) @@ -12,7 +12,7 @@ struct TerminalCell { UTF8Char character; - uint16 attributes; + uint32 attributes; };