From dfe289850f068f19ba4a83ab4e7e22a7e09c13c9 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:17:21 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- tdehtml/rendering/render_generated.cpp | 392 +++++++++++++++++++++++++++++++++ 1 file changed, 392 insertions(+) create mode 100644 tdehtml/rendering/render_generated.cpp (limited to 'tdehtml/rendering/render_generated.cpp') diff --git a/tdehtml/rendering/render_generated.cpp b/tdehtml/rendering/render_generated.cpp new file mode 100644 index 000000000..2b793e504 --- /dev/null +++ b/tdehtml/rendering/render_generated.cpp @@ -0,0 +1,392 @@ +/** + * This file is part of the HTML rendering engine for KDE. + * + * Copyright (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include "rendering/render_generated.h" +#include "rendering/render_style.h" +#include "rendering/enumerate.h" +#include "rendering/counter_tree.h" +#include "css/css_valueimpl.h" + +using namespace tdehtml; +using namespace Enumerate; + +// ------------------------------------------------------------------------- + +RenderCounterBase::RenderCounterBase(DOM::NodeImpl* node) + : RenderText(node,0), m_counterNode(0) +{ +} + +void RenderCounterBase::layout() +{ + KHTMLAssert( needsLayout() ); + + if ( !minMaxKnown() ) + calcMinMaxWidth(); + + RenderText::layout(); +} + +void RenderCounterBase::calcMinMaxWidth() +{ + KHTMLAssert( !minMaxKnown() ); + + generateContent(); + + if (str) str->deref(); + str = new DOM::DOMStringImpl(m_item.unicode(), m_item.length()); + str->ref(); + + RenderText::calcMinMaxWidth(); +} + + +void RenderCounterBase::updateContent() +{ + setMinMaxKnown(false); +} + +// ------------------------------------------------------------------------- + +RenderCounter::RenderCounter(DOM::NodeImpl* node, const DOM::CounterImpl* counter) + : RenderCounterBase(node), m_counter(counter) +{ +} + +TQString RenderCounter::toListStyleType(int value, int total, EListStyleType type) +{ + TQString item; + switch(type) + { + case LNONE: + break; +// Glyphs: (these values are not really used and instead handled by RenderGlyph) + case LDISC: + item = TQChar(0x2022); + break; + case LCIRCLE: + item = TQChar(0x25e6); + break; + case LSQUARE: + item = TQChar(0x25a0); + break; + case LBOX: + item = TQChar(0x25a1); + break; + case LDIAMOND: + item = TQChar(0x25c6); + break; +// Numeric: + case LDECIMAL: + item.setNum ( value ); + break; + case DECIMAL_LEADING_ZERO: { + int decimals = 2; + int t = total/100; + while (t>0) { + t = t/10; + decimals++; + } + decimals = kMax(decimals, 2); + TQString num = TQString::number(value); + item.fill('0',decimals-num.length()); + item.append(num); + break; + } + case ARABIC_INDIC: + item = toArabicIndic( value ); + break; + case LAO: + item = toLao( value ); + break; + case PERSIAN: + case URDU: + item = toPersianUrdu( value ); + break; + case THAI: + item = toThai( value ); + break; + case TIBETAN: + item = toTibetan( value ); + break; +// Algoritmic: + case LOWER_ROMAN: + item = toRoman( value, false ); + break; + case UPPER_ROMAN: + item = toRoman( value, true ); + break; + case HEBREW: + item = toHebrew( value ); + break; + case ARMENIAN: + item = toArmenian( value ); + break; + case GEORGIAN: + item = toGeorgian( value ); + break; +// Alphabetic: + case LOWER_ALPHA: + case LOWER_LATIN: + item = toLowerLatin( value ); + break; + case UPPER_ALPHA: + case UPPER_LATIN: + item = toUpperLatin( value ); + break; + case LOWER_GREEK: + item = toLowerGreek( value ); + break; + case UPPER_GREEK: + item = toUpperGreek( value ); + break; + case HIRAGANA: + item = toHiragana( value ); + break; + case HIRAGANA_IROHA: + item = toHiraganaIroha( value ); + break; + case KATAKANA: + item = toKatakana( value ); + break; + case KATAKANA_IROHA: + item = toKatakanaIroha( value ); + break; +// Ideographic: + case JAPANESE_FORMAL: + item = toJapaneseFormal( value ); + break; + case JAPANESE_INFORMAL: + item = toJapaneseInformal( value ); + break; + case SIMP_CHINESE_FORMAL: + item = toSimpChineseFormal( value ); + break; + case SIMP_CHINESE_INFORMAL: + item = toSimpChineseInformal( value ); + break; + case TRAD_CHINESE_FORMAL: + item = toTradChineseFormal( value ); + break; + case CJK_IDEOGRAPHIC: + // CSS 3 List says treat as trad-chinese-informal + case TRAD_CHINESE_INFORMAL: + item = toTradChineseInformal( value ); + break; + default: + item.setNum ( value ); + break; + } + return item; +} + +void RenderCounter::generateContent() +{ + bool counters; + counters = !m_counter->separator().isNull(); + + if (!m_counterNode) + m_counterNode = getCounter(m_counter->identifier().string(), true, counters); + + int value = m_counterNode->count(); + if (m_counterNode->isReset()) value = m_counterNode->value(); + int total = value; + if (m_counterNode->parent()) total = m_counterNode->parent()->total(); + m_item = toListStyleType(value, total, (EListStyleType)m_counter->listStyle()); + + if (counters) { + CounterNode *counter = m_counterNode->parent(); + // we deliberately do not render the root counter-node + while(counter->parent() && !(counter->isReset() && counter->parent()->isRoot())) { + value = counter->count(); + total = counter->parent()->total(); + m_item = toListStyleType(value, total, (EListStyleType)m_counter->listStyle()) + m_counter->separator().string() + m_item; + counter = counter->parent(); + }; + } + +} + +// ------------------------------------------------------------------------- + +RenderQuote::RenderQuote(DOM::NodeImpl* node, EQuoteContent type) + : RenderCounterBase(node), m_quoteType(type) +{ +} + + +int RenderQuote::quoteCount() const +{ + switch(m_quoteType) { + case OPEN_QUOTE: + case NO_OPEN_QUOTE: + return 1; + case CLOSE_QUOTE: + case NO_CLOSE_QUOTE: + return -1; + case NO_QUOTE: + return 0; + } + assert(false); + return 0; +} + +void RenderQuote::generateContent() +{ + bool visual; + if (m_quoteType == NO_CLOSE_QUOTE || m_quoteType == NO_OPEN_QUOTE) + visual = false; + else + visual = true; + + if (!m_counterNode) + m_counterNode = getCounter("-tdehtml-quotes", visual, false); + + int value = m_counterNode->count(); + if (m_counterNode->isReset()) value = m_counterNode->value(); + switch (m_quoteType) { + case OPEN_QUOTE: + m_item = style()->openQuote( value ); + break; + case CLOSE_QUOTE: + m_item = style()->closeQuote( value ); + break; + case NO_OPEN_QUOTE: + case NO_CLOSE_QUOTE: + case NO_QUOTE: + m_item = TQString(); + } +} + +// ------------------------------------------------------------------------- + +RenderGlyph::RenderGlyph(DOM::NodeImpl* node, EListStyleType type) + : RenderBox(node), m_type(type) +{ + setInline(true); +// setReplaced(true); +} + +void RenderGlyph::setStyle(RenderStyle *_style) +{ + RenderBox::setStyle(_style); + + const TQFontMetrics &fm = style()->fontMetrics(); + TQRect xSize= fm.boundingRect('x'); + m_height = xSize.height(); + m_width = xSize.width();; + + switch(m_type) { + // Glyphs: + case LDISC: + case LCIRCLE: + case LSQUARE: + case LBOX: + case LDIAMOND: + case LNONE: + break; + default: + // not a glyph ! + assert(false); + break; + } +} + +void RenderGlyph::calcMinMaxWidth() +{ + m_minWidth = m_width; + m_maxWidth = m_width; + + setMinMaxKnown(); +} + +short RenderGlyph::lineHeight(bool /*b*/) const +{ + return height(); +} + +short RenderGlyph::baselinePosition(bool /*b*/) const +{ + return height(); +} + +void RenderGlyph::paint(PaintInfo& paintInfo, int _tx, int _ty) +{ + if (paintInfo.phase != PaintActionForeground) + return; + + if (style()->visibility() != VISIBLE) return; + + _tx += m_x; + _ty += m_y; + + if((_ty > paintInfo.r.bottom()) || (_ty + m_height <= paintInfo.r.top())) + return; + + TQPainter* p = paintInfo.p; + + const TQColor color( style()->color() ); + p->setPen( color ); + + int xHeight = m_height; + int bulletWidth = (xHeight+1)/2; + int yoff = (xHeight - 1)/4; + TQRect marker(_tx, _ty + yoff, bulletWidth, bulletWidth); + + switch(m_type) { + case LDISC: + p->setBrush( color ); + p->drawEllipse( marker ); + return; + case LCIRCLE: + p->setBrush( Qt::NoBrush ); + p->drawEllipse( marker ); + return; + case LSQUARE: + p->setBrush( color ); + p->drawRect( marker ); + return; + case LBOX: + p->setBrush( Qt::NoBrush ); + p->drawRect( marker ); + return; + case LDIAMOND: { + static TQPointArray diamond(4); + int x = marker.x(); + int y = marker.y(); + int s = bulletWidth/2; + diamond[0] = TQPoint(x+s, y); + diamond[1] = TQPoint(x+2*s, y+s); + diamond[2] = TQPoint(x+s, y+2*s); + diamond[3] = TQPoint(x, y+s); + p->setBrush( color ); + p->drawConvexPolygon( diamond, 0, 4 ); + return; + } + case LNONE: + return; + default: + // not a glyph + assert(false); + } +} + -- cgit v1.2.3 From 7427e438358d44c37e3c8b0a9cfbb225ffd60e79 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 15:54:26 -0600 Subject: Rename KHTML and kiobuffer --- KDE2PORTING.html | 12 +- KDE3PORTING.html | 10 +- TODO | 2 +- configure.in.in | 2 +- kjs/README | 2 +- kstyles/keramik/keramik.cpp | 8 +- tdecore/network/kiobuffer.h | 144 ---- tdecore/network/tdeiobuffer.h | 144 ++++ tdecore/tdelibs_export.h | 2 +- tdehtml/ChangeLog | 32 +- tdehtml/DESIGN.html | 14 +- tdehtml/Mainpage.dox | 12 +- tdehtml/README.HTMLWidget | 2 +- tdehtml/css/css_renderstyledeclarationimpl.cpp | 56 +- tdehtml/css/css_valueimpl.cpp | 2 +- tdehtml/css/csshelper.h | 2 +- tdehtml/css/cssparser.cpp | 82 +- tdehtml/css/cssproperties.c | 30 +- tdehtml/css/cssproperties.h | 30 +- tdehtml/css/cssstyleselector.cpp | 72 +- tdehtml/css/cssstyleselector.h | 18 +- tdehtml/css/cssvalues.c | 54 +- tdehtml/css/cssvalues.h | 54 +- tdehtml/css/cssvalues.in | 6 +- tdehtml/css/parser.cpp | 14 +- tdehtml/css/parser.h | 12 +- tdehtml/css/parser.y | 12 +- tdehtml/css/tokenizer.cpp | 6 +- tdehtml/css/tokenizer.flex | 6 +- tdehtml/design.h | 2 +- tdehtml/dom/css_rule.h | 20 +- tdehtml/dom/css_stylesheet.h | 14 +- tdehtml/dom/css_value.h | 14 +- tdehtml/dom/dom2_events.h | 14 +- tdehtml/dom/dom2_range.h | 4 +- tdehtml/dom/dom2_traversal.h | 8 +- tdehtml/dom/dom2_views.h | 2 +- tdehtml/dom/dom_doc.cpp | 2 +- tdehtml/dom/dom_doc.h | 20 +- tdehtml/dom/dom_element.h | 6 +- tdehtml/dom/dom_exception.h | 2 +- tdehtml/dom/dom_misc.h | 2 +- tdehtml/dom/dom_node.h | 8 +- tdehtml/dom/dom_string.h | 14 +- tdehtml/dom/dom_text.h | 6 +- tdehtml/dom/dom_xml.h | 10 +- tdehtml/dom/html_base.h | 12 +- tdehtml/dom/html_block.h | 14 +- tdehtml/dom/html_document.cpp | 2 +- tdehtml/dom/html_document.h | 12 +- tdehtml/dom/html_element.h | 6 +- tdehtml/dom/html_form.h | 22 +- tdehtml/dom/html_head.h | 12 +- tdehtml/dom/html_image.h | 6 +- tdehtml/dom/html_inline.h | 10 +- tdehtml/dom/html_list.h | 12 +- tdehtml/dom/html_misc.h | 8 +- tdehtml/dom/html_object.h | 6 +- tdehtml/dom/html_table.h | 12 +- tdehtml/domtreeview.cpp | 2 +- tdehtml/domtreeview.h | 4 +- tdehtml/ecma/README | 4 +- tdehtml/ecma/kjs_binding.cpp | 2 +- tdehtml/ecma/kjs_debugwin.cpp | 10 +- tdehtml/ecma/kjs_dom.cpp | 26 +- tdehtml/ecma/kjs_events.cpp | 4 +- tdehtml/ecma/kjs_html.cpp | 34 +- tdehtml/ecma/kjs_mozilla.cpp | 4 +- tdehtml/ecma/kjs_mozilla.h | 8 +- tdehtml/ecma/kjs_navigator.cpp | 2 +- tdehtml/ecma/kjs_navigator.h | 8 +- tdehtml/ecma/kjs_proxy.cpp | 8 +- tdehtml/ecma/kjs_proxy.h | 6 +- tdehtml/ecma/kjs_traversal.cpp | 4 +- tdehtml/ecma/kjs_window.cpp | 150 ++-- tdehtml/ecma/kjs_window.h | 12 +- tdehtml/ecma/testecma.cpp | 2 +- tdehtml/ecma/xmlhttprequest.cpp | 2 +- tdehtml/html/html_baseimpl.cpp | 24 +- tdehtml/html/html_baseimpl.h | 6 +- tdehtml/html/html_blockimpl.cpp | 28 +- tdehtml/html/html_documentimpl.cpp | 12 +- tdehtml/html/html_documentimpl.h | 4 +- tdehtml/html/html_elementimpl.cpp | 6 +- tdehtml/html/html_formimpl.cpp | 36 +- tdehtml/html/html_formimpl.h | 2 +- tdehtml/html/html_headimpl.cpp | 4 +- tdehtml/html/html_headimpl.h | 2 +- tdehtml/html/html_inlineimpl.cpp | 4 +- tdehtml/html/html_objectimpl.cpp | 10 +- tdehtml/html/html_objectimpl.h | 2 +- tdehtml/html/html_tableimpl.cpp | 10 +- tdehtml/html/htmlparser.cpp | 52 +- tdehtml/html/htmlparser.h | 12 +- tdehtml/html/htmltokenizer.cpp | 28 +- tdehtml/html/htmltokenizer.h | 12 +- tdehtml/htmlpageinfo.ui | 2 +- tdehtml/java/kjavaappletcontext.h | 6 +- tdehtml/java/kjavaappletviewer.cpp | 8 +- tdehtml/misc/decoder.h | 4 +- tdehtml/misc/htmltags.h | 4 +- tdehtml/misc/loader.cpp | 26 +- tdehtml/misc/loader.h | 24 +- tdehtml/misc/maketags | 4 +- tdehtml/misc/stringit.h | 4 +- tdehtml/rendering/bidi.cpp | 16 +- tdehtml/rendering/font.cpp | 2 +- tdehtml/rendering/font.h | 4 +- tdehtml/rendering/render_applet.cpp | 8 +- tdehtml/rendering/render_applet.h | 2 +- tdehtml/rendering/render_arena.cpp | 14 +- tdehtml/rendering/render_arena.h | 6 +- tdehtml/rendering/render_block.cpp | 40 +- tdehtml/rendering/render_block.h | 2 +- tdehtml/rendering/render_box.cpp | 14 +- tdehtml/rendering/render_canvas.cpp | 8 +- tdehtml/rendering/render_canvas.h | 8 +- tdehtml/rendering/render_container.cpp | 14 +- tdehtml/rendering/render_flow.cpp | 2 +- tdehtml/rendering/render_form.cpp | 42 +- tdehtml/rendering/render_form.h | 6 +- tdehtml/rendering/render_frames.cpp | 40 +- tdehtml/rendering/render_frames.h | 4 +- tdehtml/rendering/render_generated.cpp | 4 +- tdehtml/rendering/render_image.cpp | 6 +- tdehtml/rendering/render_inline.cpp | 4 +- tdehtml/rendering/render_inline.h | 2 +- tdehtml/rendering/render_list.cpp | 10 +- tdehtml/rendering/render_object.cpp | 20 +- tdehtml/rendering/render_object.h | 6 +- tdehtml/rendering/render_replaced.cpp | 42 +- tdehtml/rendering/render_replaced.h | 10 +- tdehtml/rendering/render_style.h | 4 +- tdehtml/rendering/render_table.cpp | 22 +- tdehtml/rendering/render_text.cpp | 20 +- tdehtml/tdehtml-devel-gdb | 6 +- tdehtml/tdehtml.desktop | 4 +- tdehtml/tdehtml_caret.cpp | 18 +- tdehtml/tdehtml_caret_p.h | 14 +- tdehtml/tdehtml_ext.cpp | 134 +-- tdehtml/tdehtml_ext.h | 42 +- tdehtml/tdehtml_factory.cpp | 60 +- tdehtml/tdehtml_factory.h | 26 +- tdehtml/tdehtml_iface.cc | 80 +- tdehtml/tdehtml_iface.h | 12 +- tdehtml/tdehtml_pagecache.cpp | 100 +-- tdehtml/tdehtml_pagecache.h | 22 +- tdehtml/tdehtml_part.cpp | 1028 ++++++++++++------------ tdehtml/tdehtml_part.h | 86 +- tdehtml/tdehtml_printsettings.cpp | 8 +- tdehtml/tdehtml_printsettings.h | 10 +- tdehtml/tdehtml_run.cpp | 22 +- tdehtml/tdehtml_run.h | 8 +- tdehtml/tdehtml_settings.cc | 146 ++-- tdehtml/tdehtml_settings.h | 16 +- tdehtml/tdehtmlimage.cpp | 72 +- tdehtml/tdehtmlimage.h | 26 +- tdehtml/tdehtmlpart_p.h | 82 +- tdehtml/tdehtmlview.cpp | 464 +++++------ tdehtml/tdehtmlview.h | 44 +- tdehtml/tdemultipart/README | 6 +- tdehtml/tdemultipart/tdemultipart.cpp | 14 +- tdehtml/tdemultipart/tdemultipart.h | 2 +- tdehtml/test_regression.cpp | 44 +- tdehtml/test_regression.h | 24 +- tdehtml/test_regression_fontoverload.cpp | 4 +- tdehtml/testtdehtml.cpp | 6 +- tdehtml/testtdehtml.h | 8 +- tdehtml/xml/dom2_eventsimpl.cpp | 18 +- tdehtml/xml/dom2_eventsimpl.h | 12 +- tdehtml/xml/dom2_rangeimpl.cpp | 2 +- tdehtml/xml/dom_docimpl.cpp | 30 +- tdehtml/xml/dom_docimpl.h | 14 +- tdehtml/xml/dom_elementimpl.cpp | 4 +- tdehtml/xml/dom_nodeimpl.cpp | 6 +- tdehtml/xml/dom_nodeimpl.h | 6 +- tdehtml/xml/xml_tokenizer.cpp | 4 +- tdehtml/xml/xml_tokenizer.h | 10 +- tdeio/tdeio/kprotocolmanager.cpp | 2 +- tdeparts/COMMENTS | 4 +- tdeparts/browserextension.h | 16 +- tdeparts/browserrun.cpp | 4 +- tdeparts/browserrun.h | 2 +- tdeparts/browserview.desktop | 2 +- tdespell2/tests/backgroundtest.cpp | 12 +- tdeui/ksyntaxhighlighter.cpp | 2 +- win/tdelibs_export_win.h | 6 +- 187 files changed, 2464 insertions(+), 2464 deletions(-) delete mode 100644 tdecore/network/kiobuffer.h create mode 100644 tdecore/network/tdeiobuffer.h (limited to 'tdehtml/rendering/render_generated.cpp') diff --git a/KDE2PORTING.html b/KDE2PORTING.html index 131c74577..8f6070bf7 100644 --- a/KDE2PORTING.html +++ b/KDE2PORTING.html @@ -351,13 +351,13 @@ This makes KRun the recommended way to run another program in KDE 2. tdehtmlw has been replaced with tdehtml.