mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 15:26:11 +01:00
Merge branch 'develop' of git://github.com/RandomInEqualities/Catch into RandomInEqualities-develop
This commit is contained in:
commit
18acff62d3
@ -60,12 +60,13 @@ namespace {
|
|||||||
{
|
{
|
||||||
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
|
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
|
||||||
GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo );
|
GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo );
|
||||||
originalAttributes = csbiInfo.wAttributes;
|
originalForegroundAttributes = csbiInfo.wAttributes & ~( BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY );
|
||||||
|
originalBackgroundAttributes = csbiInfo.wAttributes & ~( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY );
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void use( Colour::Code _colourCode ) {
|
virtual void use( Colour::Code _colourCode ) {
|
||||||
switch( _colourCode ) {
|
switch( _colourCode ) {
|
||||||
case Colour::None: return setTextAttribute( originalAttributes );
|
case Colour::None: return setTextAttribute( originalForegroundAttributes );
|
||||||
case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
|
case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
|
||||||
case Colour::Red: return setTextAttribute( FOREGROUND_RED );
|
case Colour::Red: return setTextAttribute( FOREGROUND_RED );
|
||||||
case Colour::Green: return setTextAttribute( FOREGROUND_GREEN );
|
case Colour::Green: return setTextAttribute( FOREGROUND_GREEN );
|
||||||
@ -85,10 +86,11 @@ namespace {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void setTextAttribute( WORD _textAttribute ) {
|
void setTextAttribute( WORD _textAttribute ) {
|
||||||
SetConsoleTextAttribute( stdoutHandle, _textAttribute );
|
SetConsoleTextAttribute( stdoutHandle, _textAttribute | originalBackgroundAttributes );
|
||||||
}
|
}
|
||||||
HANDLE stdoutHandle;
|
HANDLE stdoutHandle;
|
||||||
WORD originalAttributes;
|
WORD originalForegroundAttributes;
|
||||||
|
WORD originalBackgroundAttributes;
|
||||||
};
|
};
|
||||||
|
|
||||||
IColourImpl* platformColourInstance() {
|
IColourImpl* platformColourInstance() {
|
||||||
|
Loading…
Reference in New Issue
Block a user