mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-26 15:14:13 +08:00
plugins
This commit is contained in:
parent
26875c6421
commit
0c0d6c0132
31
.gitignore
vendored
31
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
LunaTranslator/transkiroku
|
||||
LunaTranslator/userconfig
|
||||
|
||||
lunatranslator/cache
|
||||
@ -21,38 +20,14 @@ Thumbs.db
|
||||
*.recipe
|
||||
*.wav
|
||||
build/
|
||||
LunaTranslator/testapi.py
|
||||
|
||||
|
||||
plugins/winsharedutils/Release
|
||||
plugins/winsharedutils/x64
|
||||
plugins/winsharedutils/.vs
|
||||
plugins/winsharedutils/builds
|
||||
plugins/winsharedutils/build
|
||||
plugins/winrtutils/builds
|
||||
plugins/winrtutils/build
|
||||
plugins/builds
|
||||
plugins/build
|
||||
|
||||
LunaTranslator/files/plugins/Magpie_v0.9.1/cache
|
||||
|
||||
|
||||
plugins/exec/.vs
|
||||
plugins/exec/out
|
||||
plugins/exec/builds
|
||||
|
||||
plugins/shareddllproxy/Release
|
||||
plugins/shareddllproxy/out
|
||||
plugins/shareddllproxy/builds
|
||||
plugins/shareddllproxy/.vs
|
||||
|
||||
|
||||
plugins/winxp_proxy_host/build
|
||||
plugins/winxp_proxy_host/builds
|
||||
|
||||
LunaTranslator/files/plugins
|
||||
LunaTranslator/files/ocr
|
||||
LunaTranslator/files/data
|
||||
LunaTranslator/chrome_cache
|
||||
|
||||
plugins/winrtsnapshot/Release
|
||||
plugins/winrtsnapshot/x64
|
||||
plugins/winrtsnapshot/.vs
|
||||
plugins/.vscode/settings.json
|
||||
|
@ -10,7 +10,7 @@ import os
|
||||
import gobject
|
||||
class ocrwrapper:
|
||||
def __init__(self) -> None:
|
||||
self.dll=CDLL(gobject.GetDllpath(('ocr32.dll','ocr64.dll')))
|
||||
self.dll=CDLL(gobject.GetDllpath(('LunaOCR32.dll','LunaOCR64.dll')))
|
||||
def _OcrInit(self,szDetModel, szRecModel, szKeyPath,szClsModel='', nThreads=4):
|
||||
|
||||
_OcrInit=self.dll.OcrInit
|
||||
|
@ -282,7 +282,7 @@
|
||||
"64":[
|
||||
"./files/plugins/DLL64/winsharedutils64.dll",
|
||||
"./files/plugins/DLL64/winrtutils64.dll",
|
||||
"./files/plugins/DLL64/ocr64.dll",
|
||||
"./files/plugins/DLL64/LunaOCR64.dll",
|
||||
"./files/plugins/DLL64/libmecab.dll",
|
||||
"./files/plugins/DLL64/libcurl-x64.dll",
|
||||
"./files/plugins/DLL64/LunaHost64.dll"
|
||||
@ -290,7 +290,7 @@
|
||||
"32":[
|
||||
"./files/plugins/DLL32/winsharedutils32.dll",
|
||||
"./files/plugins/DLL32/winrtutils32.dll",
|
||||
"./files/plugins/DLL32/ocr32.dll",
|
||||
"./files/plugins/DLL32/LunaOCR32.dll",
|
||||
"./files/plugins/DLL32/libmecab.dll",
|
||||
"./files/plugins/DLL32/libcurl.dll",
|
||||
"./files/plugins/DLL32/LunaHost32.dll"
|
||||
|
@ -5,14 +5,14 @@ x86=int(sys.argv[1])
|
||||
if x86:
|
||||
nuitkadist=r'..\build\x86\LunaTranslator_main.dist'
|
||||
targetdir=r'..\build\LunaTranslator_x86'
|
||||
launch=r'..\plugins\exec\builds\_x86'
|
||||
launch=r'..\plugins\builds\_x86'
|
||||
downlevel=f'C:\Windows\SysWOW64\downlevel'
|
||||
target='LunaTranslator_x86.zip'
|
||||
baddll='DLL64'
|
||||
else:
|
||||
baddll='DLL32'
|
||||
target='LunaTranslator.zip'
|
||||
launch=r'..\plugins\exec\builds\_x64'
|
||||
launch=r'..\plugins\builds\_x64'
|
||||
nuitkadist=r'..\build\x64\LunaTranslator_main.dist'
|
||||
targetdir=r'..\build\LunaTranslator'
|
||||
downlevel=f'C:\Windows\system32\downlevel'
|
||||
@ -30,7 +30,8 @@ def get_import_table(file_path):
|
||||
if os.path.exists(targetdir):
|
||||
shutil.rmtree(targetdir)
|
||||
shutil.copytree(nuitkadist,targetdir_in)
|
||||
shutil.copytree(launch,targetdir,dirs_exist_ok=True)
|
||||
for f in ['LunaTranslator_admin.exe','LunaTranslator.exe']:
|
||||
shutil.copy(os.path.join(launch,f),targetdir)
|
||||
shutil.copytree(r'.\files',rf'{targetdir}\files')
|
||||
shutil.copy(r'..\LICENSE',targetdir)
|
||||
|
||||
|
31
plugins/CMakeLists.txt
Normal file
31
plugins/CMakeLists.txt
Normal file
@ -0,0 +1,31 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(LunaPlugins)
|
||||
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
add_compile_options(
|
||||
/std:c++17
|
||||
/MP
|
||||
/wd4018
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
)
|
||||
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x64)
|
||||
else()
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x86)
|
||||
endif()
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
|
||||
include(libs/libs.cmake)
|
||||
|
||||
add_subdirectory(exec)
|
||||
add_subdirectory(shareddllproxy)
|
||||
add_subdirectory(winrtutils)
|
||||
add_subdirectory(winsharedutils)
|
||||
|
@ -1,26 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(LUNA)
|
||||
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
add_compile_options(
|
||||
/std:c++17
|
||||
/MP
|
||||
/wd4018
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
)
|
||||
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x64)
|
||||
else()
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x86)
|
||||
endif()
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
|
||||
add_executable(LunaTranslator luna.cpp luna.rc)
|
||||
#target_link_options(LunaTranslator PRIVATE /MANIFESTUAC:level="asInvoker")
|
||||
|
@ -1,2 +0,0 @@
|
||||
cmake ./CMakeLists.txt -G "Visual Studio 15 2017" -A win32 -T v141_xp -B ./build
|
||||
cmake --build ./build --config Release --target ALL_BUILD -j 14
|
88
plugins/libs/VC-LTL helper for cmake.cmake
Normal file
88
plugins/libs/VC-LTL helper for cmake.cmake
Normal file
@ -0,0 +1,88 @@
|
||||
cmake_minimum_required(VERSION 3.5.2)
|
||||
|
||||
#
|
||||
# VC-LTL自动化加载配置,建议你将此文件单独复制到你的工程再使用,该文件能自动识别当前环境是否存在VC-LTL,并且自动应用。
|
||||
#
|
||||
# 使用方法:
|
||||
# 1. 在“CMakeLists.txt” 添加 “include("VC-LTL helper for cmake.cmake")”。
|
||||
#
|
||||
# VC-LTL默认搜索顺序
|
||||
# 1. “VC-LTL helper for cmake.cmake”所在根目录,即 ${CMAKE_CURRENT_LIST_DIR}
|
||||
# 2. 当前CMake根目录,即 ${CMAKE_CURRENT_SOURCE_DIR}/VC-LTL
|
||||
# 3. 当前项目根目录,即 ${PROJECT_SOURCE_DIR}/VC-LTL
|
||||
# 4. 当前CMake父目录,即 ${CMAKE_CURRENT_SOURCE_DIR}/../VC-LTL
|
||||
# 5. 当前项目根目录,即 ${PROJECT_SOURCE_DIR}/../VC-LTL
|
||||
# 6. 注册表HKEY_CURRENT_USER\Code\VC-LTL@Root
|
||||
#
|
||||
# 把VC-LTL放在其中一个位置即可,VC-LTL就能被自动引用。
|
||||
#
|
||||
# 如果你对默认搜索顺序不满,你可以修改此文件。你也可以直接指定${VC_LTL_Root}宏更加任性的去加载VC-LTL。
|
||||
#
|
||||
|
||||
|
||||
|
||||
|
||||
#####################################################################VC-LTL设置#####################################################################
|
||||
|
||||
#控制TargetPlatform版本,目前可用版本为5.1.2600.0 6.0.6000.0(默认) 6.2.9200.0 10.0.10240.0 10.0.19041.0
|
||||
#set(WindowsTargetPlatformMinVersion "10.0.10240.0")
|
||||
|
||||
#启用干净的导入表,消除 ucrt apiset(如:api-ms-win-crt-time-l1-1-0.dll),满足强迫症患者。
|
||||
#set(CleanImport "true")
|
||||
|
||||
####################################################################################################################################################
|
||||
|
||||
if(NOT VC_LTL_Root)
|
||||
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/_msvcrt.h)
|
||||
set(VC_LTL_Root ${CMAKE_CURRENT_LIST_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT VC_LTL_Root)
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/VC-LTL/_msvcrt.h)
|
||||
set(VC_LTL_Root ${CMAKE_CURRENT_SOURCE_DIR}/VC-LTL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT VC_LTL_Root)
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/VC-LTL/_msvcrt.h)
|
||||
set(VC_LTL_Root ${PROJECT_SOURCE_DIR}/VC-LTL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT VC_LTL_Root)
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../VC-LTL/_msvcrt.h)
|
||||
set(VC_LTL_Root ${CMAKE_CURRENT_SOURCE_DIR}/../VC-LTL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT VC_LTL_Root)
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/../VC-LTL/_msvcrt.h)
|
||||
set(VC_LTL_Root ${PROJECT_SOURCE_DIR}/../VC-LTL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT VC_LTL_Root)
|
||||
EXECUTE_PROCESS(COMMAND reg query "HKEY_CURRENT_USER\\Code\\VC-LTL" -v "Root"
|
||||
OUTPUT_VARIABLE FOUND_FILE
|
||||
ERROR_VARIABLE ERROR_INFO
|
||||
)
|
||||
|
||||
string(REGEX MATCH "[a-zA-Z]:\\\\.+\\\\"
|
||||
FOUND_LTL
|
||||
${FOUND_FILE})
|
||||
if (NOT ${FOUND_LTL} STREQUAL "")
|
||||
set(VC_LTL_Root ${FOUND_LTL})
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED VC_LTL_Root)
|
||||
string(REGEX MATCH "\\\\\\\\.+\\\\" FOUND_LTL ${FOUND_FILE})
|
||||
if (NOT ${FOUND_LTL} STREQUAL "")
|
||||
set(VC_LTL_Root ${FOUND_LTL})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(VC_LTL_Root)
|
||||
include("${VC_LTL_Root}\\config\\config.cmake")
|
||||
endif()
|
14
plugins/libs/libs.cmake
Normal file
14
plugins/libs/libs.cmake
Normal file
@ -0,0 +1,14 @@
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(Detours ${CMAKE_CURRENT_LIST_DIR}/Detours-4.0.1/lib.X64/detours.lib)
|
||||
else()
|
||||
set(Detours ${CMAKE_CURRENT_LIST_DIR}/Detours-4.0.1/lib.X86/detours.lib)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_CURRENT_LIST_DIR})
|
||||
include_directories(${CMAKE_CURRENT_LIST_DIR}/Detours-4.0.1/include)
|
||||
|
||||
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
|
||||
set(LTLPlatform "Win32")
|
||||
endif()
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/VC-LTL helper for cmake.cmake")
|
@ -1,38 +1,16 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(shareddllproxy)
|
||||
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
add_compile_options(
|
||||
/std:c++17
|
||||
/MP
|
||||
/wd4018
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
)
|
||||
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x64)
|
||||
else()
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x86)
|
||||
endif()
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
|
||||
include_directories(Detours-4.0.1/include)
|
||||
|
||||
add_executable(shareddllproxy shareddllproxy.cpp dllinject.cpp ntleas.cpp)
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
add_library(x64lib magpie.cpp lossless.cpp)
|
||||
target_link_libraries(shareddllproxy x64lib ${CMAKE_SOURCE_DIR}/Detours-4.0.1/lib.X64/detours.lib)
|
||||
target_link_libraries(shareddllproxy x64lib ${Detours})
|
||||
set_target_properties(shareddllproxy PROPERTIES OUTPUT_NAME "shareddllproxy64")
|
||||
else()
|
||||
add_subdirectory(voiceroid2)
|
||||
add_library(x86lib dreye.cpp jbj7.cpp kingsoft.cpp le.cpp neospeech.cpp LR.cpp)
|
||||
target_link_libraries(shareddllproxy x86lib voiceroid2 ${CMAKE_SOURCE_DIR}/Detours-4.0.1/lib.X86/detours.lib)
|
||||
target_link_libraries(shareddllproxy x86lib voiceroid2 ${Detours})
|
||||
set_target_properties(shareddllproxy PROPERTIES OUTPUT_NAME "shareddllproxy32")
|
||||
endif()
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
cmake ./CMakeLists.txt -G "Visual Studio 15 2017" -A win32 -T v141_xp -B ./build/_xp
|
||||
cmake --build ./build/_xp --config Release --target ALL_BUILD -j 14
|
@ -1,26 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(winrtutils)
|
||||
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
add_compile_options(
|
||||
/std:c++17
|
||||
/MP
|
||||
/wd4018
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
)
|
||||
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x64)
|
||||
else()
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x86)
|
||||
endif()
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
|
||||
add_library(winrtutils MODULE winrtsnapshot.cpp cinterface.cpp dllmain.cpp pch.cpp winrtocr.cpp )
|
||||
|
||||
|
@ -1,26 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(winsharedutils)
|
||||
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
add_compile_options(
|
||||
/std:c++17
|
||||
/MP
|
||||
/wd4018
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
)
|
||||
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x64)
|
||||
else()
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x86)
|
||||
endif()
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
|
||||
add_library(winsharedutils MODULE otsu.cpp cinterface.cpp clipboard.cpp lnk.cpp dllmain.cpp levenshtein.cpp muteprocess.cpp sapi_dll.cpp simplemecab.cpp SimpleBrowser.cpp MWebBrowser.cpp icon.cpp)
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
cmake ./CMakeLists.txt -G "Visual Studio 15 2017" -A win32 -T v141_xp -B ./build/_xp
|
||||
cmake --build ./build/_xp --config Release --target ALL_BUILD -j 14
|
Loading…
x
Reference in New Issue
Block a user