Rename kiobuffer and KHTML

pull/1/head
Timothy Pearson 12 years ago
parent f67880312d
commit fdae4846a8

@ -2066,7 +2066,7 @@ if test $kde_qtver = 3; then
AC_SUBST(LIB_SMB, "-lsmb") AC_SUBST(LIB_SMB, "-lsmb")
AC_SUBST(LIB_KAB, "-lkab") AC_SUBST(LIB_KAB, "-lkab")
AC_SUBST(LIB_KABC, "-lkabc") AC_SUBST(LIB_KABC, "-lkabc")
AC_SUBST(LIB_KHTML, "-ltdehtml") AC_SUBST(LIB_TDEHTML, "-ltdehtml")
AC_SUBST(LIB_KSPELL, "-ltdespell") AC_SUBST(LIB_KSPELL, "-ltdespell")
AC_SUBST(LIB_KPARTS, "-ltdeparts") AC_SUBST(LIB_KPARTS, "-ltdeparts")
AC_SUBST(LIB_TDEPRINT, "-ltdeprint") AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
@ -2087,7 +2087,7 @@ elif test $kde_qtver = 2; then
AC_SUBST(LIB_SMB, "-lsmb") AC_SUBST(LIB_SMB, "-lsmb")
AC_SUBST(LIB_KFILE, "-ltdefile") AC_SUBST(LIB_KFILE, "-ltdefile")
AC_SUBST(LIB_KAB, "-lkab") AC_SUBST(LIB_KAB, "-lkab")
AC_SUBST(LIB_KHTML, "-ltdehtml") AC_SUBST(LIB_TDEHTML, "-ltdehtml")
AC_SUBST(LIB_KSPELL, "-ltdespell") AC_SUBST(LIB_KSPELL, "-ltdespell")
AC_SUBST(LIB_KPARTS, "-ltdeparts") AC_SUBST(LIB_KPARTS, "-ltdeparts")
AC_SUBST(LIB_TDEPRINT, "-ltdeprint") AC_SUBST(LIB_TDEPRINT, "-ltdeprint")

@ -428,7 +428,7 @@ TQString HtmlCssWorker::layoutToCss(const LayoutData& layoutOrigin,
} }
} }
// TODO: Konqueror/KHTML does not support "text-shadow" // TODO: Konqueror/TDEHTML does not support "text-shadow"
if (!force if (!force
&& ( layoutOrigin.shadowDirection == layout.shadowDirection ) && ( layoutOrigin.shadowDirection == layout.shadowDirection )
&& ( layoutOrigin.shadowDistance == layout.shadowDistance ) ) && ( layoutOrigin.shadowDistance == layout.shadowDistance ) )

@ -4,7 +4,7 @@ INCLUDES = -I$(srcdir) $(KOFFICE_INCLUDES) $(KOTEXT_INCLUDES) $(all_includes)
libhtmlimport_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined libhtmlimport_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
libhtmlimport_la_LIBADD = $(LIB_KHTML) $(KOFFICE_LIBS) $(LIB_KOTEXT) libhtmlimport_la_LIBADD = $(LIB_TDEHTML) $(KOFFICE_LIBS) $(LIB_KOTEXT)
####### Files ####### Files

@ -46,7 +46,7 @@ KoFilter::ConversionStatus HTMLImport::convert( const TQCString& from, const TQC
KoStore *k= KoStore::createStore(m_chain->outputFile(), KoStore::Write, "application/x-kword"); KoStore *k= KoStore::createStore(m_chain->outputFile(), KoStore::Write, "application/x-kword");
KWDWriter *w= new KWDWriter(k); KWDWriter *w= new KWDWriter(k);
KHTMLReader h(w); TDEHTMLReader h(w);
KURL url; KURL url;
url.setPath(m_chain->inputFile()); url.setPath(m_chain->inputFile());
bool b= h.filter(url); bool b= h.filter(url);

@ -32,9 +32,9 @@
#include <dom/html_misc.h> #include <dom/html_misc.h>
#include <tqregexp.h> #include <tqregexp.h>
KHTMLReader::KHTMLReader(KWDWriter *w) TDEHTMLReader::TDEHTMLReader(KWDWriter *w)
{ {
_html=new KHTMLPart(); _html=new TDEHTMLPart();
_writer=w; _writer=w;
_it_worked=false; _it_worked=false;
} }
@ -44,9 +44,9 @@ void tqt_enter_modal( TQWidget *widget );
void tqt_leave_modal( TQWidget *widget ); void tqt_leave_modal( TQWidget *widget );
bool KHTMLReader::filter(KURL url) bool TDEHTMLReader::filter(KURL url)
{ {
kdDebug(30503) << "KHTMLReader::filter" << endl; kdDebug(30503) << "TDEHTMLReader::filter" << endl;
TQObject::connect(_html,TQT_SIGNAL(completed()),this,TQT_SLOT(completed())); TQObject::connect(_html,TQT_SIGNAL(completed()),this,TQT_SLOT(completed()));
_state.clear(); _state.clear();
@ -72,7 +72,7 @@ bool KHTMLReader::filter(KURL url)
return _it_worked; return _it_worked;
} }
HTMLReader_state *KHTMLReader::state() HTMLReader_state *TDEHTMLReader::state()
{ {
if (_state.count() == 0) if (_state.count() == 0)
{ {
@ -87,7 +87,7 @@ HTMLReader_state *KHTMLReader::state()
return _state.top(); return _state.top();
} }
HTMLReader_state *KHTMLReader::pushNewState() HTMLReader_state *TDEHTMLReader::pushNewState()
{ {
HTMLReader_state *s=new HTMLReader_state; HTMLReader_state *s=new HTMLReader_state;
s->frameset=state()->frameset; s->frameset=state()->frameset;
@ -101,7 +101,7 @@ HTMLReader_state *KHTMLReader::pushNewState()
} }
void KHTMLReader::popState() void TDEHTMLReader::popState()
{ {
kdDebug(30503) << "Entering popState" << endl; kdDebug(30503) << "Entering popState" << endl;
@ -127,22 +127,22 @@ void KHTMLReader::popState()
delete(s); delete(s);
} }
void KHTMLReader::startNewLayout(bool startNewFormat) void TDEHTMLReader::startNewLayout(bool startNewFormat)
{ {
TQDomElement layout; TQDomElement layout;
startNewLayout(startNewFormat,layout); startNewLayout(startNewFormat,layout);
} }
void KHTMLReader::startNewLayout(bool startNewFormat, TQDomElement layout) void TDEHTMLReader::startNewLayout(bool startNewFormat, TQDomElement layout)
{ {
kdDebug() << "entering startNewLayout" << endl; kdDebug() << "entering startNewLayout" << endl;
startNewParagraph(startNewFormat,true); startNewParagraph(startNewFormat,true);
state()->layout=_writer->setLayout(state()->paragraph,layout); state()->layout=_writer->setLayout(state()->paragraph,layout);
} }
void KHTMLReader::completed() void TDEHTMLReader::completed()
{ {
kdDebug(30503) << "KHTMLReader::completed" << endl; kdDebug(30503) << "TDEHTMLReader::completed" << endl;
tqApp->exit_loop(); tqApp->exit_loop();
DOM::Document doc=_html->document(); // FIXME parse <HEAD> too DOM::Document doc=_html->document(); // FIXME parse <HEAD> too
DOM::NodeList list=doc.getElementsByTagName("body"); DOM::NodeList list=doc.getElementsByTagName("body");
@ -170,7 +170,7 @@ void KHTMLReader::completed()
} }
void KHTMLReader::parseNode(DOM::Node node) void TDEHTMLReader::parseNode(DOM::Node node)
{ {
kdDebug(30503) << "Entering parseNode" << endl; kdDebug(30503) << "Entering parseNode" << endl;
// check if this is a text node. // check if this is a text node.
@ -207,7 +207,7 @@ void KHTMLReader::parseNode(DOM::Node node)
popState(); popState();
} }
void KHTMLReader::parse_head(DOM::Element e) void TDEHTMLReader::parse_head(DOM::Element e)
{ {
for (DOM::Element items=e.firstChild();!items.isNull();items=items.nextSibling()) { for (DOM::Element items=e.firstChild();!items.isNull();items=items.nextSibling()) {
if (items.tagName().string().lower() == "title") { if (items.tagName().string().lower() == "title") {
@ -242,7 +242,7 @@ void KHTMLReader::parse_head(DOM::Element e)
} }
bool KHTMLReader::parseTag(DOM::Element e) bool TDEHTMLReader::parseTag(DOM::Element e)
{ {
kdDebug(30503) << "Entering parseTag for " << e.tagName().lower() << endl; kdDebug(30503) << "Entering parseTag for " << e.tagName().lower() << endl;
if (e.tagName().lower()=="a") { return parse_a(e); } if (e.tagName().lower()=="a") { return parse_a(e); }
@ -283,7 +283,7 @@ bool KHTMLReader::parseTag(DOM::Element e)
return true; return true;
} }
void KHTMLReader::startNewParagraph(bool startnewformat, bool startnewlayout) void TDEHTMLReader::startNewParagraph(bool startnewformat, bool startnewlayout)
{ {
kdDebug() << "Entering startNewParagraph" << endl; kdDebug() << "Entering startNewParagraph" << endl;
@ -325,7 +325,7 @@ void KHTMLReader::startNewParagraph(bool startnewformat, bool startnewlayout)
} }
} }
KHTMLReader::~KHTMLReader(){ TDEHTMLReader::~TDEHTMLReader(){
delete _html; delete _html;
} }
@ -339,9 +339,9 @@ KHTMLReader::~KHTMLReader(){
//============================================================== //==============================================================
bool KHTMLReader::parse_CommonAttributes(DOM::Element e) bool TDEHTMLReader::parse_CommonAttributes(DOM::Element e)
{ {
kdDebug(30503) << "entering KHTMLReader::parse_CommonAttributes" << endl; kdDebug(30503) << "entering TDEHTMLReader::parse_CommonAttributes" << endl;
kdDebug(30503) << "tagName is " << e.tagName().string() << endl; kdDebug(30503) << "tagName is " << e.tagName().string() << endl;
TQString s=e.getAttribute("align").string(); TQString s=e.getAttribute("align").string();
if (!s.isEmpty()) if (!s.isEmpty())
@ -364,7 +364,7 @@ bool KHTMLReader::parse_CommonAttributes(DOM::Element e)
return true; return true;
} }
bool KHTMLReader::parse_a(DOM::Element e) { bool TDEHTMLReader::parse_a(DOM::Element e) {
TQString url = e.getAttribute("href").string(); TQString url = e.getAttribute("href").string();
if (!url.isEmpty()) if (!url.isEmpty())
{ {
@ -381,7 +381,7 @@ bool KHTMLReader::parse_a(DOM::Element e) {
return true; /* stop parsing recursively */ return true; /* stop parsing recursively */
} }
bool KHTMLReader::parse_p(DOM::Element e) bool TDEHTMLReader::parse_p(DOM::Element e)
{ {
// For every starting paragraph, a line break has to be inserted. // For every starting paragraph, a line break has to be inserted.
// exception: the first paragraph, e.g. if the <body> starts with a <p>. // exception: the first paragraph, e.g. if the <body> starts with a <p>.
@ -393,7 +393,7 @@ bool KHTMLReader::parse_p(DOM::Element e)
return true; return true;
} }
bool KHTMLReader::parse_hr(DOM::Element /*e*/) bool TDEHTMLReader::parse_hr(DOM::Element /*e*/)
{ {
startNewParagraph(); startNewParagraph();
_writer->createHR(state()->paragraph); _writer->createHR(state()->paragraph);
@ -401,7 +401,7 @@ bool KHTMLReader::parse_hr(DOM::Element /*e*/)
return true; return true;
} }
bool KHTMLReader::parse_br(DOM::Element /*e*/) bool TDEHTMLReader::parse_br(DOM::Element /*e*/)
{ {
startNewParagraph(false,false); //keep the current format and layout startNewParagraph(false,false); //keep the current format and layout
return false; // a BR tag has no childs. return false; // a BR tag has no childs.
@ -466,7 +466,7 @@ static const TQColor parsecolor(const TQString& colorstring)
return colorstring; return colorstring;
} }
void KHTMLReader::parseStyle(DOM::Element e) void TDEHTMLReader::parseStyle(DOM::Element e)
{ {
// styles are broken broken broken broken broken broken. // styles are broken broken broken broken broken broken.
//FIXME: wait until getComputedStyle is more than //FIXME: wait until getComputedStyle is more than
@ -529,7 +529,7 @@ void KHTMLReader::parseStyle(DOM::Element e)
*/ */
} }
bool KHTMLReader::parse_table(DOM::Element e) bool TDEHTMLReader::parse_table(DOM::Element e)
{ {
if(_writer->isInTable()) { if(_writer->isInTable()) {
// We are already inside of a table. Tables in tables are not supported // We are already inside of a table. Tables in tables are not supported
@ -545,7 +545,7 @@ bool KHTMLReader::parse_table(DOM::Element e)
DOM::Element table_body=e.firstChild(); DOM::Element table_body=e.firstChild();
if(table_body.isNull()) { if(table_body.isNull()) {
// If the table_body is empty, we don't continue cause else // If the table_body is empty, we don't continue cause else
// KHTML will throw a DOM::DOMException if we try to access // TDEHTML will throw a DOM::DOMException if we try to access
// the null element. // the null element.
return true; return true;
} }
@ -612,13 +612,13 @@ bool KHTMLReader::parse_table(DOM::Element e)
return false; // we do our own recursion return false; // we do our own recursion
} }
bool KHTMLReader::parse_img(DOM::Element /*e*/) bool TDEHTMLReader::parse_img(DOM::Element /*e*/)
{ {
//TQRect e=e.getRect(); //TQRect e=e.getRect();
return true; return true;
} }
bool KHTMLReader::parse_pre(DOM::Element e) bool TDEHTMLReader::parse_pre(DOM::Element e)
{ {
#if 0 // see Bug #74601 (normal): kword doesn't recognize PRE-tags in HTML #if 0 // see Bug #74601 (normal): kword doesn't recognize PRE-tags in HTML
//pushNewState(); //pushNewState();
@ -644,12 +644,12 @@ bool KHTMLReader::parse_pre(DOM::Element e)
#endif #endif
} }
bool KHTMLReader::parse_ol(DOM::Element e) bool TDEHTMLReader::parse_ol(DOM::Element e)
{ {
return parse_ul(e); return parse_ul(e);
} }
bool KHTMLReader::parse_font(DOM::Element e) bool TDEHTMLReader::parse_font(DOM::Element e)
{ {
kdDebug(30503) << "Entering parse_font" << endl; kdDebug(30503) << "Entering parse_font" << endl;
// fixme don't hardcode 12 font size ... // fixme don't hardcode 12 font size ...
@ -676,10 +676,10 @@ bool KHTMLReader::parse_font(DOM::Element e)
return true; return true;
} }
bool KHTMLReader::parse_ul(DOM::Element e) bool TDEHTMLReader::parse_ul(DOM::Element e)
{ {
// Parse the tag ul and all its subnodes. Take special care for the li tag. // Parse the tag ul and all its subnodes. Take special care for the li tag.
kdDebug(30503) << "Entering KHTMLReader::parse_ul" << endl; kdDebug(30503) << "Entering TDEHTMLReader::parse_ul" << endl;
kdDebug(30503) << "_writer->getText(state()->paragraph)=" << _writer->getText(state()->paragraph) << endl; kdDebug(30503) << "_writer->getText(state()->paragraph)=" << _writer->getText(state()->paragraph) << endl;
_list_depth++; _list_depth++;
if (e.firstChild().nodeName().string().lower() == "#text") // e.g. <ul>this is indented<li>first listitem</li></ul> if (e.firstChild().nodeName().string().lower() == "#text") // e.g. <ul>this is indented<li>first listitem</li></ul>
@ -711,7 +711,7 @@ bool KHTMLReader::parse_ul(DOM::Element e)
parseNode(items); parseNode(items);
} }
_list_depth--; _list_depth--;
kdDebug(30503) << "Leaving KHTMLReader::parse_ul" << endl; kdDebug(30503) << "Leaving TDEHTMLReader::parse_ul" << endl;
return false; return false;
} }

@ -16,8 +16,8 @@
* * * *
***************************************************************************/ ***************************************************************************/
#ifndef KHTMLREADER_H #ifndef TDEHTMLREADER_H
#define KHTMLREADER_H #define TDEHTMLREADER_H
#include <tdehtml_part.h> // fixme speedup compile time by moving these into the cpp file. #include <tdehtml_part.h> // fixme speedup compile time by moving these into the cpp file.
#include <tqdom.h> #include <tqdom.h>
@ -43,14 +43,14 @@ struct HTMLReader_state {
bool in_pre_mode; // keep formatting as is. bool in_pre_mode; // keep formatting as is.
}; };
class KHTMLReader: public TQObject { class TDEHTMLReader: public TQObject {
Q_OBJECT Q_OBJECT
public: public:
KHTMLReader(KWDWriter *writer); TDEHTMLReader(KWDWriter *writer);
~KHTMLReader(); ~TDEHTMLReader();
bool filter(KURL url); bool filter(KURL url);
@ -73,7 +73,7 @@ private:
void stateSetParagraph(TQDomElement p);*/ void stateSetParagraph(TQDomElement p);*/
TQPtrStack<HTMLReader_state> _state; TQPtrStack<HTMLReader_state> _state;
KHTMLPart *_html; TDEHTMLPart *_html;
KWDWriter *_writer; KWDWriter *_writer;
void startNewLayout(bool startNewFormat=false); void startNewLayout(bool startNewFormat=false);

@ -73,7 +73,7 @@
20 Apr 2001 New (single pass) HTML filter<br> 20 Apr 2001 New (single pass) HTML filter<br>
07 May 2001 Removing code of the old import filter<br> 07 May 2001 Removing code of the old import filter<br>
09 May 2001 Removing code of the former two pass filter system<br> 09 May 2001 Removing code of the former two pass filter system<br>
10 Sep 2001 Rewrite using KHTML as html parser, support (simple) tables<br> 10 Sep 2001 Rewrite using TDEHTML as html parser, support (simple) tables<br>
</td> </td>
</tr> </tr>
@ -91,7 +91,7 @@
<a href="http://www.w3.org/TR/html401">HTML 4.01</a><br> <a href="http://www.w3.org/TR/html401">HTML 4.01</a><br>
<a href="http://www.w3.org/TR/xhtml1">XHTML 1.0</a><br> <a href="http://www.w3.org/TR/xhtml1">XHTML 1.0</a><br>
<a href="http://www.w3.org/TR/REC-CSS2">Cascaded Style Sheets Level 2 (CSS2)</a><br> <a href="http://www.w3.org/TR/REC-CSS2">Cascaded Style Sheets Level 2 (CSS2)</a><br>
<a href="http://developer.kde.org/documentation/library/2.1-api/classref/tdehtml/index.html">KHTML Documentation</a><br> <a href="http://developer.kde.org/documentation/library/2.1-api/classref/tdehtml/index.html">TDEHTML Documentation</a><br>
</td> </td>
</tr> </tr>

Loading…
Cancel
Save