diff options
Diffstat (limited to 'lib/kformula')
40 files changed, 121 insertions, 121 deletions
diff --git a/lib/kformula/config/esstixeight.font b/lib/kformula/config/esstixeight.font index 88992333..37cbdfdb 100644 --- a/lib/kformula/config/esstixeight.font +++ b/lib/kformula/config/esstixeight.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixeight font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # 33, 0xE201 37, 0xE205 diff --git a/lib/kformula/config/esstixeleven.font b/lib/kformula/config/esstixeleven.font index 41e9fbe1..d94bd375 100644 --- a/lib/kformula/config/esstixeleven.font +++ b/lib/kformula/config/esstixeleven.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixeleven font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # diff --git a/lib/kformula/config/esstixfifteen.font b/lib/kformula/config/esstixfifteen.font index 920be0c1..3df00e54 100644 --- a/lib/kformula/config/esstixfifteen.font +++ b/lib/kformula/config/esstixfifteen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixfifteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # diff --git a/lib/kformula/config/esstixfive.font b/lib/kformula/config/esstixfive.font index 62724a84..9f57fec2 100644 --- a/lib/kformula/config/esstixfive.font +++ b/lib/kformula/config/esstixfive.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixfive font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # 52, 0x2295 53, 0x2297 diff --git a/lib/kformula/config/esstixfour.font b/lib/kformula/config/esstixfour.font index 411a138a..dc6844b9 100644 --- a/lib/kformula/config/esstixfour.font +++ b/lib/kformula/config/esstixfour.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixfour font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # 56, 0x2291 77, 0x2290 diff --git a/lib/kformula/config/esstixfourteen.font b/lib/kformula/config/esstixfourteen.font index 723a4094..802c47ec 100644 --- a/lib/kformula/config/esstixfourteen.font +++ b/lib/kformula/config/esstixfourteen.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixfourteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # 99, 0x2138 97, 0x2135 diff --git a/lib/kformula/config/esstixnine.font b/lib/kformula/config/esstixnine.font index e294bd6d..4f4e6197 100644 --- a/lib/kformula/config/esstixnine.font +++ b/lib/kformula/config/esstixnine.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixnine font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # diff --git a/lib/kformula/config/esstixone.font b/lib/kformula/config/esstixone.font index df3e95ec..9ff6cabf 100644 --- a/lib/kformula/config/esstixone.font +++ b/lib/kformula/config/esstixone.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixone font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # 75, 0x219B 70, 0x219A diff --git a/lib/kformula/config/esstixseven.font b/lib/kformula/config/esstixseven.font index 37650ee1..25a7d01c 100644 --- a/lib/kformula/config/esstixseven.font +++ b/lib/kformula/config/esstixseven.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixseven font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # 61, 0x0028 62, 0x0029 diff --git a/lib/kformula/config/esstixseventeen.font b/lib/kformula/config/esstixseventeen.font index 00df77cd..c3b8f311 100644 --- a/lib/kformula/config/esstixseventeen.font +++ b/lib/kformula/config/esstixseventeen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixseventeen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # diff --git a/lib/kformula/config/esstixsix.font b/lib/kformula/config/esstixsix.font index 43e2752c..a6412a58 100644 --- a/lib/kformula/config/esstixsix.font +++ b/lib/kformula/config/esstixsix.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixsix font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # 46, 0x220F 35, 0x222E diff --git a/lib/kformula/config/esstixsixteen.font b/lib/kformula/config/esstixsixteen.font index 2a96c0c1..c212e08d 100644 --- a/lib/kformula/config/esstixsixteen.font +++ b/lib/kformula/config/esstixsixteen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixsixteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # diff --git a/lib/kformula/config/esstixten.font b/lib/kformula/config/esstixten.font index fa9c5ee2..dd4c2b0f 100644 --- a/lib/kformula/config/esstixten.font +++ b/lib/kformula/config/esstixten.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixten font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # 118, 0x2202 86, 0x2207 diff --git a/lib/kformula/config/esstixthirteen.font b/lib/kformula/config/esstixthirteen.font index cee5bf99..fc13f891 100644 --- a/lib/kformula/config/esstixthirteen.font +++ b/lib/kformula/config/esstixthirteen.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixthirteen font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # diff --git a/lib/kformula/config/esstixthree.font b/lib/kformula/config/esstixthree.font index fe359c1f..c55acaeb 100644 --- a/lib/kformula/config/esstixthree.font +++ b/lib/kformula/config/esstixthree.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixthree font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # 101, 0x2204 95, 0x227B diff --git a/lib/kformula/config/esstixtwelve.font b/lib/kformula/config/esstixtwelve.font index 3a4b9d23..b82e5d7f 100644 --- a/lib/kformula/config/esstixtwelve.font +++ b/lib/kformula/config/esstixtwelve.font @@ -3,5 +3,5 @@ # Unicode mapping for the esstixtwelve font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # diff --git a/lib/kformula/config/esstixtwo.font b/lib/kformula/config/esstixtwo.font index 201f95e1..ed83909f 100644 --- a/lib/kformula/config/esstixtwo.font +++ b/lib/kformula/config/esstixtwo.font @@ -3,7 +3,7 @@ # Unicode mapping for the esstixtwo font. You can find it at # ftp://ftp.elsevier.nl/pub/styles/esstix/esstix.zip # -# Each line consist of a char position and its tqunicode value. +# Each line consist of a char position and its unicode value. # 100, 0x2203 99, 0x2200 diff --git a/lib/kformula/config/unicode.tbl b/lib/kformula/config/unicode.tbl index d86b1df3..e3e27db8 100644 --- a/lib/kformula/config/unicode.tbl +++ b/lib/kformula/config/unicode.tbl @@ -1,6 +1,6 @@ # -# KFormula tqunicode table -# Each line contains the tqunicode value, the char class +# KFormula unicode table +# Each line contains the unicode value, the char class # (ORDINARY, BINOP or RELATION) and optionally the # chars TeX name. # diff --git a/lib/kformula/elementtype.cc b/lib/kformula/elementtype.cc index a2e44ee6..bd2c3373 100644 --- a/lib/kformula/elementtype.cc +++ b/lib/kformula/elementtype.cc @@ -406,9 +406,9 @@ void AbstractOperatorType::saveMathML( SequenceElement* se, TQDomDocument& doc, op.appendChild( doc.createTextNode( be->getCharacter() ) ); } else { - // tqunicode char + // unicode char TQString s; - op.appendChild( doc.createEntityReference( s.sprintf( "#x%05X", be->getCharacter().tqunicode() ) ) ); + op.appendChild( doc.createEntityReference( s.sprintf( "#x%05X", be->getCharacter().unicode() ) ) ); } TextElement* te = static_cast<TextElement*>( be ); TQString mathvariant = format2variant( te->getCharStyle(), te->getCharFamily() ); diff --git a/lib/kformula/entities.h b/lib/kformula/entities.h index 78e39315..38a5a0e8 100644 --- a/lib/kformula/entities.h +++ b/lib/kformula/entities.h @@ -38,7 +38,7 @@ struct entityMap { return strcmp( name, right ) < 0; } const char* name; - const uint tqunicode; + const uint unicode; }; extern const entityMap entities[]; diff --git a/lib/kformula/fontstyle.h b/lib/kformula/fontstyle.h index 8132bbb6..9fcd78b7 100644 --- a/lib/kformula/fontstyle.h +++ b/lib/kformula/fontstyle.h @@ -48,7 +48,7 @@ public: */ bool init( ContextStyle* context, bool install = true ); - /// the table for ordinary symbols (those that have a tqunicode value) + /// the table for ordinary symbols (those that have a unicode value) const SymbolTable* symbolTable() const { return &m_symbolTable; } SymbolTable* symbolTable() { return &m_symbolTable; } diff --git a/lib/kformula/glyphelement.cc b/lib/kformula/glyphelement.cc index db509eef..709609cf 100644 --- a/lib/kformula/glyphelement.cc +++ b/lib/kformula/glyphelement.cc @@ -152,7 +152,7 @@ void GlyphElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, void GlyphElement::writeMathMLAttributes( TQDomElement& element ) const { element.setAttribute( "fontfamily", m_fontFamily ); - element.setAttribute( "index", m_char.tqunicode() ); + element.setAttribute( "index", m_char.unicode() ); element.setAttribute( "alt", m_alt ); } diff --git a/lib/kformula/kformulacompatibility.h b/lib/kformula/kformulacompatibility.h index 9be5c7ba..a221854c 100644 --- a/lib/kformula/kformulacompatibility.h +++ b/lib/kformula/kformulacompatibility.h @@ -51,8 +51,8 @@ private: TQDomElement findIndexNode(const TQDomDocument& doc, TQDomElement sequence); - ushort nextToken() { return formulaString[pos++].tqunicode(); } - ushort lookAhead(uint i) const { return formulaString[pos+i].tqunicode(); } + ushort nextToken() { return formulaString[pos++].unicode(); } + ushort lookAhead(uint i) const { return formulaString[pos+i].unicode(); } void pushback() { pos--; } bool hasNext() const { return pos < formulaString.length(); } diff --git a/lib/kformula/kformulaconfigpage.cc b/lib/kformula/kformulaconfigpage.cc index 21c3b946..87160a98 100644 --- a/lib/kformula/kformulaconfigpage.cc +++ b/lib/kformula/kformulaconfigpage.cc @@ -63,7 +63,7 @@ ConfigurePage::ConfigurePage( Document* document, TQWidget* view, KConfig* confi TQGroupBox *gbox = new TQGroupBox( i18n( "Fonts" ), box ); gbox->setColumnLayout( 0, Qt::Horizontal ); - TQGridLayout* grid = new TQGridLayout( gbox->tqlayout(), 5, 3 ); + TQGridLayout* grid = new TQGridLayout( gbox->layout(), 5, 3 ); grid->setSpacing( KDialog::spacingHint() ); grid->setColStretch(1, 1); @@ -108,7 +108,7 @@ ConfigurePage::ConfigurePage( Document* document, TQWidget* view, KConfig* confi // hlBox = new TQGroupBox( i18n( "Highlight Colors" ), box ); // hlBox->setColumnLayout( 0, Qt::Horizontal ); -// grid = new TQGridLayout( hlBox->tqlayout(), 5, 2 ); +// grid = new TQGridLayout( hlBox->layout(), 5, 2 ); // grid->setSpacing( KDialog::spacingHint() ); // TQLabel* defaultLabel = new TQLabel( hlBox, "defaultLabel" ); @@ -168,7 +168,7 @@ ConfigurePage::ConfigurePage( Document* document, TQWidget* view, KConfig* confi TQPushButton* ConfigurePage::buildFontLine( TQWidget* parent, - TQGridLayout* tqlayout, int number, TQFont font, TQString name, + TQGridLayout* layout, int number, TQFont font, TQString name, TQLabel*& fontName ) { TQLabel* fontTitle = new TQLabel( name, parent ); @@ -180,9 +180,9 @@ TQPushButton* ConfigurePage::buildFontLine( TQWidget* parent, TQPushButton* chooseButton = new TQPushButton( i18n( "Choose..." ), parent ); - tqlayout->addWidget( fontTitle, number, 0 ); - tqlayout->addWidget( fontName, number, 1 ); - tqlayout->addWidget( chooseButton, number, 2 ); + layout->addWidget( fontTitle, number, 0 ); + layout->addWidget( fontName, number, 1 ); + layout->addWidget( chooseButton, number, 2 ); return chooseButton; } diff --git a/lib/kformula/kformulaconfigpage.h b/lib/kformula/kformulaconfigpage.h index e3ff716a..2649ffa3 100644 --- a/lib/kformula/kformulaconfigpage.h +++ b/lib/kformula/kformulaconfigpage.h @@ -76,7 +76,7 @@ protected slots: private: - TQPushButton* buildFontLine( TQWidget* fontWidget, TQGridLayout* tqlayout, int number, + TQPushButton* buildFontLine( TQWidget* fontWidget, TQGridLayout* layout, int number, TQFont font, TQString name, TQLabel*& fontName ); void updateFontLabel( TQFont font, TQLabel* label ); diff --git a/lib/kformula/kformulacontainer.cc b/lib/kformula/kformulacontainer.cc index f533db86..4d4aa96c 100644 --- a/lib/kformula/kformulacontainer.cc +++ b/lib/kformula/kformulacontainer.cc @@ -339,7 +339,7 @@ void Container::paste() { if (!hasValidCursor()) return; - TQClipboard* clipboard = TQApplication::tqclipboard(); + TQClipboard* clipboard = TQApplication::clipboard(); const TQMimeSource* source = clipboard->data(); if (source->provides( MimeSource::selectionMimeType() )) { TQByteArray data = source->encodedData( MimeSource::selectionMimeType() ); @@ -374,7 +374,7 @@ void Container::copy() if (cursor != 0) { TQDomDocument formula = document()->createMathMLDomDocument(); cursor->copy( formula ); - TQClipboard* clipboard = TQApplication::tqclipboard(); + TQClipboard* clipboard = TQApplication::clipboard(); clipboard->setData(new MimeSource(document(), formula)); } } diff --git a/lib/kformula/kformuladefs.h b/lib/kformula/kformuladefs.h index 80879f98..855121c7 100644 --- a/lib/kformula/kformuladefs.h +++ b/lib/kformula/kformuladefs.h @@ -163,7 +163,7 @@ enum TokenElementType { * The struct used to store static font data. */ struct InternFontTable { - short tqunicode; + short unicode; TQChar pos; CharClass cl; CharStyle style; diff --git a/lib/kformula/kformuladocument.cc b/lib/kformula/kformuladocument.cc index 9caa66cb..ecd621ee 100644 --- a/lib/kformula/kformuladocument.cc +++ b/lib/kformula/kformuladocument.cc @@ -200,7 +200,7 @@ TQDomDocument Document::createDomDocument() } /** - * Create a MathML Dom Document, deprecates KFO Dom Document for internal tqlayout + * Create a MathML Dom Document, deprecates KFO Dom Document for internal layout * TODO: Shouldn't this go to KoDocument ? */ TQDomDocument Document::createMathMLDomDocument() @@ -969,7 +969,7 @@ void DocumentWrapper::insertSymbol() { if ( hasFormula() && m_document->m_contextStyle->symbolTable().contains( m_selectedName ) ) { - TQChar ch = m_document->m_contextStyle->symbolTable().tqunicode( m_selectedName ); + TQChar ch = m_document->m_contextStyle->symbolTable().unicode( m_selectedName ); if ( ch != TQChar::null ) { TextCharRequest r( ch, true ); formula()->performRequest( &r ); @@ -985,7 +985,7 @@ void DocumentWrapper::insertSymbol( TQString name ) { if ( hasFormula() ) { if ( m_document->m_contextStyle->symbolTable().contains( name ) ) { - TQChar ch = m_document->m_contextStyle->symbolTable().tqunicode( name ); + TQChar ch = m_document->m_contextStyle->symbolTable().unicode( name ); if ( ch != TQChar::null ) { TextCharRequest r( ch, true ); formula()->performRequest( &r ); @@ -1174,7 +1174,7 @@ void DocumentWrapper::initSymbolNamesAction() for ( TQStringList::Iterator it = names.begin(); it != names.end(); ++it, ++i ) { - chars[ i ] = st.tqunicode( *it ); + chars[ i ] = st.unicode( *it ); } m_symbolNamesAction->setSymbols( names, m_document->m_contextStyle->getMathFont(), chars ); m_selectedName = names[0]; diff --git a/lib/kformula/kformuladocument.h b/lib/kformula/kformuladocument.h index 46de5774..4d757262 100644 --- a/lib/kformula/kformuladocument.h +++ b/lib/kformula/kformuladocument.h @@ -188,7 +188,7 @@ public: static TQDomDocument createDomDocument(); /** - * Create a MathML Dom Document, deprecates KFO Dom Document for internal tqlayout + * Create a MathML Dom Document, deprecates KFO Dom Document for internal layout * TODO: Shouldn't this go to KoDocument ? */ TQDomDocument createMathMLDomDocument(); diff --git a/lib/kformula/main.cc b/lib/kformula/main.cc index 57344739..56a9e837 100644 --- a/lib/kformula/main.cc +++ b/lib/kformula/main.cc @@ -277,7 +277,7 @@ int main(int argc, char** argv) // Make sure there are no elements in the clipboard. // Okey for a debug app. - TQApplication::tqclipboard()->clear(); + TQApplication::clipboard()->clear(); int destruct = BasicElement::getEvilDestructionCount(); if (destruct != 0) { diff --git a/lib/kformula/prototype/gensymbolfontmap.py b/lib/kformula/prototype/gensymbolfontmap.py index 0f9f3a11..a1373815 100644 --- a/lib/kformula/prototype/gensymbolfontmap.py +++ b/lib/kformula/prototype/gensymbolfontmap.py @@ -3,7 +3,7 @@ import time from xml.sax import saxutils, handler, make_parser -tqunicodetable = { "normal":{}, "bold":{}, "italic":{}, +unicodetable = { "normal":{}, "bold":{}, "italic":{}, "slant":{}, "boldItalic":{} } fonttable = {} @@ -14,7 +14,7 @@ class ContentGenerator(handler.ContentHandler): self.font = None def startElement(self, name, attrs): - if name == 'tqunicodetable': + if name == 'unicodetable': self.font = None for (name, value) in attrs.items(): if name == "font" and value: @@ -31,7 +31,7 @@ class ContentGenerator(handler.ContentHandler): elif name == "style": style = value if number != '': - tqunicodetable[style][number] = (latexName, charClass) + unicodetable[style][number] = (latexName, charClass) fonttable[self.font].append((key, number, style)) def fontkey(font, style, number): @@ -43,9 +43,9 @@ def fontkey(font, style, number): def writeFontTable(fontname, f): f.write('\n\nstatic InternFontTable ' + fontname + 'Map[] = {\n') - for style in tqunicodetable: - for key in tqunicodetable[style]: - latexName, charClass = tqunicodetable[style][key] + for style in unicodetable: + for key in unicodetable[style]: + latexName, charClass = unicodetable[style][key] pos = fontkey(fontname, style, key) if pos: f.write(' { ' + key + ', ' + hex(pos) + ', ' + charClass + ', ' + style + 'Char },\n') @@ -107,14 +107,14 @@ def main(): writeFontTable(fn, f) f.close() - f = open('../tqunicodenames.cc', 'w') + f = open('../unicodenames.cc', 'w') write_header(f) - print >>f, 'struct UnicodeNameTable { short tqunicode; const char* name; };' + print >>f, 'struct UnicodeNameTable { short unicode; const char* name; };' print >>f, 'static UnicodeNameTable nameTable[] = {' nameDir = {} table = {} - for style in tqunicodetable: - table.update(tqunicodetable[style]) + for style in unicodetable: + table.update(unicodetable[style]) for key in table: latexName, charClass = table[key] @@ -128,10 +128,10 @@ def main(): -def make_tqunicode_table(): +def make_unicode_table(): header = [] codes = {} - f = open('../config/tqunicode.tbl', 'r') + f = open('../config/unicode.tbl', 'r') for line in f.xreadlines(): if line[0] == '#': header.append(line.strip()) @@ -142,14 +142,14 @@ def make_tqunicode_table(): codes[line.split(',')[0].strip()] = line f.close() - for key in tqunicodetable: - latexName, charClass = tqunicodetable[key] + for key in unicodetable: + latexName, charClass = unicodetable[key] if len(latexName) > 0: codes[key] = key + ', ' + charClass + ', ' + latexName.replace('\\', '') else: codes[key] = key + ', ' + charClass - f = open('../config/tqunicode.tbl', 'w') + f = open('../config/unicode.tbl', 'w') for line in header: print >> f, line for key in codes: @@ -174,8 +174,8 @@ def make_font_table(font): ## for line in header: ## print >> f, line #print >> f, "name = " + font - for key in tqunicodetable: - latexName, charClass = tqunicodetable[key] + for key in unicodetable: + latexName, charClass = unicodetable[key] pos = fontkey(font, key) if pos: print >> f, str(pos), key, charClass, latexName @@ -186,30 +186,30 @@ def make_all_font_tables(): make_font_table(font) -def symbol_entry(pos, tqunicode, charClass, name): +def symbol_entry(pos, unicode, charClass, name): return ' <entry key="%d" number="%s" name="%s" class="%s"/>' % \ - (pos, tqunicode, name, charClass) + (pos, unicode, name, charClass) def compare_font(font): for line in file(font+".font"): list = line.split() pos = int(list[0]) - tqunicode = list[1] + unicode = list[1] charClass = list[2] if len(list)>3: name = list[3] else: name = "" - if (pos, tqunicode) not in fonttable[font]: - print "not in font", font, (pos, tqunicode) - print symbol_entry(pos, tqunicode, charClass, name) - if tqunicode not in tqunicodetable: - print font, tqunicode, (name, charClass) - print symbol_entry(pos, tqunicode, charClass, name) - elif tqunicodetable[tqunicode] != (name, charClass): - print font, tqunicode, pos, tqunicodetable[tqunicode], "!=", (name, charClass) + if (pos, unicode) not in fonttable[font]: + print "not in font", font, (pos, unicode) + print symbol_entry(pos, unicode, charClass, name) + if unicode not in unicodetable: + print font, unicode, (name, charClass) + print symbol_entry(pos, unicode, charClass, name) + elif unicodetable[unicode] != (name, charClass): + print font, unicode, pos, unicodetable[unicode], "!=", (name, charClass) def compare(): fontnames = [ "symbol", @@ -241,10 +241,10 @@ if __name__ == '__main__': parser.parse("symbol.xml") #print fonttable - #print tqunicodetable + #print unicodetable #compare() main() - #make_tqunicode_table() + #make_unicode_table() #make_all_font_tables() diff --git a/lib/kformula/prototype/unicode.py b/lib/kformula/prototype/unicode.py index 585574cf..3559711d 100755 --- a/lib/kformula/prototype/unicode.py +++ b/lib/kformula/prototype/unicode.py @@ -130,7 +130,7 @@ class Widget(QWidget): print >> f, '<?xml version="1.0" encoding="iso-8859-1"?>' print >> f, '<table>' for font in self.fonts: - print >> f, ' <tqunicodetable font="' + font + '">' + print >> f, ' <unicodetable font="' + font + '">' for (key, number, latexName, charClass) in self.fonts[font]: if not charClass or charClass == '': charClass = 'ORDINARY' @@ -140,7 +140,7 @@ class Widget(QWidget): '" class="' + str(charClass) + \ '"/>' - print >> f, ' </tqunicodetable>' + print >> f, ' </unicodetable>' print >> f, '</table>' f.close() @@ -152,7 +152,7 @@ class ContentGenerator(handler.ContentHandler): self.currentFont = None def startElement(self, name, attrs): - if name == 'tqunicodetable': + if name == 'unicodetable': for (name, value) in attrs.items(): if name == "font": self.currentFont = value diff --git a/lib/kformula/scripts/bycodes.py b/lib/kformula/scripts/bycodes.py index 35b79a55..16d71959 100755 --- a/lib/kformula/scripts/bycodes.py +++ b/lib/kformula/scripts/bycodes.py @@ -25,11 +25,11 @@ import qt def decode( fd, font, line ): begin = string.find( line, '"' ) end = string.find( line, '"', begin + 1) - tqunicode = line[begin + 2:end] # Remove 'U' from string aswell + unicode = line[begin + 2:end] # Remove 'U' from string aswell char_list = [] - separation = string.find( tqunicode, '-' ) + separation = string.find( unicode, '-' ) if separation != -1: - second = tqunicode + second = unicode while separation != -1: first = second[0:separation] second = second[separation + 2:] @@ -38,13 +38,13 @@ def decode( fd, font, line ): if separation == -1: char_list.append( string.atoi( second, 16 ) ) else: - char_list.append( string.atoi ( tqunicode, 16 ) ) + char_list.append( string.atoi ( unicode, 16 ) ) fm = qt.QFontMetrics( qt.QFont( font ) ) in_font = True for c in char_list: if not fm.inFont( qt.QChar( c ) ): in_font = False - fd.write( tqunicode + ' ' + str( in_font ) + '\n') + fd.write( unicode + ' ' + str( in_font ) + '\n') def parse( file, font ): fd = open( file ) diff --git a/lib/kformula/scripts/bynames.py b/lib/kformula/scripts/bynames.py index 0829cf90..afb9ece5 100755 --- a/lib/kformula/scripts/bynames.py +++ b/lib/kformula/scripts/bynames.py @@ -66,7 +66,7 @@ struct entityMap { return qstrcmp( name, right ) < 0; } const char* name; - const uint tqunicode; + const uint unicode; }; extern const entityMap entities[]; diff --git a/lib/kformula/sequenceelement.cc b/lib/kformula/sequenceelement.cc index c44c1b50..e3573174 100644 --- a/lib/kformula/sequenceelement.cc +++ b/lib/kformula/sequenceelement.cc @@ -1184,7 +1184,7 @@ KCommand* SequenceElement::buildCommand( Container* container, Request* request const SymbolTable& table = container->document()->getSymbolTable(); if (table.greekLetters().find(element->getCharacter()) != -1) { KFCReplace* command = new KFCReplace( i18n( "Change Char to Symbol" ), container ); - TextElement* symbol = creationStrategy->createTextElement( table.tqunicodeFromSymbolFont( element->getCharacter() ), true ); + TextElement* symbol = creationStrategy->createTextElement( table.unicodeFromSymbolFont( element->getCharacter() ), true ); command->addElement( symbol ); return command; } @@ -1311,8 +1311,8 @@ KCommand* SequenceElement::input( Container* container, TQKeyEvent* event ) KCommand* SequenceElement::input( Container* container, TQChar ch ) { - int tqunicode = ch.tqunicode(); - switch (tqunicode) { + int unicode = ch.unicode(); + switch (unicode) { case '(': { BracketRequest r( container->document()->leftBracketChar(), container->document()->rightBracketChar() ); @@ -1700,8 +1700,8 @@ KCommand* NameSequence::buildCommand( Container* container, Request* request ) KCommand* NameSequence::input( Container* container, TQChar ch ) { - int tqunicode = ch.tqunicode(); - switch (tqunicode) { + int unicode = ch.unicode(); + switch (unicode) { case '(': case '[': case '|': @@ -1746,12 +1746,12 @@ void NameSequence::setElementType( ElementType* t ) BasicElement* NameSequence::replaceElement( const SymbolTable& table ) { TQString name = buildName(); - TQChar ch = table.tqunicode( name ); + TQChar ch = table.unicode( name ); if ( !ch.isNull() ) { return new TextElement( ch, true ); } else { - ch = table.tqunicode( i18n( name.latin1() ) ); + ch = table.unicode( i18n( name.latin1() ) ); if ( !ch.isNull() ) { return new TextElement( ch, true ); } diff --git a/lib/kformula/symboltable.cc b/lib/kformula/symboltable.cc index 9b27871b..83de81c9 100644 --- a/lib/kformula/symboltable.cc +++ b/lib/kformula/symboltable.cc @@ -44,12 +44,12 @@ KFORMULA_NAMESPACE_BEGIN SymbolFontHelper::SymbolFontHelper() : greek("abgdezhqiklmnxpvrstufjcywGDTQLXPSUFYVW") { - for ( uint i = 0; symbolMap[ i ].tqunicode != 0; i++ ) { - compatibility[ symbolMap[ i ].pos ] = symbolMap[ i ].tqunicode; + for ( uint i = 0; symbolMap[ i ].unicode != 0; i++ ) { + compatibility[ symbolMap[ i ].pos ] = symbolMap[ i ].unicode; } } -TQChar SymbolFontHelper::tqunicodeFromSymbolFont( TQChar pos ) const +TQChar SymbolFontHelper::unicodeFromSymbolFont( TQChar pos ) const { if ( compatibility.contains( pos ) ) { return compatibility[ pos.latin1() ]; @@ -66,17 +66,17 @@ SymbolTable::SymbolTable() void SymbolTable::init( const TQFont& font ) { backupFont = font; - for ( int i=0; operatorTable[i].tqunicode != 0; ++i ) { - names[TQChar( operatorTable[i].tqunicode )] = get_name( operatorTable[i] ); - entries[get_name( operatorTable[i] )] = TQChar( operatorTable[i].tqunicode ); + for ( int i=0; operatorTable[i].unicode != 0; ++i ) { + names[TQChar( operatorTable[i].unicode )] = get_name( operatorTable[i] ); + entries[get_name( operatorTable[i] )] = TQChar( operatorTable[i].unicode ); } - for ( int i=0; arrowTable[i].tqunicode != 0; ++i ) { - names[TQChar( arrowTable[i].tqunicode )] = get_name( arrowTable[i] ); - entries[get_name( arrowTable[i] )] = TQChar( arrowTable[i].tqunicode ); + for ( int i=0; arrowTable[i].unicode != 0; ++i ) { + names[TQChar( arrowTable[i].unicode )] = get_name( arrowTable[i] ); + entries[get_name( arrowTable[i] )] = TQChar( arrowTable[i].unicode ); } - for ( int i=0; greekTable[i].tqunicode != 0; ++i ) { - names[TQChar( greekTable[i].tqunicode )] = get_name( greekTable[i] ); - entries[get_name( greekTable[i] )] = TQChar( greekTable[i].tqunicode ); + for ( int i=0; greekTable[i].unicode != 0; ++i ) { + names[TQChar( greekTable[i].unicode )] = get_name( greekTable[i] ); + entries[get_name( greekTable[i] )] = TQChar( greekTable[i].unicode ); } } @@ -85,7 +85,7 @@ bool SymbolTable::contains(TQString name) const return entries.find( name ) != entries.end(); } -TQChar SymbolTable::tqunicode(TQString name) const +TQChar SymbolTable::unicode(TQString name) const { return entries[ name ]; } @@ -112,9 +112,9 @@ CharClass SymbolTable::charClass( TQChar symbol ) const } -TQChar SymbolTable::tqunicodeFromSymbolFont( TQChar pos ) const +TQChar SymbolTable::unicodeFromSymbolFont( TQChar pos ) const { - return symbolFontHelper.tqunicodeFromSymbolFont( pos ); + return symbolFontHelper.unicodeFromSymbolFont( pos ); } @@ -128,13 +128,13 @@ TQStringList SymbolTable::allNames() const { TQStringList list; - for ( int i=0; operatorTable[i].tqunicode != 0; ++i ) { + for ( int i=0; operatorTable[i].unicode != 0; ++i ) { list.append( get_name( operatorTable[i] )); } - for ( int i=0; arrowTable[i].tqunicode != 0; ++i ) { + for ( int i=0; arrowTable[i].unicode != 0; ++i ) { list.append( get_name( arrowTable[i] )); } - for ( int i=0; greekTable[i].tqunicode != 0; ++i ) { + for ( int i=0; greekTable[i].unicode != 0; ++i ) { list.append( get_name( greekTable[i] ) ); } return list; @@ -144,7 +144,7 @@ TQStringList SymbolTable::allNames() const TQString SymbolTable::get_name( struct UnicodeNameTable entry ) const { if ( !*entry.name ) { - return "U" + TQString( "%1" ).arg( entry.tqunicode, 4, 16 ).upper(); + return "U" + TQString( "%1" ).arg( entry.unicode, 4, 16 ).upper(); } return entry.name; } diff --git a/lib/kformula/symboltable.h b/lib/kformula/symboltable.h index d4a19f03..7820af81 100644 --- a/lib/kformula/symboltable.h +++ b/lib/kformula/symboltable.h @@ -51,14 +51,14 @@ public: TQString greekLetters() const { return greek; } /** - * @returns the tqunicode value of the symbol font char. + * @returns the unicode value of the symbol font char. */ - TQChar tqunicodeFromSymbolFont( TQChar pos ) const; + TQChar unicodeFromSymbolFont( TQChar pos ) const; private: /** - * symbol font char -> tqunicode mapping. + * symbol font char -> unicode mapping. */ TQMap<TQChar, TQChar> compatibility; @@ -91,7 +91,7 @@ public: * @returns the char in the symbol font that belongs to * the given name. */ - TQChar tqunicode( TQString name ) const; + TQChar unicode( TQString name ) const; TQString name( TQChar symbol ) const; TQFont font( TQChar symbol, const TQFont& f ) const; @@ -104,9 +104,9 @@ public: TQString greekLetters() const; /** - * @returns the tqunicode value of the symbol font char. + * @returns the unicode value of the symbol font char. */ - TQChar tqunicodeFromSymbolFont( TQChar pos ) const; + TQChar unicodeFromSymbolFont( TQChar pos ) const; /** * @returns all known names as strings. @@ -121,12 +121,12 @@ private: TQString get_name( UnicodeNameTable entry ) const; /** - * tqunicode -> name mapping. + * unicode -> name mapping. */ NameTable names; /** - * Name -> tqunicode mapping. + * Name -> unicode mapping. */ EntryTable entries; diff --git a/lib/kformula/textelement.cc b/lib/kformula/textelement.cc index 8789377c..7f146b49 100644 --- a/lib/kformula/textelement.cc +++ b/lib/kformula/textelement.cc @@ -66,7 +66,7 @@ TokenType TextElement::getTokenType() const return getSymbolTable().charClass( character ); } - switch ( character.tqunicode() ) { + switch ( character.unicode() ) { case '+': case '-': case '*': @@ -202,7 +202,7 @@ void TextElement::draw( TQPainter& painter, const LuPixelRect& /*r*/, ElementType* token = getElementType(); if ( ( token != 0 ) && !symbol ) { TQString text = token->text( static_cast<SequenceElement*>( getParent() ) ); -// kdDebug() << "draw text: " << text[0].tqunicode() +// kdDebug() << "draw text: " << text[0].unicode() // << " " << painter.font().family().latin1() // << endl; painter.fillRect( context.layoutUnitToPixelX( parentOrigin.x() ), @@ -401,10 +401,10 @@ bool TextElement::readAttributesFromDom(TQDomElement element) if(!symbolStr.isNull()) { int symbolInt = symbolStr.toInt(); if ( symbolInt == 1 ) { - character = getSymbolTable().tqunicodeFromSymbolFont(character); + character = getSymbolTable().unicodeFromSymbolFont(character); } if ( symbolInt == 2 ) { - switch ( character.tqunicode() ) { + switch ( character.unicode() ) { case 0x03D5: character = 0x03C6; break; case 0x03C6: character = 0x03D5; break; case 0x03Ba: character = 0x03BA; break; diff --git a/lib/kformula/tokenelement.cc b/lib/kformula/tokenelement.cc index eda9c0dc..6addc385 100644 --- a/lib/kformula/tokenelement.cc +++ b/lib/kformula/tokenelement.cc @@ -67,7 +67,7 @@ int TokenElement::buildChildrenFromMathMLDom(TQPtrList<BasicElement>& list, TQDo kdWarning() << "Invalid entity refererence: " << entity << endl; } else { - TextElement* child = new TextElement( TQChar( pos->tqunicode ) ); + TextElement* child = new TextElement( TQChar( pos->unicode ) ); child->setParent(this); child->setCharFamily( charFamily() ); child->setCharStyle( charStyle() ); diff --git a/lib/kformula/unicodetable.cc b/lib/kformula/unicodetable.cc index ad9a7f74..23dc8636 100644 --- a/lib/kformula/unicodetable.cc +++ b/lib/kformula/unicodetable.cc @@ -19,7 +19,7 @@ KFORMULA_NAMESPACE_BEGIN -struct UnicodeNameTable { short tqunicode; const char* name; }; +struct UnicodeNameTable { short unicode; const char* name; }; static UnicodeNameTable greekTable[] = { { 0x03B1, "alpha" }, |