1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[htmlcxx] htmlcxx retired

This commit is contained in:
Witold Filipczyk 2021-06-12 13:29:05 +02:00
parent efd495d927
commit 908fa22878
13 changed files with 3 additions and 148 deletions

View File

@ -135,7 +135,6 @@ CONFIG_GNUTLS_OPENSSL_COMPAT = @CONFIG_GNUTLS_OPENSSL_COMPAT@
CONFIG_GOPHER = @CONFIG_GOPHER@
CONFIG_GPM = @CONFIG_GPM@
CONFIG_GZIP = @CONFIG_GZIP@
CONFIG_HTMLCXX = @CONFIG_HTMLCXX@
CONFIG_HTML_HIGHLIGHT = @CONFIG_HTML_HIGHLIGHT@
CONFIG_IDN = @CONFIG_IDN@
CONFIG_INTERLINK = @CONFIG_INTERLINK@

View File

@ -643,7 +643,6 @@ AC_ARG_WITH([spidermonkey],
# when we know for sure whether we're going to use SpiderMonkey or not.
# (features.conf is not supposed to define it.)
CONFIG_SPIDERMONKEY=
CONFIG_HTMLCXX=
EL_SAVE_FLAGS
case "$with_spidermonkey" in
@ -668,14 +667,9 @@ for package in mozjs-52; do
AC_MSG_CHECKING([for SpiderMonkey (mozjs-52) in pkg-config $package])
if $PKG_CONFIG $pkg_config_static --cflags --libs $package > /dev/null 2>&AS_MESSAGE_LOG_FD; then
DB_LOCALSTORAGE_LIBS="$($PKG_CONFIG $pkg_config_static --libs sqlite3)"
HTMLCXX_LIBS="$($PKG_CONFIG $pkg_config_static --libs htmlcxx)"
if test -n "$HTMLCXX_LIBS"; then
CONFIG_HTMLCXX=yes
fi
SPIDERMONKEY_LIBS="$($PKG_CONFIG $pkg_config_static --libs $package) $DB_LOCALSTORAGE_LIBS $HTMLCXX_LIBS"
SPIDERMONKEY_LIBS="$($PKG_CONFIG $pkg_config_static --libs $package) $DB_LOCALSTORAGE_LIBS"
DB_LOCALSTORAGE_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags sqlite3)"
HTMLCXX_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags htmlcxx)"
SPIDERMONKEY_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags $package) $DB_LOCALSTORAGE_CFLAGS $HTMLCXX_CFLAGS"
SPIDERMONKEY_CFLAGS="$($PKG_CONFIG $pkg_config_static --cflags $package) $DB_LOCALSTORAGE_CFLAGS"
LIBS="$SPIDERMONKEY_LIBS $LIBS_X"
CFLAGS="$CFLAGS_X $SPIDERMONKEY_CFLAGS"
CPPFLAGS="$CPPFLAGS_X $SPIDERMONKEY_CFLAGS"
@ -703,7 +697,6 @@ done
if test -z "$CONFIG_SPIDERMONKEY"; then
# Didn't find SpiderMonkey anywhere.
CONFIG_SPIDERMONKEY=no
CONFIG_HTMLCXX=no
fi
EL_RESTORE_FLAGS
@ -716,7 +709,6 @@ fi
EL_CONFIG_DEPENDS(CONFIG_ECMASCRIPT, [CONFIG_ECMASCRIPT_SMJS], [ECMAScript (JavaScript)])
AC_SUBST(CONFIG_ECMASCRIPT_SMJS)
EL_CONFIG(CONFIG_HTMLCXX, [HTMLcxx])
if test "x$CONFIG_ECMASCRIPT_SMJS" = xyes &&
test "x$HAVE_JS_TRIGGEROPERATIONCALLBACK" = xyes &&

View File

@ -87,7 +87,6 @@ conf_data.set('CONFIG_LIBEV', get_option('libev'))
conf_data.set('CONFIG_LIBEVENT', get_option('libevent'))
conf_data.set('CONFIG_X', get_option('x'))
conf_data.set('CONFIG_LIBDOM', get_option('libdom'))
conf_data.set('CONFIG_HTMLCXX', get_option('htmlcxx'))
conf_data.set('CONFIG_XML', get_option('xml'))
#CONFIG_BOOKMARKS=true
@ -158,7 +157,7 @@ conf_data.set10('HAVE_SYS_TIME_H', 1)
compiler = meson.get_compiler('c')
if conf_data.get('CONFIG_ECMASCRIPT') or conf_data.get('CONFIG_HTMLCXX')
if conf_data.get('CONFIG_ECMASCRIPT')
extracflags = ['-xc++', '-fpermissive']
else
extracflags = []
@ -297,11 +296,6 @@ if conf_data.get('CONFIG_LIBDOM')
deps += domdeps
endif
if conf_data.get('CONFIG_HTMLCXX')
htmlcxxdeps = dependency('htmlcxx')
deps += htmlcxxdeps
endif
if conf_data.get('CONFIG_XML')
xml2deps = dependency('libxml2')
deps += xml2deps

View File

@ -61,5 +61,4 @@ option('libev', type: 'boolean', value: false, description: 'compile with libev
option('libevent', type: 'boolean', value: false, description: 'compile with libevent. Note that libev has precedence')
option('x', type: 'boolean', value: false, description: 'use the X Window System')
option('libdom', type: 'boolean', value: false, description: 'libdom')
option('htmlcxx', type: 'boolean', value: false, description: 'htmlcxx')
option('xml', type: 'boolean', value: false, description: 'libxml++')

View File

@ -3,7 +3,6 @@ include $(top_builddir)/Makefile.config
SUBDIRS-$(CONFIG_CSS) += css
SUBDIRS-$(CONFIG_DOM) += dom
SUBDIRS-$(CONFIG_HTMLCXX) += htmlcxx
SUBDIRS-$(CONFIG_LIBDOM) += libdom
SUBDIRS = html plain

View File

@ -1,8 +0,0 @@
top_builddir=../../..
include $(top_builddir)/Makefile.config
INCLUDES += $(HTMLCXX_CFLAGS)
OBJS = renderer.o
include $(top_srcdir)/Makefile.lib

View File

@ -1 +0,0 @@
srcs += files('renderer.c')

View File

@ -1,86 +0,0 @@
/* Plain text document renderer */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "bookmarks/bookmarks.h"
#include "cache/cache.h"
#include "config/options.h"
#include "document/docdata.h"
#include "document/document.h"
#include "document/format.h"
#include "document/options.h"
#include "document/htmlcxx/renderer.h"
#include "document/plain/renderer.h"
#include "document/renderer.h"
#include "globhist/globhist.h"
#include "intl/charsets.h"
#include "protocol/protocol.h"
#include "protocol/uri.h"
#include "terminal/color.h"
#include "terminal/draw.h"
#include "util/color.h"
#include "util/error.h"
#include "util/memory.h"
#include "util/string.h"
#include <htmlcxx/html/ParserDom.h>
using namespace htmlcxx;
struct source_renderer {
struct string tmp_buffer;
struct string *source;
char *enc;
};
static void
walk_tree(struct string *buf, tree<HTML::Node> const &dom)
{
tree<HTML::Node>::iterator it = dom.begin();
add_to_string(buf, it->text().c_str());
for (tree<HTML::Node>::sibling_iterator childIt = dom.begin(it); childIt != dom.end(it); ++childIt)
{
walk_tree(buf, childIt);
}
add_to_string(buf, it->closingText().c_str());
}
static int
htmlcxx_main(struct source_renderer *renderer)
{
std::string html = renderer->source->source;
HTML::ParserDom parser;
tree<HTML::Node> dom = parser.parseTree(html);
walk_tree(&renderer->tmp_buffer, dom);
return 0;
}
void
render_source_document_cxx(struct cache_entry *cached, struct document *document,
struct string *buffer)
{
struct source_renderer renderer;
char *head = empty_string_or_(cached->head);
(void)get_convert_table(head, document->options.cp,
document->options.assume_cp,
&document->cp,
&document->cp_status,
document->options.hard_assume);
init_string(&renderer.tmp_buffer);
renderer.source = buffer;
renderer.enc = get_cp_mime_name(document->cp);
htmlcxx_main(&renderer);
render_plain_document(cached, document, &renderer.tmp_buffer);
done_string(&renderer.tmp_buffer);
}

View File

@ -1,18 +0,0 @@
#ifndef EL__DOCUMENT_HTMLCXX_RENDERER_H
#define EL__DOCUMENT_HTMLCXX_RENDERER_H
#ifdef __cplusplus
extern "C" {
#endif
struct cache_entry;
struct document;
struct string;
void render_source_document_cxx(struct cache_entry *cached, struct document *document, struct string *buffer);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -7,9 +7,6 @@ endif
if conf_data.get('CONFIG_LIBDOM')
subdir('libdom')
endif
if conf_data.get('CONFIG_HTMLCXX')
subdir('htmlcxx')
endif
subdir('html')
subdir('plain')
srcs += files('docdata.c', 'document.c', 'format.c', 'forms.c', 'options.c', 'refresh.c', 'renderer.c')

View File

@ -18,7 +18,6 @@
#include "document/dom/renderer.h"
#include "document/html/frames.h"
#include "document/html/renderer.h"
#include "document/htmlcxx/renderer.h"
#include "document/libdom/renderer.h"
#include "document/plain/renderer.h"
#include "document/renderer.h"
@ -257,14 +256,6 @@ render_encoded_document(struct cache_entry *cached, struct document *document)
render_source_document(cached, document, &buffer);
}
else
#endif
#ifdef CONFIG_HTMLCXX
if (document->options.plain && cached->content_type
&& (!c_strcasecmp("text/html", cached->content_type)
|| !c_strcasecmp("application/xhtml+xml", cached->content_type))) {
render_source_document_cxx(cached, document, &buffer);
}
else
#endif
if (document->options.plain) {
#ifdef CONFIG_DOM

View File

@ -12,7 +12,6 @@
#include "ecmascript/spidermonkey/util.h"
#include <jsfriendapi.h>
#include <htmlcxx/html/ParserDom.h>
#include "bfu/dialog.h"
#include "cache/cache.h"

View File

@ -3,8 +3,6 @@
#define EL__ECMASCRIPT_SPIDERMONKEY_ELEMENT_H
#include "ecmascript/spidermonkey/util.h"
#include <htmlcxx/html/ParserDom.h>
using namespace htmlcxx;
extern JSClass element_class;
extern JSPropertySpec element_props[];