diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-07 10:46:23 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-07 10:46:23 +0200 |
| commit | 425f9d41cd337133d5677744eef937a8a2a61212 (patch) | |
| tree | 6cd5c2603e1499b89aae4fe5e56c6e650cb2117e /src/geminirenderer.hpp | |
| parent | ec95bb371e54116a2627c162eac3357ec13f06ad (diff) | |
| download | kristall-425f9d41cd337133d5677744eef937a8a2a61212.tar.gz | |
Adds support for light/dark widget theme, adds experiemental support for http style sheets.
Diffstat (limited to 'src/geminirenderer.hpp')
| -rw-r--r-- | src/geminirenderer.hpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/geminirenderer.hpp b/src/geminirenderer.hpp index 2ec1651..c93fd4e 100644 --- a/src/geminirenderer.hpp +++ b/src/geminirenderer.hpp @@ -47,6 +47,10 @@ struct GeminiStyle //! Create a new style with auto-generated colors for the given //! url. The colors are based on the host name GeminiStyle derive(QUrl const & url) const; + + //! Converts this style into a CSS document for + //! non-gemini rendered files. + QString toStyleSheet() const; }; class GeminiDocument : @@ -60,15 +64,19 @@ public: QColor background_color; }; -class GeminiRenderer +struct GeminiRenderer { - GeminiStyle style; -public: - GeminiRenderer(GeminiStyle const & style = GeminiStyle{}); - - std::unique_ptr<GeminiDocument> render( + GeminiRenderer() = delete; + + //! Renders the given byte sequence into a GeminiDocument. + //! @param input The utf8 encoded input string + //! @param root_url The url that is used to resolve relative links + //! @param style The style which is used to render the document + //! @param outline The extracted outline from the document + static std::unique_ptr<GeminiDocument> render( QByteArray const & input, QUrl const & root_url, + GeminiStyle const & style, DocumentOutlineModel & outline ); }; |
