diff --git a/Programs/TeXAndFriends/texjp/ptex/ptex/CMakeLists.txt b/Programs/TeXAndFriends/texjp/ptex/ptex/CMakeLists.txt deleted file mode 100644 index fe07029c7..000000000 --- a/Programs/TeXAndFriends/texjp/ptex/ptex/CMakeLists.txt +++ /dev/null @@ -1,110 +0,0 @@ -## CMakeLists.txt -## -## Copyright (C) 2021-2022 Christian Schenk -## -## This file is free software; the copyright holder gives -## unlimited permission to copy and/or distribute it, with or -## without modifications, as long as this notice is preserved. - -set(MIKTEX_CURRENT_FOLDER ${MIKTEX_CURRENT_FOLDER}/pTeX) - -default_char_type_is_unsigned() - -include_directories(BEFORE - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_INCLUDE_DIR} -) - -add_definitions( - -DHAVE_C4P_PRE_H - -DSYNCTEX_ENGINE_H="synctex-ptex.h" - -DTeX - -D__SyncTeX__ - -DpTeX -) - -list(APPEND C4P_FLAGS - --auto-exit-label=10 - --chars-are-unsigned - --emit-optimize-pragmas -) - -set(ptex_target_name ptex) - -include(webify.cmake) - -list(APPEND ${ptex_target_name}_sources - ${projdir}/source/ptexextra.c - ${projdir}/source/ptexextra.h -) - -set_source_files_properties( - ${projdir}/source/ptexextra.c - PROPERTIES LANGUAGE CXX -) - -list(APPEND ${ptex_target_name}_sources - ${CMAKE_CURRENT_BINARY_DIR}/ptex_pool.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/miktex-ptex.cpp -) - -list(APPEND ${ptex_target_name}_sources - ${CMAKE_CURRENT_SOURCE_DIR}/c4p_pre.h - ${CMAKE_CURRENT_SOURCE_DIR}/miktex-first.h -) - -list(APPEND ${ptex_target_name}_sources - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-common.h - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-ptex.h - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex.c - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex.h -) - -set_source_files_properties( - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex.c - PROPERTIES LANGUAGE CXX -) - -file(READ ${MIKTEX_DYN_TEX_SCRIPT} tex_dyn_sed_contents) - -if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/dyn.sed) - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dyn.sed "${tex_dyn_sed_contents}") -endif() - -set(ptex_web_file ${CMAKE_CURRENT_BINARY_DIR}/ptex-final.web) -set(ptex_header_file ${CMAKE_CURRENT_BINARY_DIR}/ptexd.h) - -create_web_app(pTeX) - -add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/ptex_pool.cpp - COMMAND - inipool - ${CMAKE_CURRENT_BINARY_DIR}/ptex.pool - miktex-ptex.h - ${ptex_progclass} - ${ptex_prog} - > ${CMAKE_CURRENT_BINARY_DIR}/ptex_pool.cpp - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY - ${CMAKE_CURRENT_BINARY_DIR}/ptex.pool - DEPENDS - inipool -) - -target_link_libraries(${ptex_target_name} - PRIVATE - ${kpsemu_dll_name} - ${w2cemu_dll_name} - ${web2c_sources_dll_name} - texjp-kanji -) -if(MIKTEX_NATIVE_WINDOWS) - target_link_libraries(${ptex_target_name} - PRIVATE - ${utf8wrap_dll_name} - ) -endif() diff --git a/Programs/TeXAndFriends/texjp/ptex/ptex/c4p_pre.h b/Programs/TeXAndFriends/texjp/ptex/ptex/c4p_pre.h deleted file mode 100644 index 940da03f8..000000000 --- a/Programs/TeXAndFriends/texjp/ptex/ptex/c4p_pre.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @file c4p_pre.h - * @author Christian Schenk - * @brief C4P first things first - * - * @copyright Copyright © 2021-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#pragma once - -#include "miktex-first.h" - -#if _MSC_VER == 1800 || _MSC_VER == 1900 -// workaround bug #2371 mathchoice in pdftex broken -# define C4P_NOOPT_mlisttohlist -#endif diff --git a/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-first.h b/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-first.h deleted file mode 100644 index 211c6195d..000000000 --- a/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-first.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @file miktex-first.h - * @author Christian Schenk - * @brief MiKTeX first things first - * - * @copyright Copyright © 2021-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#pragma once - -#if defined(MIKTEX_WINDOWS) -# define MIKTEX_UTF8_WRAP_ALL 1 -# include -#endif - -#include "miktex-ptex-version.h" diff --git a/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex-version.h b/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex-version.h deleted file mode 100644 index 7d8319eca..000000000 --- a/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex-version.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @file miktex-ptex-version.h - * @author Christian Schenk - * @brief Version number - * - * @copyright Copyright © 2021-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#define MIKTEX_COMP_MAJOR_VERSION 1 -#define MIKTEX_COMP_MINOR_VERSION 5 -#define MIKTEX_COMP_PATCH_VERSION 0 - -#define MIKTEX_COMP_ID "miktex-ptex" - -#define MIKTEX_COMP_ORIG_VERSION_STR "3.141592653-p4.1.0" - -#define MIKTEX_COMP_COPYRIGHT_STR "" - -#include diff --git a/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex.cpp b/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex.cpp deleted file mode 100644 index c4fc9383b..000000000 --- a/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @file miktex-ptex.cpp - * @author Christian Schenk - * @brief MiKTeX pTeX - * - * @copyright Copyright © 2021-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#define MIKTEX_PTEX_CPP -#include "miktex-ptex.h" diff --git a/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex.h b/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex.h deleted file mode 100644 index 80360520c..000000000 --- a/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex.h +++ /dev/null @@ -1,154 +0,0 @@ -/** - * @file miktex-ptex.h - * @author Christian Schenk - * @brief MiKTeX pTeX - * - * @copyright Copyright © 2021-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#pragma once - -#include "miktex-ptex-config.h" - -#if defined(MIKTEX_WINDOWS) -# define MIKTEX_UTF8_WRAP_ALL 1 -# include -#endif - -#include - -#include "miktex-ptex-version.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ptexd.h" - -#include "texmfmp.h" - -#include - -extern PTEXPROGCLASS PTEXPROG; - -class PTEXAPPCLASS : - public MiKTeX::TeXjp::TeXEngineBase -{ - -public: - - void Init(std::vector& args) override - { - SetCharacterConverter(&charConv); - SetErrorHandler(&errorHandler); - SetFormatHandler(&formatHandler); - SetInitFinalize(&initFinalize); - SetInputOutput(&inputOutput); - SetStringHandler(&stringHandler); - SetTeXMFMemoryHandler(&memoryHandler); - TeXApp::Init(args); - IAm(MiKTeX::TeXAndFriends::TeXjpEngine); - kpse_set_program_name(args[0], nullptr); - InitKanji(); - EnableFeature(MiKTeX::TeXAndFriends::Feature::EightBitChars); - EnableFeature(MiKTeX::TeXAndFriends::Feature::TCX); - } - - void AllocateMemory() override - { - TeXApp::AllocateMemory(); - } - - void FreeMemory() override - { - TeXApp::FreeMemory(); - } - - MiKTeX::Util::PathName GetMemoryDumpFileName() const override - { - return MiKTeX::Util::PathName("ptex.fmt"); - } - - std::string GetInitProgramName() const override - { - return "iniptex"; - } - - std::string GetVirginProgramName() const override - { - return "virptex"; - } - - std::string TheNameOfTheGame() const override - { - return "pTeX"; - } - -private: - - MiKTeX::TeXAndFriends::CharacterConverterImpl charConv{ PTEXPROG }; - MiKTeX::TeXAndFriends::ErrorHandlerImpl errorHandler{ PTEXPROG }; - MiKTeX::TeXAndFriends::FormatHandlerImpl formatHandler{ PTEXPROG }; - MiKTeX::TeXAndFriends::InitFinalizeImpl initFinalize{ PTEXPROG }; - MiKTeX::TeXAndFriends::StringHandlerImpl stringHandler{ PTEXPROG }; - MiKTeX::TeXjp::PTeXInputOutputImpl, PTEXPROGCLASS> inputOutput{ PTEXPROG }; - MiKTeX::TeXjp::PTeXMemoryHandlerImpl, PTEXPROGCLASS> memoryHandler{ PTEXPROG, *this }; -}; - -int miktexloadpoolstrings(int size); - -inline int loadpoolstrings(int size) -{ - return miktexloadpoolstrings(size); -} - -extern PTEXAPPCLASS PTEXAPP; - -inline char* gettexstring(PTEXPROGCLASS::strnumber stringNumber) -{ - return xstrdup(PTEXAPP.GetTeXString(stringNumber).c_str()); -} - -inline void miktexreallocatenameoffile(size_t n) -{ - PTEXPROG.nameoffile = reinterpret_cast(PTEXAPP.GetTeXMFMemoryHandler()->ReallocateArray("name_of_file", PTEXPROG.nameoffile, sizeof(*PTEXPROG.nameoffile), n, MIKTEX_SOURCE_LOCATION())); -} - -#if defined(MIKTEX_PTEX_CPP) -#define PTEX_PROG_VAR2(alias, name, type) type& alias = PTEXPROG.name -#define PTEX_PROG_VAR(name, type) type& name = PTEXPROG.name -#else -#define PTEX_PROG_VAR2(alias, name, type) extern type& alias -#define PTEX_PROG_VAR(name, type) extern type& name -#endif - -PTEX_PROG_VAR(curh, PTEXPROGCLASS::scaled); -PTEX_PROG_VAR(curinput, PTEXPROGCLASS::instaterecord); -PTEX_PROG_VAR(curv, PTEXPROGCLASS::scaled); -PTEX_PROG_VAR(eqtb, PTEXPROGCLASS::memoryword*); -PTEX_PROG_VAR(jobname, PTEXPROGCLASS::strnumber); -PTEX_PROG_VAR(ruledp, PTEXPROGCLASS::scaled); -PTEX_PROG_VAR(ruleht, PTEXPROGCLASS::scaled); -PTEX_PROG_VAR(rulewd, PTEXPROGCLASS::scaled); -PTEX_PROG_VAR(termoffset, C4P::C4P_integer); -PTEX_PROG_VAR(totalpages, C4P::C4P_integer); -PTEX_PROG_VAR(zmem, PTEXPROGCLASS::memoryword*); -PTEX_PROG_VAR2(texmflogname, logname, PTEXPROGCLASS::strnumber); - -using halfword = PTEXPROGCLASS::halfword; - -#if WITH_SYNCTEX -PTEX_PROG_VAR(synctexoffset, C4P::C4P_integer); -PTEX_PROG_VAR(synctexoption, C4P::C4P_integer); -#include "synctex.h" -#endif diff --git a/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex.rc.in b/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex.rc.in deleted file mode 100644 index 4e3582b72..000000000 --- a/Programs/TeXAndFriends/texjp/ptex/ptex/miktex-ptex.rc.in +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @file miktex-ptex.rc - * @author Christian Schenk - * @brief Windows resources - * - * @copyright Copyright © 1991-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#pragma code_page(65001) - -#include "miktex-ptex-version.h" - -#define VER_FILEDESCRIPTION_STR "pTeX - a document compiler intended to produce typesetting Japanese of high quality" -#define VER_INTERNALNAME_STR "ptex" -#define VER_ORIGINALFILENAME_STR "miktex-ptex.exe" - -#include "miktex/win/version.rc" diff --git a/Programs/TeXAndFriends/texjp/ptex/ptex/webify.cmake b/Programs/TeXAndFriends/texjp/ptex/ptex/webify.cmake deleted file mode 100644 index a53232250..000000000 --- a/Programs/TeXAndFriends/texjp/ptex/ptex/webify.cmake +++ /dev/null @@ -1,123 +0,0 @@ -## webify.cmake -## -## Copyright (C) 2021-2022 Christian Schenk -## -## This file is free software; the copyright holder gives -## unlimited permission to copy and/or distribute it, with or -## without modifications, as long as this notice is preserved. - -set(tex_miktex_change_files - ${MIKTEX_TEX_MLTEX_CH} - ${MIKTEX_TEX_CONSTANTS_CH} - ${MIKTEX_TEX_CH} - ${MIKTEX_TEX_HASH_CH} - ${MIKTEX_TEX_HYPH_CH} - ${MIKTEX_TEX_POOL_CH} - ${MIKTEX_TEX_QUIET_CH} - ${MIKTEX_TEX_SRC_CH} - ${MIKTEX_TEX_STAT_CH} - ${MIKTEX_TEX_WRITE18_CH} - ${TRACINGSTACKLEVELS_CH} - ${PARTOKEN_CH} - ${MIKTEX_TEX_WEB2C_CH} - ${MIKTEX_TEX_FINISH_CH} -) - -set(ptex_ch_synctex - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-def.ch0 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-p-mem.ch0 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-mem.ch0 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-p-mem.ch1 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-p-rec.ch0 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-rec.ch0 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-rec.ch1 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-rec.ch2 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-p-rec.ch1 -) - -add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/miktex-tex.web - COMMAND - ${MIKTEX_PREFIX}tie - -m ${CMAKE_CURRENT_BINARY_DIR}/miktex-tex.web - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_TEX_DIR}/source/tex.web - ${tex_miktex_change_files} - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_TEX_DIR}/source/tex.web - DEPENDS - ${MIKTEX_PREFIX}tie - ${tex_miktex_change_files} - VERBATIM -) - -list(APPEND web_files ${CMAKE_CURRENT_BINARY_DIR}/miktex-tex.web) - -add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/pre-ptex.web - COMMAND - ${MIKTEX_PREFIX}tie - -m ${CMAKE_CURRENT_BINARY_DIR}/pre-ptex.web - ${CMAKE_CURRENT_BINARY_DIR}/miktex-tex.web - ${CMAKE_CURRENT_SOURCE_DIR}/miktex-ptex-adapter.ch - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY - ${CMAKE_CURRENT_BINARY_DIR}/miktex-tex.web - DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/miktex-ptex-adapter.ch - ${MIKTEX_PREFIX}tie - VERBATIM -) - -list(APPEND web_files ${CMAKE_CURRENT_BINARY_DIR}/pre-ptex.web) - -add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/ptex-final.web - COMMAND - ${MIKTEX_PREFIX}tie - -m ${CMAKE_CURRENT_BINARY_DIR}/ptex-final.web - ${CMAKE_CURRENT_BINARY_DIR}/pre-ptex.web - ${projdir}/source/ptex-base.ch - ${ptex_ch_synctex} - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY - ${CMAKE_CURRENT_BINARY_DIR}/pre-ptex.web - DEPENDS - ${MIKTEX_PREFIX}tie - ${projdir}/source/ptex-base.ch - ${ptex_ch_synctex} - VERBATIM -) - -list(APPEND web_files ${CMAKE_CURRENT_BINARY_DIR}/ptex-final.web) - -# Last but not least: developer's convenience - -foreach(_path ${web_files}) - get_filename_component(_name ${_path} NAME_WE) - set(_out ${CMAKE_CURRENT_BINARY_DIR}/${_name}-n.web) - add_custom_command( - OUTPUT - ${_out} - COMMAND - web-n < ${_path} > ${_out} - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY - ${_path} - DEPENDS - web-n - VERBATIM - ) - list(APPEND web_n_files ${_out}) -endforeach() - -add_custom_target(ptex-dev ALL DEPENDS ${web_n_files}) - -set_property(TARGET ptex-dev PROPERTY FOLDER ${MIKTEX_CURRENT_FOLDER}) diff --git a/Programs/TeXAndFriends/texjp/uptex/uptex/CMakeLists.txt b/Programs/TeXAndFriends/texjp/uptex/uptex/CMakeLists.txt deleted file mode 100644 index f440b4f43..000000000 --- a/Programs/TeXAndFriends/texjp/uptex/uptex/CMakeLists.txt +++ /dev/null @@ -1,110 +0,0 @@ -## CMakeLists.txt -## -## Copyright (C) 2021-2022 Christian Schenk -## -## This file is free software; the copyright holder gives -## unlimited permission to copy and/or distribute it, with or -## without modifications, as long as this notice is preserved. - -set(MIKTEX_CURRENT_FOLDER ${MIKTEX_CURRENT_FOLDER}/upTeX) - -default_char_type_is_unsigned() - -include_directories(BEFORE - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_INCLUDE_DIR} -) - -add_definitions( - -DHAVE_C4P_PRE_H - -DSYNCTEX_ENGINE_H="synctex-uptex.h" - -DTeX - -D__SyncTeX__ - -DupTeX -) - -list(APPEND C4P_FLAGS - --auto-exit-label=10 - --chars-are-unsigned - --emit-optimize-pragmas -) - -set(uptex_target_name uptex) - -include(webify.cmake) - -list(APPEND ${uptex_target_name}_sources - ${projdir}/source/uptexextra.c - ${projdir}/source/uptexextra.h -) - -set_source_files_properties( - ${projdir}/source/uptexextra.c - PROPERTIES LANGUAGE CXX -) - -list(APPEND ${uptex_target_name}_sources - ${CMAKE_CURRENT_BINARY_DIR}/uptex_pool.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/miktex-uptex.cpp -) - -list(APPEND ${uptex_target_name}_sources - ${CMAKE_CURRENT_SOURCE_DIR}/c4p_pre.h - ${CMAKE_CURRENT_SOURCE_DIR}/miktex-first.h -) - -list(APPEND ${uptex_target_name}_sources - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-common.h - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-uptex.h - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex.c - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex.h -) - -set_source_files_properties( - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex.c - PROPERTIES LANGUAGE CXX -) - -file(READ ${MIKTEX_DYN_TEX_SCRIPT} tex_dyn_sed_contents) - -if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/dyn.sed) - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dyn.sed "${tex_dyn_sed_contents}") -endif() - -set(uptex_web_file ${CMAKE_CURRENT_BINARY_DIR}/uptex-final.web) -set(uptex_header_file ${CMAKE_CURRENT_BINARY_DIR}/uptexd.h) - -create_web_app(upTeX) - -add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/uptex_pool.cpp - COMMAND - inipool - ${CMAKE_CURRENT_BINARY_DIR}/uptex.pool - miktex-uptex.h - ${uptex_progclass} - ${uptex_prog} - > ${CMAKE_CURRENT_BINARY_DIR}/uptex_pool.cpp - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY - ${CMAKE_CURRENT_BINARY_DIR}/uptex.pool - DEPENDS - inipool -) - -target_link_libraries(${uptex_target_name} - PRIVATE - ${kpsemu_dll_name} - ${w2cemu_dll_name} - ${web2c_sources_dll_name} - texjp-ukanji -) -if(MIKTEX_NATIVE_WINDOWS) - target_link_libraries(${uptex_target_name} - PRIVATE - ${utf8wrap_dll_name} - ) -endif() diff --git a/Programs/TeXAndFriends/texjp/uptex/uptex/c4p_pre.h b/Programs/TeXAndFriends/texjp/uptex/uptex/c4p_pre.h deleted file mode 100644 index 940da03f8..000000000 --- a/Programs/TeXAndFriends/texjp/uptex/uptex/c4p_pre.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @file c4p_pre.h - * @author Christian Schenk - * @brief C4P first things first - * - * @copyright Copyright © 2021-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#pragma once - -#include "miktex-first.h" - -#if _MSC_VER == 1800 || _MSC_VER == 1900 -// workaround bug #2371 mathchoice in pdftex broken -# define C4P_NOOPT_mlisttohlist -#endif diff --git a/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-first.h b/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-first.h deleted file mode 100644 index b0d81aacf..000000000 --- a/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-first.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @file miktex-first.h - * @author Christian Schenk - * @brief MiKTeX first things first - * - * @copyright Copyright © 2021-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#pragma once - -#if defined(MIKTEX_WINDOWS) -# define MIKTEX_UTF8_WRAP_ALL 1 -# include -#endif - -#include "miktex-uptex-version.h" diff --git a/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex-version.h b/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex-version.h deleted file mode 100644 index 3b6220468..000000000 --- a/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex-version.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @file miktex-uptex-version.h - * @author Christian Schenk - * @brief Version number - * - * @copyright Copyright © 2021-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#define MIKTEX_COMP_MAJOR_VERSION 1 -#define MIKTEX_COMP_MINOR_VERSION 5 -#define MIKTEX_COMP_PATCH_VERSION 0 - -#define MIKTEX_COMP_ID "miktex-uptex" - -#define MIKTEX_COMP_ORIG_VERSION_STR "1.29" - -#define MIKTEX_COMP_COPYRIGHT_STR "" - -#include diff --git a/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex.cpp b/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex.cpp deleted file mode 100644 index 803499b1d..000000000 --- a/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @file miktex-uptex.cpp - * @author Christian Schenk - * @brief MiKTeX upTeX - * - * @copyright Copyright © 2021-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#define MIKTEX_UPTEX_CPP -#include "miktex-uptex.h" diff --git a/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex.h b/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex.h deleted file mode 100644 index e349a72a5..000000000 --- a/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex.h +++ /dev/null @@ -1,155 +0,0 @@ -/** - * @file miktex-uptex.h - * @author Christian Schenk - * @brief MiKTeX upTeX - * - * @copyright Copyright © 2021-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#pragma once - -#include "miktex-uptex-config.h" - -#if defined(MIKTEX_WINDOWS) -# define MIKTEX_UTF8_WRAP_ALL 1 -# include -#endif - -#include - -#include "miktex-uptex-version.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "uptexd.h" - -#include "texmfmp.h" - -#include - -extern UPTEXPROGCLASS UPTEXPROG; - -class UPTEXAPPCLASS : - public MiKTeX::TeXjp::TeXEngineBase -{ - -public: - - void Init(std::vector& args) override - { - SetCharacterConverter(&charConv); - SetErrorHandler(&errorHandler); - SetFormatHandler(&formatHandler); - SetInitFinalize(&initFinalize); - SetInputOutput(&inputOutput); - SetStringHandler(&stringHandler); - SetTeXMFMemoryHandler(&memoryHandler); - TeXApp::Init(args); - IAm(MiKTeX::TeXAndFriends::TeXjpEngine); - kpse_set_program_name(args[0], nullptr); - InitKanji(); - EnableFeature(MiKTeX::TeXAndFriends::Feature::EightBitChars); - EnableFeature(MiKTeX::TeXAndFriends::Feature::TCX); - } - - void AllocateMemory() override - { - TeXApp::AllocateMemory(); - } - - void FreeMemory() override - { - TeXApp::FreeMemory(); - } - - MiKTeX::Util::PathName GetMemoryDumpFileName() const override - { - return MiKTeX::Util::PathName("uptex.fmt"); - } - - std::string GetInitProgramName() const override - { - return "iniuptex"; - } - - std::string GetVirginProgramName() const override - { - return "viruptex"; - } - - std::string TheNameOfTheGame() const override - { - return "upTeX"; - } - -private: - - MiKTeX::TeXAndFriends::CharacterConverterImpl charConv{ UPTEXPROG }; - MiKTeX::TeXAndFriends::ErrorHandlerImpl errorHandler{ UPTEXPROG }; - MiKTeX::TeXAndFriends::FormatHandlerImpl formatHandler{ UPTEXPROG }; - MiKTeX::TeXAndFriends::InitFinalizeImpl initFinalize{ UPTEXPROG }; - MiKTeX::TeXAndFriends::StringHandlerImpl stringHandler{ UPTEXPROG }; - MiKTeX::TeXjp::PTeXInputOutputImpl, UPTEXPROGCLASS> inputOutput{ UPTEXPROG }; - MiKTeX::TeXjp::PTeXMemoryHandlerImpl, UPTEXPROGCLASS> memoryHandler{ UPTEXPROG, *this }; - -}; - -int miktexloadpoolstrings(int size); - -inline int loadpoolstrings(int size) -{ - return miktexloadpoolstrings(size); -} - -extern UPTEXAPPCLASS UPTEXAPP; - -inline char* gettexstring(UPTEXPROGCLASS::strnumber stringNumber) -{ - return xstrdup(UPTEXAPP.GetTeXString(stringNumber).c_str()); -} - -inline void miktexreallocatenameoffile(size_t n) -{ - UPTEXPROG.nameoffile = reinterpret_cast(UPTEXAPP.GetTeXMFMemoryHandler()->ReallocateArray("name_of_file", UPTEXPROG.nameoffile, sizeof(*UPTEXPROG.nameoffile), n, MIKTEX_SOURCE_LOCATION())); -} - -#if defined(MIKTEX_UPTEX_CPP) -#define UPTEX_PROG_VAR2(alias, name, type) type& alias = UPTEXPROG.name -#define UPTEX_PROG_VAR(name, type) type& name = UPTEXPROG.name -#else -#define UPTEX_PROG_VAR2(alias, name, type) extern type& alias -#define UPTEX_PROG_VAR(name, type) extern type& name -#endif - -UPTEX_PROG_VAR(curh, UPTEXPROGCLASS::scaled); -UPTEX_PROG_VAR(curinput, UPTEXPROGCLASS::instaterecord); -UPTEX_PROG_VAR(curv, UPTEXPROGCLASS::scaled); -UPTEX_PROG_VAR(eqtb, UPTEXPROGCLASS::memoryword*); -UPTEX_PROG_VAR(jobname, UPTEXPROGCLASS::strnumber); -UPTEX_PROG_VAR(ruledp, UPTEXPROGCLASS::scaled); -UPTEX_PROG_VAR(ruleht, UPTEXPROGCLASS::scaled); -UPTEX_PROG_VAR(rulewd, UPTEXPROGCLASS::scaled); -UPTEX_PROG_VAR(termoffset, C4P::C4P_integer); -UPTEX_PROG_VAR(totalpages, C4P::C4P_integer); -UPTEX_PROG_VAR(zmem, UPTEXPROGCLASS::memoryword*); -UPTEX_PROG_VAR2(texmflogname, logname, UPTEXPROGCLASS::strnumber); - -using halfword = UPTEXPROGCLASS::halfword; - -#if WITH_SYNCTEX -UPTEX_PROG_VAR(synctexoffset, C4P::C4P_integer); -UPTEX_PROG_VAR(synctexoption, C4P::C4P_integer); -#include "synctex.h" -#endif diff --git a/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex.rc.in b/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex.rc.in deleted file mode 100644 index b60b41d8c..000000000 --- a/Programs/TeXAndFriends/texjp/uptex/uptex/miktex-uptex.rc.in +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @file miktex-uptex.rc - * @author Christian Schenk - * @brief Windows resources - * - * @copyright Copyright © 1991-2022 Christian Schenk - * - * This file is free software; the copyright holder gives unlimited permission - * to copy and/or distribute it, with or without modifications, as long as this - * notice is preserved. - */ - -#pragma code_page(65001) - -#include "miktex-uptex-version.h" - -#define VER_FILEDESCRIPTION_STR "upTeX - a document compiler intended to produce typesetting Japanese of high quality" -#define VER_INTERNALNAME_STR "uptex" -#define VER_ORIGINALFILENAME_STR "miktex-uptex.exe" - -#include "miktex/win/version.rc" diff --git a/Programs/TeXAndFriends/texjp/uptex/uptex/webify.cmake b/Programs/TeXAndFriends/texjp/uptex/uptex/webify.cmake deleted file mode 100644 index 2544d424d..000000000 --- a/Programs/TeXAndFriends/texjp/uptex/uptex/webify.cmake +++ /dev/null @@ -1,147 +0,0 @@ -## webify.cmake -## -## Copyright (C) 2021-2022 Christian Schenk -## -## This file is free software; the copyright holder gives -## unlimited permission to copy and/or distribute it, with or -## without modifications, as long as this notice is preserved. - -set(tex_miktex_change_files - ${MIKTEX_TEX_MLTEX_CH} - ${MIKTEX_TEX_CONSTANTS_CH} - ${MIKTEX_TEX_CH} - ${MIKTEX_TEX_HASH_CH} - ${MIKTEX_TEX_HYPH_CH} - ${MIKTEX_TEX_POOL_CH} - ${MIKTEX_TEX_QUIET_CH} - ${MIKTEX_TEX_SRC_CH} - ${MIKTEX_TEX_STAT_CH} - ${MIKTEX_TEX_WRITE18_CH} - ${TRACINGSTACKLEVELS_CH} - ${PARTOKEN_CH} - ${MIKTEX_TEX_WEB2C_CH} - ${MIKTEX_TEX_FINISH_CH} -) - -set(uptex_ch_synctex - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-def.ch0 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-p-mem.ch0 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-mem.ch0 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-p-mem.ch1 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-p-rec.ch0 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-rec.ch0 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-rec.ch1 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-rec.ch2 - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_SYNCTEX_SOURCE_DIR}/synctex-p-rec.ch1 -) - -add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/miktex-tex.web - COMMAND - ${MIKTEX_PREFIX}tie - -m ${CMAKE_CURRENT_BINARY_DIR}/miktex-tex.web - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_TEX_DIR}/source/tex.web - ${tex_miktex_change_files} - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_TEX_DIR}/source/tex.web - DEPENDS - ${MIKTEX_PREFIX}tie - ${tex_miktex_change_files} - VERBATIM -) - -list(APPEND web_files ${CMAKE_CURRENT_BINARY_DIR}/miktex-tex.web) - -add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/miktex-ptex.web - COMMAND - ${MIKTEX_PREFIX}tie - -m ${CMAKE_CURRENT_BINARY_DIR}/miktex-ptex.web - ${CMAKE_CURRENT_BINARY_DIR}/miktex-tex.web - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_PTEX_DIR}/ptex/miktex-ptex-adapter.ch - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_PTEX_DIR}/source/ptex-base.ch - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY - ${CMAKE_CURRENT_BINARY_DIR}/miktex-tex.web - DEPENDS - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_PTEX_DIR}/ptex/miktex-ptex-adapter.ch - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_PTEX_DIR}/source/ptex-base.ch - ${MIKTEX_PREFIX}tie - VERBATIM -) - -list(APPEND web_files ${CMAKE_CURRENT_BINARY_DIR}/miktex-ptex.web) - -add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/pre-uptex.web - COMMAND - ${MIKTEX_PREFIX}tie - -m ${CMAKE_CURRENT_BINARY_DIR}/pre-uptex.web - ${CMAKE_CURRENT_BINARY_DIR}/miktex-ptex.web - ${CMAKE_CURRENT_SOURCE_DIR}/miktex-uptex-adapter.ch - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY - ${CMAKE_CURRENT_BINARY_DIR}/miktex-ptex.web - DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/miktex-uptex-adapter.ch - ${MIKTEX_PREFIX}tie - VERBATIM -) - -list(APPEND web_files ${CMAKE_CURRENT_BINARY_DIR}/pre-uptex.web) - -add_custom_command( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/uptex-final.web - COMMAND - ${MIKTEX_PREFIX}tie - -m ${CMAKE_CURRENT_BINARY_DIR}/uptex-final.web - ${CMAKE_CURRENT_BINARY_DIR}/pre-uptex.web - ${projdir}/source/uptex-m.ch - ${uptex_ch_synctex} - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_PTEX_DIR}/ptex/miktex-ptex.ch - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY - ${CMAKE_CURRENT_BINARY_DIR}/pre-uptex.web - DEPENDS - ${CMAKE_SOURCE_DIR}/${MIKTEX_REL_PTEX_DIR}/ptex/miktex-ptex.ch - ${MIKTEX_PREFIX}tie - ${projdir}/source/uptex-m.ch - ${uptex_ch_synctex} - VERBATIM -) - -list(APPEND web_files ${CMAKE_CURRENT_BINARY_DIR}/uptex-final.web) - -# Last but not least: developer's convenience - -foreach(_path ${web_files}) - get_filename_component(_name ${_path} NAME_WE) - set(_out ${CMAKE_CURRENT_BINARY_DIR}/${_name}-n.web) - add_custom_command( - OUTPUT - ${_out} - COMMAND - web-n < ${_path} > ${_out} - WORKING_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY - ${_path} - DEPENDS - web-n - VERBATIM - ) - list(APPEND web_n_files ${_out}) -endforeach() - -add_custom_target(uptex-dev ALL DEPENDS ${web_n_files}) - -set_property(TARGET uptex-dev PROPERTY FOLDER ${MIKTEX_CURRENT_FOLDER})