Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client|Widgets: Working on LogWidget
This is incomplete work presently, however the basic building blocks are in place: log entries are received via a sink, they are wrapped to multiple lines, and are then composed for GL drawing using GLTextComposer. The entries near the visible range are kept ready for rendering on a separate atlas. Todo: Fix eventual corruption / overdraw / atlas misbehavior Todo: Text styling (handle styling escape symbols in Font) Todo: Performance -- too many calls to measure text's visible widths Todo: Cleanup of LogWidget implementation
- Loading branch information
Showing
10 changed files
with
445 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
doomsday/client/include/ui/widgets/styledlogsinkformatter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** @file styledlogsinkformatter.h | ||
* | ||
* @authors Copyright (c) 2013 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
* | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* <small>This program 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 2 of the License, or (at your | ||
* option) any later version. This program 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 this program; if not, see: | ||
* http://www.gnu.org/licenses</small> | ||
*/ | ||
|
||
#ifndef STYLEDLOGSINKFORMATTER_H | ||
#define STYLEDLOGSINKFORMATTER_H | ||
|
||
#include <de/LogSink> | ||
#include <de/String> | ||
|
||
/** | ||
* Formats log entries for styled output. | ||
*/ | ||
class StyledLogSinkFormatter : public de::LogSink::IFormatter | ||
{ | ||
public: | ||
Lines logEntryToTextLines(de::LogEntry const &entry) | ||
{ | ||
// This will form a single long line. The line wrapper will | ||
// then determine how to wrap it onto the available width. | ||
return Lines() << entry.asText(de::LogEntry::Styled); | ||
} | ||
}; | ||
|
||
#endif // STYLEDLOGSINKFORMATTER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.