From 75b54d3cc7b087cd6bf910621810db9cb30298dc Mon Sep 17 00:00:00 2001 From: DarwinNE Date: Sun, 12 Jan 2020 22:13:01 +0100 Subject: [PATCH] Add additional permissions in the license. --- Console/retro/Console.cc | 40 +++++++++++++++++++--------------- Console/retro/Console.h | 22 +++++++++++-------- Console/retro/ConsoleWindow.cc | 10 ++++++--- Console/retro/ConsoleWindow.h | 4 ++++ Console/retro/InitConsole.cc | 28 ++++++++++++++---------- Console/retro/MacUtils.h | 4 ++++ 6 files changed, 66 insertions(+), 42 deletions(-) diff --git a/Console/retro/Console.cc b/Console/retro/Console.cc index 47681da9eb..5e5b997062 100644 --- a/Console/retro/Console.cc +++ b/Console/retro/Console.cc @@ -13,6 +13,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + You should have received a copy of the GNU General Public License along with Retro68. If not, see . */ @@ -71,7 +75,7 @@ void Attributes::setUnderline(const bool v) } inline bool operator==(const Attributes& lhs, const Attributes& rhs) -{ +{ return lhs.isBold()==rhs.isBold() && lhs.isUnderline()==rhs.isUnderline() && lhs.isItalic()==rhs.isItalic(); } @@ -81,7 +85,7 @@ inline bool operator!=(const Attributes& lhs, const Attributes& rhs) } inline bool operator==(const AttributedChar& lhs, const AttributedChar& rhs) -{ +{ return lhs.c==rhs.c && lhs.attrs==rhs.attrs; } @@ -141,15 +145,15 @@ void Console::Init(GrafPtr port, Rect r) { consolePort = port; bounds = r; - + PortSetter setport(consolePort); FontSetup fontSetup; InsetRect(&bounds, 2,2); - + cellSizeY = 12; cellSizeX = CharWidth('M'); - + rows = (bounds.bottom - bounds.top) / cellSizeY; cols = (bounds.right - bounds.left) / cellSizeX; @@ -202,7 +206,7 @@ void Console::DrawCells(short x1, short x2, short y, bool erase) cursorDrawn = false; } } - + if(erase) EraseRect(&r); MoveTo(r.left, r.bottom - 2); @@ -230,11 +234,11 @@ void Console::Draw(Rect r) short minRow = std::max(0, (r.top - bounds.top) / cellSizeY); short maxRow = std::min((int)rows, (r.bottom - bounds.top + cellSizeY - 1) / cellSizeY); - + short minCol = 0;// std::max(0, (r.left - bounds.left) / cellSizeX); - + short maxCol = cols; //;std::min((int)cols, (r.right - bounds.left + cellSizeX - 1) / cellSizeX); - + EraseRect(&r); for(short row = minRow; row < maxRow; ++row) { @@ -385,7 +389,7 @@ void Console::Update() DrawCells(start, dirtyRect.right, row, needclear); } dirtyRect = Rect(); - + if(cursorVisible != cursorDrawn) { Rect r = CellRect(cursorX, cursorY); @@ -395,7 +399,7 @@ void Console::Update() InvertRect(&r); cursorDrawn = !cursorDrawn; } - + #if TARGET_API_MAC_CARBON QDFlushPortBuffer(consolePort,NULL); #endif @@ -413,7 +417,7 @@ void Console::write(const char *p, int n) { if(!rows) return; - + for(int i = 0; i < n; i++) Console::currentInstance->PutCharNoUpdate(*p++); Update(); @@ -427,9 +431,9 @@ std::string Console::ReadLine() std::string buffer; char c; - + do - { + { c = WaitNextChar(); if(!c) { @@ -439,7 +443,7 @@ std::string Console::ReadLine() if(c == '\r') c = '\n'; - + if(c == '\b') { if(buffer.size()) @@ -455,7 +459,7 @@ std::string Console::ReadLine() continue; } - + putch(c); buffer.append(1,c); } while(c != '\n'); @@ -498,7 +502,7 @@ void Console::Reshape(Rect newBounds) if(cursorY >= newRows) { upshift = cursorY - (newRows - 1); - + InvalidateCursor(); cursorY = newRows - 1; } @@ -520,7 +524,7 @@ void Console::Reshape(Rect newBounds) } onscreen.swap(newChars);*/ onscreen = newChars; - + rows = newRows; cols = newCols; diff --git a/Console/retro/Console.h b/Console/retro/Console.h index e1d998eafd..cc5df88403 100644 --- a/Console/retro/Console.h +++ b/Console/retro/Console.h @@ -13,6 +13,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + You should have received a copy of the GNU General Public License along with Retro68. If not, see . */ @@ -32,21 +36,21 @@ namespace retro bool isBold(void) const; bool isUnderline(void) const; bool isItalic(void) const; - + void setBold(const bool v); void setUnderline(const bool v); void setItalic(const bool v); - + Attributes(void); void reset(void); private: - + bool cBold; bool cUnderline; bool cItalic; }; - + class AttributedChar { public: @@ -78,7 +82,7 @@ namespace retro short GetRows() const { return rows; } short GetCols() const { return cols; } - + void Idle(); bool IsEOF() const { return eof; } @@ -99,7 +103,7 @@ namespace retro short cursorX, cursorY; Rect dirtyRect = {}; - + long blinkTicks = 0; bool cursorDrawn = false; bool cursorVisible = true; @@ -115,14 +119,14 @@ namespace retro void ScrollUp(short n = 1); void ProcessEscSequence(char c); void SetAttributes(Attributes aa); - + void InvalidateCursor(); virtual char WaitNextChar(); - + protected: void Init(GrafPtr port, Rect r); - + }; diff --git a/Console/retro/ConsoleWindow.cc b/Console/retro/ConsoleWindow.cc index 9b5c9ae5cf..880fe63499 100644 --- a/Console/retro/ConsoleWindow.cc +++ b/Console/retro/ConsoleWindow.cc @@ -13,6 +13,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + You should have received a copy of the GNU General Public License along with Retro68. If not, see . */ @@ -69,7 +73,7 @@ char ConsoleWindow::WaitNextChar() #else Rect *boundsPtr = &qd.screenBits.bounds; #endif - + do { #if TARGET_API_MAC_CARBON @@ -82,7 +86,7 @@ char ConsoleWindow::WaitNextChar() SystemTask(); Idle(); } - + switch(event.what) { case updateEvt: @@ -126,6 +130,6 @@ char ConsoleWindow::WaitNextChar() break; } } while(event.what != keyDown && event.what != autoKey); - + return event.message & charCodeMask; } diff --git a/Console/retro/ConsoleWindow.h b/Console/retro/ConsoleWindow.h index 9e149b4cc9..e3d71c33bd 100644 --- a/Console/retro/ConsoleWindow.h +++ b/Console/retro/ConsoleWindow.h @@ -13,6 +13,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + You should have received a copy of the GNU General Public License along with Retro68. If not, see . */ diff --git a/Console/retro/InitConsole.cc b/Console/retro/InitConsole.cc index b67d084f64..78f6f89847 100644 --- a/Console/retro/InitConsole.cc +++ b/Console/retro/InitConsole.cc @@ -1,20 +1,24 @@ /* - Copyright 2014 Wolfgang Thaller. + Copyright 2014 Wolfgang Thaller. - This file is part of Retro68. + This file is part of Retro68. - Retro68 is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + Retro68 is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - Retro68 is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Retro68 is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with Retro68. If not, see . + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License + along with Retro68. If not, see . */ #include diff --git a/Console/retro/MacUtils.h b/Console/retro/MacUtils.h index 4bff8f907c..7b4aaa0773 100644 --- a/Console/retro/MacUtils.h +++ b/Console/retro/MacUtils.h @@ -13,6 +13,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + You should have received a copy of the GNU General Public License along with Retro68. If not, see . */