diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2024-09-30 00:04:56 +0300 |
---|---|---|
committer | Philippe Mavridis <philippe.mavridis@yandex.com> | 2025-05-15 21:00:25 +0300 |
commit | 04e86613f67d171cc965fce64a4310c0d25c98e1 (patch) | |
tree | 08a85d43bc40568f94259601339ccd7e1de11773 /lib/kformula | |
parent | cf85b9c285a2b9baa87c9d0cb9d683b48e82a475 (diff) | |
download | koffice-feat/cmake-port.tar.gz koffice-feat/cmake-port.zip |
WIP: CMake portfeat/cmake-port
Signed-off-by: Philippe Mavridis <philippe.mavridis@yandex.com>
Diffstat (limited to 'lib/kformula')
-rw-r--r-- | lib/kformula/CMakeLists.txt | 70 | ||||
-rw-r--r-- | lib/kformula/dtd/CMakeLists.txt | 11 | ||||
-rw-r--r-- | lib/kformula/entities.cpp | 8 | ||||
-rw-r--r-- | lib/kformula/fonts/CMakeLists.txt | 18 | ||||
-rw-r--r-- | lib/kformula/kformulacontainer.cpp | 2 | ||||
-rw-r--r-- | lib/kformula/kformuladocument.cpp | 11 | ||||
-rw-r--r-- | lib/kformula/pics/CMakeLists.txt | 11 | ||||
-rw-r--r-- | lib/kformula/pics/crystalsvg/CMakeLists.txt | 11 | ||||
-rw-r--r-- | lib/kformula/unicodetable.cpp | 4 |
9 files changed, 134 insertions, 12 deletions
diff --git a/lib/kformula/CMakeLists.txt b/lib/kformula/CMakeLists.txt new file mode 100644 index 000000000..ee3df6cc4 --- /dev/null +++ b/lib/kformula/CMakeLists.txt @@ -0,0 +1,70 @@ +############################################################################### +# Trinity KOffice # +# --------------- # +# This file is licensed under the terms of GNU GPL v3 or later. # +# Improvements and feedback are welcome. # +############################################################################### + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/lib/kofficecore + ${CMAKE_SOURCE_DIR}/lib/kofficeui + ${CMAKE_SOURCE_DIR}/lib/store + ${CMAKE_SOURCE_DIR}/lib/kwmf + ${CMAKE_SOURCE_DIR}/lib/kopalette + ${CMAKE_SOURCE_DIR}/lib/kotext + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + +### Libraries ################################################################# +# We have to name it kformulalib, not just kformula, since that's the name of +# the tdeinit module for kformula. +tde_add_library(kformulalib SHARED AUTOMOC + SOURCES + basicelement.cpp contextstyle.cpp formulacursor.cpp + formulaelement.cpp indexelement.cpp kformulacontainer.cpp + sequenceelement.cpp textelement.cpp bracketelement.cpp + matrixelement.cpp fractionelement.cpp rootelement.cpp symbolelement.cpp + kformulacommand.cpp kformulamimesource.cpp + MatrixDialog.cpp sequenceparser.cpp elementtype.cpp kformuladocument.cpp + symboltable.cpp kformulainputfilter.cpp kformulaview.cpp + spaceelement.cpp kformulaconfigpage.cpp + symbolaction.cpp fontstyle.cpp creationstrategy.cpp + oasiscreationstrategy.cpp tokenstyleelement.cpp tokenelement.cpp + identifierelement.cpp operatorelement.cpp glyphelement.cpp styleelement.cpp + stringelement.cpp paddedelement.cpp errorelement.cpp phantomelement.cpp + actionelement.cpp encloseelement.cpp entities.cpp operatordictionary.cpp + numberelement.cpp + LINK tdeui-shared kotext-shared + DESTINATION ${LIB_INSTALL_DIR} +) + +### Programs ################################################################## +if (BUILD_TESTS) + tde_add_executable(koformulatest AUTOMOC + SOURCES main.cpp kformulawidget.cpp + LINK kformulalib-shared + ) +endif() + +### Headers ################################################################### +# install( +# FILES +# kformulacontainer.h kformuladocument.h kformulaview.h +# kformuladefs.h kformulaconfigpage.h +# DESTINATION ${INCLUDE_INSTALL_DIR}/KOffice +# ) + +### Data ###################################################################### +add_subdirectory(pics) +add_subdirectory(fonts) +add_subdirectory(dtd) + +# kate: indent-width 2; replace-tabs true;
\ No newline at end of file diff --git a/lib/kformula/dtd/CMakeLists.txt b/lib/kformula/dtd/CMakeLists.txt new file mode 100644 index 000000000..b8bf11ee4 --- /dev/null +++ b/lib/kformula/dtd/CMakeLists.txt @@ -0,0 +1,11 @@ +############################################################################### +# Trinity KOffice # +# --------------- # +# This file is licensed under the terms of GNU GPL v3 or later. # +# Improvements and feedback are welcome. # +############################################################################### + +### Data ###################################################################### +install(FILES kformula.dtd DESTINATION ${DATA_INSTALL_DIR}/kformula/dtd) + +# kate: indent-width 2; replace-tabs true;
\ No newline at end of file diff --git a/lib/kformula/entities.cpp b/lib/kformula/entities.cpp index c6696e1ff..174878e33 100644 --- a/lib/kformula/entities.cpp +++ b/lib/kformula/entities.cpp @@ -1150,8 +1150,8 @@ const entityMap entities[] = { {"jscr", 0x1D4BF} , {"jsercy", 0x00458} , {"jukcy", 0x00454} , - {"kappa", 0x003BA} , - {"kappav", 0x003F0} , + {"tdeAppa", 0x003BA} , + {"tdeAppav", 0x003F0} , {"kcedil", 0x00137} , {"kcy", 0x0043A} , {"kfr", 0x1D528} , @@ -1848,7 +1848,7 @@ const entityMap entities[] = { {"therefore", 0x02234} , {"theta", 0x003B8} , {"thetav", 0x003D1} , - {"thickapprox", 0x02248} , + {"thictdeApprox", 0x02248} , {"thicksim", 0x0223C} , {"thinsp", 0x02009} , {"thkap", 0x02248} , @@ -1942,7 +1942,7 @@ const entityMap entities[] = { {"vDash", 0x022A8} , {"vangrt", 0x0299C} , {"varepsilon", 0x003B5} , - {"varkappa", 0x003F0} , + {"vartdeAppa", 0x003F0} , {"varnothing", 0x02205} , {"varphi", 0x003C6} , {"varpi", 0x003D6} , diff --git a/lib/kformula/fonts/CMakeLists.txt b/lib/kformula/fonts/CMakeLists.txt new file mode 100644 index 000000000..74379d976 --- /dev/null +++ b/lib/kformula/fonts/CMakeLists.txt @@ -0,0 +1,18 @@ +############################################################################### +# Trinity KOffice # +# --------------- # +# This file is licensed under the terms of GNU GPL v3 or later. # +# Improvements and feedback are welcome. # +############################################################################### + +### Data ###################################################################### +set(FONTDIR "${DATA_INSTALL_DIR}/kformula/fonts") +install( + FILES cmex10.ttf Arev.ttf ArevIt.ttf ArevBd.ttf ArevBI.ttf + DESTINATION ${FONTDIR} +) + +install(CODE "execute_process(COMMAND mkfontscale \$ENV{DESTDIR}${FONTDIR})") +install(CODE "execute_process(COMMAND mkfontdir \$ENV{DESTDIR}${FONTDIR})") + +# kate: indent-width 2; replace-tabs true;
\ No newline at end of file diff --git a/lib/kformula/kformulacontainer.cpp b/lib/kformula/kformulacontainer.cpp index a6123154d..5499fe915 100644 --- a/lib/kformula/kformulacontainer.cpp +++ b/lib/kformula/kformulacontainer.cpp @@ -528,7 +528,7 @@ void Container::saveMathML( TQTextStream& stream, bool oasisFormat ) { TQDomDocument doc; if ( !oasisFormat ) { - doc = document()->createMathMLDomDocument(); + doc = document()->createMathMLDomDocument(); } rootElement()->writeMathML( doc, doc, oasisFormat ); stream << doc; diff --git a/lib/kformula/kformuladocument.cpp b/lib/kformula/kformuladocument.cpp index 24d7c6504..6d954d66c 100644 --- a/lib/kformula/kformuladocument.cpp +++ b/lib/kformula/kformuladocument.cpp @@ -125,7 +125,7 @@ int Document::formulaCount() bool Document::loadXML( const TQDomDocument& doc ) { setCreationStrategy( "Ordinary" ); - + //clear(); TQDomElement root = doc.documentElement(); @@ -205,12 +205,12 @@ TQDomDocument Document::createDomDocument() */ TQDomDocument Document::createMathMLDomDocument() { - TQDomDocumentType dt = + TQDomDocumentType dt = TQDomImplementation().createDocumentType( "math", "-//W3C//DTD MathML 2.0//EN", "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd"); TQDomDocument doc( dt ); - doc.insertBefore( doc.createProcessingInstruction( "xml", + doc.insertBefore( doc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ), doc.documentElement() ); return doc; @@ -1212,10 +1212,10 @@ void DocumentWrapper::setEnabled( bool enabled ) getAddLowerLeftAction()->setEnabled( enabled ); getAddUpperRightAction()->setEnabled( enabled ); getAddLowerRightAction()->setEnabled( enabled ); - + getAddGenericUpperAction()->setEnabled( enabled ); getAddGenericLowerAction()->setEnabled( enabled ); - + if ( enabled ) { getAddGenericUpperAction()-> @@ -1277,6 +1277,7 @@ void DocumentWrapper::setEnabled( bool enabled ) void DocumentWrapper::enableMatrixActions( bool b) { + if (!m_hasActions) return; getAppendColumnAction()->setEnabled( b ); getInsertColumnAction()->setEnabled( b ); getRemoveColumnAction()->setEnabled( b ); diff --git a/lib/kformula/pics/CMakeLists.txt b/lib/kformula/pics/CMakeLists.txt new file mode 100644 index 000000000..bb28270cf --- /dev/null +++ b/lib/kformula/pics/CMakeLists.txt @@ -0,0 +1,11 @@ +############################################################################### +# Trinity KOffice # +# --------------- # +# This file is licensed under the terms of GNU GPL v3 or later. # +# Improvements and feedback are welcome. # +############################################################################### + +### Data ###################################################################### +add_subdirectory(crystalsvg) + +# kate: indent-width 2; replace-tabs true;
\ No newline at end of file diff --git a/lib/kformula/pics/crystalsvg/CMakeLists.txt b/lib/kformula/pics/crystalsvg/CMakeLists.txt new file mode 100644 index 000000000..f3304540b --- /dev/null +++ b/lib/kformula/pics/crystalsvg/CMakeLists.txt @@ -0,0 +1,11 @@ +############################################################################### +# Trinity KOffice # +# --------------- # +# This file is licensed under the terms of GNU GPL v3 or later. # +# Improvements and feedback are welcome. # +############################################################################### + +### Data ###################################################################### +tde_install_icons() + +# kate: indent-width 2; replace-tabs true;
\ No newline at end of file diff --git a/lib/kformula/unicodetable.cpp b/lib/kformula/unicodetable.cpp index 23dc8636e..faf5a3628 100644 --- a/lib/kformula/unicodetable.cpp +++ b/lib/kformula/unicodetable.cpp @@ -33,8 +33,8 @@ static UnicodeNameTable greekTable[] = { { 0x03B8, "theta" }, { 0x03D1, "vartheta" }, { 0x03B9, "iota" }, - { 0x03BA, "kappa" }, - { 0x03F0, "varkappa" }, + { 0x03BA, "tdeAppa" }, + { 0x03F0, "vartdeAppa" }, { 0x03BB, "lambda" }, { 0x03BC, "mu" }, { 0x03BD, "nu" }, |