Added rendering of html string
This commit is contained in:
parent
a3f0c1ca14
commit
eb433d8d66
@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Haiku Inc.
|
||||||
|
* All rights reserved. Distributed under the terms of the BSD 3-clause license.
|
||||||
|
* Constributors
|
||||||
|
* 2019-2020 Adam Fowler <adamfowleruk@gmail.com>
|
||||||
|
*/
|
||||||
#include "container_haiku.h"
|
#include "container_haiku.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -67,9 +73,17 @@ LiteHtmlView::RenderFile(const char* localFilePath)
|
|||||||
set_base_url(dirPath.Path());
|
set_base_url(dirPath.Path());
|
||||||
//std::cout << " base url now:" << m_base_url << std::endl;
|
//std::cout << " base url now:" << m_base_url << std::endl;
|
||||||
|
|
||||||
|
RenderHTML(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LiteHtmlView::RenderHTML(const std::string& htmlText)
|
||||||
|
{
|
||||||
|
std::cout << "RenderHTML" << std::endl;
|
||||||
|
|
||||||
// now use this string
|
// now use this string
|
||||||
m_html = litehtml::document::createFromString(
|
m_html = litehtml::document::createFromString(
|
||||||
html.c_str(), this, fContext);
|
htmlText.c_str(), this, fContext);
|
||||||
if (m_html)
|
if (m_html)
|
||||||
{
|
{
|
||||||
std::cout << "Successfully read html" << std::endl;
|
std::cout << "Successfully read html" << std::endl;
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Haiku Inc.
|
||||||
|
* All rights reserved. Distributed under the terms of the BSD 3-clause license.
|
||||||
|
* Constributors
|
||||||
|
* 2019-2020 Adam Fowler <adamfowleruk@gmail.com>
|
||||||
|
*/
|
||||||
#ifndef LITEHTMLVIEW_H
|
#ifndef LITEHTMLVIEW_H
|
||||||
#define LITEHTMLVIEW_H
|
#define LITEHTMLVIEW_H
|
||||||
|
|
||||||
@ -26,6 +32,7 @@ public:
|
|||||||
|
|
||||||
void SetContext(litehtml::context* ctx);
|
void SetContext(litehtml::context* ctx);
|
||||||
void RenderFile(const char* localFilePath);
|
void RenderFile(const char* localFilePath);
|
||||||
|
void RenderHTML(const std::string& htmlText);
|
||||||
|
|
||||||
|
|
||||||
virtual litehtml::uint_ptr create_font(const litehtml::tchar_t* faceName, int size, int weight, litehtml::font_style italic, unsigned int decoration, litehtml::font_metrics* fm) override;
|
virtual litehtml::uint_ptr create_font(const litehtml::tchar_t* faceName, int size, int weight, litehtml::font_style italic, unsigned int decoration, litehtml::font_metrics* fm) override;
|
||||||
|
Loading…
Reference in New Issue
Block a user