!53 RE:全新构建结构与模式规划,从 Makefile 到 CMakeLists.txt 的定义

Merge pull request !53 from zinface/officil-develop
This commit is contained in:
爬山虎 2023-02-20 10:23:37 +00:00 committed by Gitee
commit 3baf596b13
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
56 changed files with 8127 additions and 143 deletions

42
.gitignore vendored
View File

@ -475,3 +475,45 @@ compile_commands.json
[Bb]uild/
.vscode/
.vs/
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
# Ignore the build directory generated by the vsocde cmake extension
build/
# Ignore the build directory generated by the vsocde clangd extension
.cache
# Created by https://www.toptal.com/developers/gitignore/api/cmake
# Edit at https://www.toptal.com/developers/gitignore?templates=cmake
### CMake ###
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
### CMake Patch ###
# External projects
*-prefix/
# End of https://www.toptal.com/developers/gitignore/api/cmake
!/Makefile

View File

@ -1,90 +1,106 @@
cmake_minimum_required(VERSION 3.16)
project(NotePad-- VERSION 1.22.0)
cmake_minimum_required(VERSION 3.22)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
project(Notepad-- VERSION 1.22.0)
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets Concurrent Network PrintSupport XmlPatterns)
include(cmake/SparkEnvConfig.cmake)
include(cmake/SparkMacrosConfig.cmake)
include(cmake/SparkFindQt5Config.cmake)
# include(cmake/SparkFindQt6Config.cmake)
include(cmake/SparkMacrosExtendConfig.cmake)
# qscint
add_subdirectory(${PROJECT_SOURCE_DIR}/src/qscint)
#
# helloworld
add_subdirectory(${PROJECT_SOURCE_DIR}/src/plugin/helloworld)
# winUNICODETCHAR
if(CMAKE_HOST_WIN32)
add_definitions(-D_UNICODE -DUNICODE)
# ----------------- ----------------- #
# Windows UNICODE TCHAR
if(WIN32)
add_compile_definitions(_UNICODE= UNICODE=)
endif()
# ----------------- QSci ----------------- #
if(TRUE)
include(cmake/modules/QScint.cmake)
endif(TRUE)
# ----------------- Notepad-- ----------------- #
if(TRUE)
include(cmake/modules/Notepad--.cmake)
endif(TRUE)
# ----------------- Notepad-- 线 ----------------- #
option(USE_MACOS_UNIVERSAL "通用 MacOS 平台构建" OFF)
#
option(USE_LINUX_UNIVERSAL "通用 Linux 平台构建" OFF)
option(USE_LINUX_DEBIAN "通用 Debian Linux 平台构建" OFF)
option(USE_LINUX_APPIMAGE "通用 Appimage Linux 平台构建" OFF)
#
option(USE_LINUX_UOS "独立 Linux 平台的 Uos 构建" OFF)
#
option(USE_WINDOWS_UNIVERSAL "通用 Windows 平台构建" OFF)
option(USE_WINDOWS_MINGW "通用 Windows 平台 MinGW 构建" OFF)
option(USE_WINDOWS_MSVC "通用 Windows 平台 MSVC 构建" OFF)
#
option(WINDOWS_DEPLOY_QT "通用 Windows 平台 Qt 部署" OFF)
option(WINDOWS_DEPLOY_QT5 "通用 Windows 平台指定 Qt5 部署 windeployqt" OFF)
option(WINDOWS_DEPLOY_QT6 "通用 Windows 平台指定 Qt6 部署 windeployqt" OFF)
# 使 macos.cmake / linux.cmake / windows.cmake .
if(APPLE)
# MacOS 平台的构建(一个无具体实现的空构建)
# include(cmake/platforms/macos.cmake)
# Linux Debian Appimage Uos
elseif(UNIX AND NOT APPLE AND NOT WIN32 AND NOT ANDROID)
# Linux
if(USE_LINUX_UNIVERSAL)
include(cmake/platforms/linux-universal.cmake)
# Linux Debian deb
if(USE_LINUX_DEBIAN)
include(cmake/platforms/linux-debian.cmake)
endif()
# Linux Appimage
if(USE_LINUX_APPIMAGE)
include(cmake/platforms/linux-appimage.cmake)
endif()
# Linux Uos
elseif(USE_LINUX_UOS)
include(cmake/platforms/linux-uos.cmake)
# Linux
else()
# include(cmake/platforms/linux.cmake)
endif(USE_LINUX_UNIVERSAL)
# Windows MinGW MSVC
elseif(WIN32)
# Windows
if(USE_WINDOWS_UNIVERSAL)
include(cmake/platforms/windows-universal.cmake)
# Windows windeployqt
include(cmake/platforms/windows-deployqt.cmake)
# Windows MinGW
if(USE_WINDOWS_MINGW)
# include(cmake/platforms/windows-mingw.cmake)
endif()
# Windows MSVC
if(USE_WINDOWS_MSVC)
# include(cmake/platforms/windows-msvc.cmake)
endif()
# Windows
else()
# include(cmake/platforms/windows-other.cmake)
endif(USE_WINDOWS_UNIVERSAL)
if(${PLUGIN_EN})
if(${PLUGIN_EN} STREQUAL on)
add_definitions(-DNO_PLUGIN=1)
endif(${PLUGIN_EN})
endif()
# ----------------- Notepad-- 线 ----------------- #
file(GLOB UI_SRC ${PROJECT_SOURCE_DIR}/src/*.ui)
set(UI_SRC ${UI_SRC} ${PROJECT_SOURCE_DIR}/src/cceditor/ccnotepad.ui)
aux_source_directory(${PROJECT_SOURCE_DIR}/src SRC)
aux_source_directory(${PROJECT_SOURCE_DIR}/src/cceditor SRC)
if(CMAKE_HOST_WIN32)
# WIN32
list(APPEND WIN_RCS ${PROJECT_SOURCE_DIR}/src/RealCompareToMinGw.rc)
add_executable(${PROJECT_NAME} WIN32 ${WIN_RCS} ${SRC} ${UI_SRC} ${PROJECT_SOURCE_DIR}/src/RealCompare.qrc)
else()
add_executable(${PROJECT_NAME} ${SRC} ${UI_SRC} ${PROJECT_SOURCE_DIR}/src/RealCompare.qrc)
endif()
target_include_directories(${PROJECT_NAME} PRIVATE
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/cceditor
${PROJECT_SOURCE_DIR}/src/qscint/src
${PROJECT_SOURCE_DIR}/src/qscint/src/Qsci
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/src
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/include
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/lexlib
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/boostregex
)
target_link_libraries(${PROJECT_NAME} qscint Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Concurrent Qt5::Network Qt5::PrintSupport Qt5::XmlPatterns)
# set(PROJECT_BINARY_DIR "${PROJECT_BINARY_DIR}/bin")
# set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
if(CMAKE_HOST_UNIX)
install(
TARGETS ${PROJECT_NAME}
DESTINATION "bin"
)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/linux/usr
DESTINATION "/")
include(${PROJECT_SOURCE_DIR}/cmake/deb_package_config.cmake)
include(CPack)
elseif(CMAKE_HOST_WIN32)
install(TARGETS ${PROJECT_NAME}
DESTINATION "/")
install(DIRECTORY ${PROJECT_SOURCE_DIR}/build/bin/
DESTINATION "/")
#
set(CPACK_PACKAGE_NAME "NotePad--")
set(CPACK_PACKAGE_DESCRIPTION "NotePad--")
set(CPACK_PACKAGE_COPYRIGHT "Copyright (c) 2023")
set(CPACK_PACKAGE_VERSION "1.22.0")
set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "22")
set(CPACK_PACKAGE_VERSION_PATCH "0")
include(${PROJECT_SOURCE_DIR}/cmake/nsis_package_config.cmake)
include(CPack)
endif()

View File

@ -1,17 +1,27 @@
UNAME:=WIN32
UNAME:=$(shell uname)
# 主体构建入口
# Win下使用Git Bash运行make
# 1. 在 Windows 中 $(OS) 为 Windows_NT
# 2. 在 Linux 中 $(OS) 为空的,此时应该使用 uname
# 注意:在 Linux 中 uanme -s 显示为 Linux
# 注意:在 Linux 中某些内核 uanme -p 显示为 unknow
# 3. 待验证:在 OSX 中 $(OS) 为空的,此时应该使用 uname
# 待验证:在 OSX 中 uname -s 显示为 Darwin
# 待验证:在 OSX 中 uname -p 显示为 ?
ifeq ($(UNAME), Linux)
all:linux
linux:
make -f linux.mk package
else
all:
make -f win.mk all
msvc:
make -f win.mk msvc
mingw:
make -f win.mk mingw
# Windows 平台相关
ifeq ($(OS),Windows_NT)
include windows.mk
# Unix 平台相关
else
UNAME_S := $(shell uname -s)
# Linux 构建
ifeq ($(UNAME_S),Linux)
include linux.mk
endif
# MacOS 构建
ifeq ($(UNAME_S),Darwin)
include macos.mk
endif
endif

BIN
assets/spark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -0,0 +1,323 @@
cmake_minimum_required(VERSION 3.0.0)
# function(add_deb_package PACKAGE_NAME PACKAGE_VERSION PACKAGE_MAINTAINER PACKAGE_EMAIL PACKAGE_SHORT_DESCRIPTION PACKAGE_LONG_DESCRIPTION)
# endfunction(add_deb_package PACKAGE_NAME PACKAGE_VERSION PACKAGE_MAINTAINER PACKAGE_EMAIL PACKAGE_SHORT_DESCRIPTION PACKAGE_LONG_DESCRIPTION)
# if(add_deb_package VALUE) set(Package ${VALUE} PARENT_SCOPE) endif(add_deb_package VALUE)
# if(add_deb_version VALUE) set(Version ${VALUE} PARENT_SCOPE) endif(add_deb_version VALUE)
# if(add_deb_maintainer VALUE) set(Maintainer ${VALUE} PARENT_SCOPE) endif(add_deb_maintainer VALUE)
# if(add_deb_email VALUE) set(Email ${VALUE} PARENT_SCOPE) endif(add_deb_email VALUE)
# if(add_deb_descrition VALUE) set(Descrition ${VALUE} PARENT_SCOPE) endif(add_deb_descrition VALUE)
# if(add_deb_detail VALUE) set(Detail ${VALUE} PARENT_SCOPE) endif(add_deb_detail VALUE)
# set(Package "")
# set(Version "")
# set(Architecture "")
# set(Maintainer "")
# set(Email "")
# set(Descrition "")
function(find_str _IN _SEP _OUT)
string(FIND "${_IN}" "${_SEP}" _TMP)
set(${_OUT} ${_TMP} PARENT_SCOPE)
endfunction(find_str _IN _SEP _OUT)
function(find_next _IN _OUT)
find_str("${_IN}" "\n" _TMP)
set(${_OUT} ${_TMP} PARENT_SCOPE)
endfunction(find_next _IN _OUT)
function(sub_next _IN _INDEX _OUT __OUT)
find_next(${_IN} _NEXTINDEX)
string(SUBSTRING "${_IN}" ${_INDEX} ${_NEXTINDEX} _TMP)
math(EXPR _NEXTINDEX ${_NEXTINDEX}+1)
string(SUBSTRING "${_IN}" ${_NEXTINDEX} -1 __TMP)
set(${_OUT} ${_TMP} PARENT_SCOPE)
set(${__OUT} ${__TMP} PARENT_SCOPE)
endfunction(sub_next _IN _INDEX _OUT)
function(trim_str _IN _OUT)
string(STRIP "${_IN}" _TMP)
set(${_OUT} ${_TMP} PARENT_SCOPE)
endfunction(trim_str _IN _OUT)
function(split_str _IN _SEP _OUT)
string(FIND "${_IN}" "${_SEP}" _TMP_INDEX)
if(NOT _TMP_INDEX EQUAL -1)
string(SUBSTRING "${_IN}" 0 ${_TMP_INDEX} _TMP)
math(EXPR _TMP_INDEX ${_TMP_INDEX}+1)
string(SUBSTRING "${_IN}" ${_TMP_INDEX} -1 __TMP)
set(${_OUT} "${_TMP};${__TMP}" PARENT_SCOPE)
else()
set(${_OUT} ${_IN} PARENT_SCOPE)
endif(NOT _TMP_INDEX EQUAL -1)
endfunction(split_str _IN _SEP _OUT)
function(split_str_p _IN _SEP _OUT __OUT)
split_str("${_IN}" "${_SEP}" _TMP)
list(GET _TMP 0 __TMP)
list(GET _TMP 1 ___TMP)
set(${_OUT} ${__TMP} PARENT_SCOPE)
set(${__OUT} ${___TMP} PARENT_SCOPE)
endfunction(split_str_p _IN _SEP _OUT __OUT)
function(split_str_n _IN _SEP _OUT _N)
if(_N GREATER 1)
set(_C ${_N})
set(_RET "")
set(_NEXT ${_IN})
while(NOT _C EQUAL 0)
split_str("${_NEXT}" "${_SEP}" _TMP)
list(LENGTH _TMP _TMP_LEN)
if(_TMP_LEN EQUAL 2)
list(GET _TMP 0 __TMP)
list(GET _TMP 1 _NEXT)
list(APPEND _RET ${__TMP})
else()
break()
endif(_TMP_LEN EQUAL 2)
math(EXPR _C "${_C}-1")
endwhile(NOT _C EQUAL 0)
list(APPEND _RET ${_NEXT})
set(${_OUT} ${_RET} PARENT_SCOPE)
else()
split_str("${_IN}" "${_SEP}" _TMP)
set(${_OUT} ${_TMP} PARENT_SCOPE)
endif(_N GREATER 1)
endfunction(split_str_n _IN _SEP _OUT _N)
function(set_package_vars _IN_KEY _IN_VAL)
# trim_str("${_IN_KEY}" _IN_KEY)
find_str("${_IN_KEY}" "Type" _Type)
if(_Type EQUAL "0")
string(TOUPPER "${_IN_VAL}" _IN_VAL_UPPER)
string(TOLOWER "${_IN_VAL}" _IN_VAL_LOWER)
set(CPACK_GENERATOR "${_IN_VAL_UPPER}" PARENT_SCOPE)
message("--> 软件包类型: ${_IN_VAL_LOWER}")
endif(_Type EQUAL "0")
find_str("${_IN_KEY}" "Package" _Package)
if(_Package EQUAL "0")
if(_IN_VAL STREQUAL "auto")
set(CPACK_DEBIAN_PACKAGE_NAME "${PROJECT_NAME}" PARENT_SCOPE)
else()
set(CPACK_DEBIAN_PACKAGE_NAME "${_IN_VAL}" PARENT_SCOPE)
endif(_IN_VAL STREQUAL "auto")
message("--> 软件包名: ${_IN_VAL}")
endif(_Package EQUAL "0")
find_str("${_IN_KEY}" "Version" _Version)
if(_Version EQUAL "0")
if(_IN_VAL STREQUAL "auto")
set(CPACK_DEBIAN_PACKAGE_VERSION "${PROJECT_VERSION}" PARENT_SCOPE)
else()
set(CPACK_DEBIAN_PACKAGE_VERSION "${_IN_VAL}" PARENT_SCOPE)
endif(_IN_VAL STREQUAL "auto")
message("--> 软件版本: ${_IN_VAL}")
endif(_Version EQUAL "0")
find_str("${_IN_KEY}" "CalVer" _CalVer)
if(_CalVer EQUAL "0")
set(CalVer "${_IN_VAL}" PARENT_SCOPE)
message("--> 日历化版本: ${_IN_VAL}")
endif(_CalVer EQUAL "0")
find_str("${_IN_KEY}" "Architecture" _Architecture)
if(_Architecture EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${_IN_VAL}" PARENT_SCOPE)
if(_IN_VAL STREQUAL "auto")
execute_process(
COMMAND dpkg --print-architecture
OUTPUT_VARIABLE _RETV
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${_RETV}" PARENT_SCOPE)
endif(_IN_VAL STREQUAL "auto")
message("--> 软件架构: ${_IN_VAL}")
endif(_Architecture EQUAL "0")
find_str("${_IN_KEY}" "Priority" _Priority)
if(_Priority EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "${_IN_VAL}" PARENT_SCOPE)
message("--> 优先级: ${_IN_VAL}")
endif(_Priority EQUAL "0")
find_str("${_IN_KEY}" "Depends" _Depends)
if(_Depends EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${_IN_VAL}" PARENT_SCOPE)
message("--> 软件依赖: ${_IN_VAL}")
endif(_Depends EQUAL "0")
find_str("${_IN_KEY}" "Maintainer" _Maintainer)
if(_Maintainer EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${_IN_VAL}" PARENT_SCOPE)
message("--> 软件维护者: ${_IN_VAL}")
endif(_Maintainer EQUAL "0")
find_str("${_IN_KEY}" "Homepage" _Homepage)
if(_Homepage EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${_IN_VAL}" PARENT_SCOPE)
message("--> 软件主页: ${_IN_VAL}")
endif(_Homepage EQUAL "0")
find_str("${_IN_KEY}" "Recommends" _Recommends)
if(_Recommends EQUAL "0")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "${_IN_VAL}" PARENT_SCOPE)
message("--> 软件建议: ${_IN_VAL}")
endif(_Recommends EQUAL "0")
endfunction(set_package_vars _IN_KEY _IN_VAL)
# 定义一个自定义(add_package_descript)
#
function(add_package_descript IN_DES)
set(PACKAGE_DES_PATH "${IN_DES}")
if(EXISTS ${IN_DES})
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${IN_DES}")
set(PACKAGE_DES_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${IN_DES}")
else()
message(FATAL_ERROR "!! Not Found Path: ${PACKAGE_DES_PATH}")
return()
endif(EXISTS ${IN_DES})
file(READ ${PACKAGE_DES_PATH} DES_CONTENT)
trim_str("${DES_CONTENT}" DES_CONTENT)
################## ##################
sub_next(${DES_CONTENT} NEXT_INDEX DES_LINE DES_CONTENT)
set(PREV_DES "")
while(NOT DES_LINE STREQUAL "${PREV_DES}")
# #
find_str("${DES_LINE}" "#" _COMMENT)
if(_COMMENT EQUAL "0")
message("--> !!!!!!! ${DES_LINE}")
sub_next(${DES_CONTENT} NEXT_INDEX DES_LINE DES_CONTENT)
continue()
endif(_COMMENT EQUAL "0")
# Descrition
find_str("${DES_LINE}" "Descrition" _DESCRIPTION)
if(_DESCRIPTION EQUAL "0")
break()
endif(_DESCRIPTION EQUAL "0")
split_str_n("${DES_LINE}" ":" _TMP 1)
list(LENGTH _TMP _TMP_LEN)
if(_TMP_LEN EQUAL 2)
split_str_p("${DES_LINE}" ":" _TMP __TMP)
trim_str("${__TMP}" __TMP)
string(LENGTH "${__TMP}" __TMP_LENGTH)
if(NOT __TMP_LENGTH EQUAL "0")
set_package_vars("${_TMP}" "${__TMP}")
endif(NOT __TMP_LENGTH EQUAL "0")
endif(_TMP_LEN EQUAL 2)
# 可能是已经结尾了(将保持重复行)
set(PREV_DES "${DES_LINE}")
sub_next(${DES_CONTENT} NEXT_INDEX DES_LINE DES_CONTENT)
endwhile(NOT DES_LINE STREQUAL "${PREV_DES}")
# Descrition
find_str("${DES_LINE}" "Descrition" _DESCRIPTION)
if(_DESCRIPTION EQUAL "0")
split_str_p("${DES_LINE}" ":" _TMP __TMP)
trim_str("${__TMP}" __TMP)
set(Descrition ${__TMP})
set(PREV_DES_LINE "")
while(NOT PREV_DES_LINE STREQUAL DES_LINE)
if(NOT PREV_DES_LINE STREQUAL "")
set(Descrition "${Descrition}\n${DES_LINE}")
endif(NOT PREV_DES_LINE STREQUAL "")
set(PREV_DES_LINE "${DES_LINE}")
sub_next(${DES_CONTENT} NEXT_INDEX DES_LINE DES_CONTENT)
endwhile(NOT PREV_DES_LINE STREQUAL DES_LINE)
# set(Descrition "${Descrition}")
message("--> 软件说明: ${Descrition}")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${Descrition})
endif(_DESCRIPTION EQUAL "0")
##################### deb #####################
# ARCHITECTURE
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(ARCHITECTURE "amd64")
elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64")
set(ARCHITECTURE "arm64")
endif()
#################### Calendar Version ###################
if("${CalVer}" STREQUAL "true")
string(TIMESTAMP BUILD_TIME "%Y%m%d")
set(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_DEBIAN_PACKAGE_VERSION}-${BUILD_TIME}")
endif("${CalVer}" STREQUAL "true")
##################### deb file name #####################
set(_Package "${CPACK_DEBIAN_PACKAGE_NAME}")
set(_Version "${CPACK_DEBIAN_PACKAGE_VERSION}")
set(_Architecture "${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
set(_DebFileName
"${_Package}_${_Version}_${_Architecture}${PACKAGE_SUFFIX}.deb"
)
set(CPACK_DEBIAN_FILE_NAME ${_DebFileName})
# set(CPACK_DEBIAN_PACKAGE_NAME "${Package}")
# set(CPACK_DEBIAN_PACKAGE_VERSION "${Version}")
# set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${Architecture}")
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "${Depends}")
# set(CPACK_DEBIAN_PACKAGE_PRIORITY "${Priority}")
# set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${Maintainer}")
# set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${Descrition}")
# 使
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_SOURCE_DIR}/config/DEBIAN/preinst"
# "${CMAKE_SOURCE_DIR}/config/DEBIAN/postinst"
# "${CMAKE_SOURCE_DIR}/config/DEBIAN/prerm"
# "${CMAKE_SOURCE_DIR}/config/DEBIAN/postrm"
# )
# ON便使 dpkg-shlibdeps
# set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
# set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
# set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY "=")
include(CPack)
endfunction(add_package_descript IN_DES)
# TODO:
# CPACK_GENERATOR
# CPACK_DEBIAN_FILE_NAME - n
# CPACK_DEBIAN_PACKAGE_NAME - y
# CPACK_DEBIAN_PACKAGE_VERSION - y
# CPACK_DEBIAN_PACKAGE_ARCHITECTURE - y(auto)
# CPACK_DEBIAN_PACKAGE_DEPENDS - y
# CPACK_DEBIAN_PACKAGE_PRIORITY - y
# CPACK_DEBIAN_PACKAGE_MAINTAINER - y
# CPACK_DEBIAN_PACKAGE_DESCRIPTION - y
# ARCHITECTURE
# if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
# set(ARCHITECTURE "amd64")
# elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64")
# set(ARCHITECTURE "arm64")
# endif()
# string(TIMESTAMP BUILD_TIME "%Y%m%d")

View File

@ -0,0 +1,164 @@
# NotepadPlugin 开发说明
> 当前插件实现的提供 Linux 层开发说明
- 引用 NotepadPluginConfig.cmake 中的说明
```cmake
# NotepadPluginConfig.cmake
# 用于 Notepad-- 插件实现的 CMake 模块初级定义
# 在 Linux 中,它的布局应该如下:
# /usr/lib/x86_64-linux-gnu/cmake/NotepadPlugin/NotepadPluginConfig.cmake
# 在 插件开发层中,它的使用如下:
# 1. 查找 NotepadPlugin 模块
# find_package(NotepadPlugin)
# 2. 使用 add_notepad_plugin(<模块名称> <源代码资源文件> [...])
# add_notepad_plugin(<plugin_name> <plugin_srcs> ...)
```
- 着手进行实现插件
> 将项目中的 src/plugin/helloworld 复制为单个项目,并使用 CMake 进行构建
```cmake
cmake_minimum_required(VERSION 3.5.1)
project(template LANGUAGES CXX VERSION 0.0.1)
# 1. 查找 NotepadPlugin 模块
find_package(NotepadPlugin REQUIRED)
# 2. 使用 add_notepad_plugin(<模块名称> <源代码资源文件> [...])
add_notepad_plugin(Helloworld
helloworld/helloworldexport.cpp
helloworld/qttestclass.cpp
helloworld/qttestclass.h
helloworld/qttestclass.ui
)
# 以上将会构建出一个名叫 libHelloworld.so 的插件扩展
```
- 一些 NotepadPluginConfig.cmake 中的变量声明
```cmake
# NOTEPAD_PLUGIN [不重要]CMake 模块名称
# NOTEPAD_PLUGIN_CONFIG [不重要]CMake 模块文件名名称
# NOTEPAD_PLUGIN_INCLUDEDIR [插件 头文件目录]插件开发者可自行使用
# NOTEPAD_PLUGIN_LIBDIR [插件 库存放目录]插件开发者可自行使用
# NOTEPAD_PLUGIN_CORELIB [插件 核心库名称]插件开发者可自行使用
# NOTEPAD_PLUGIN_EXTERNAL_INCLUDES [插件 扩展的头文件目录]插件开发者可自行使用
# NOTEPAD_PLUGIN_EXTERNAL_PLUGIN_INSTALL_DIRECTORY [插件 扩展插件安装目录(位置)]插件开发者可自行使用
# NOTEPAD_BUILD_BY_QT5
# NOTEPAD_BUILD_BY_QT6
[NOTEPAD_BUILD_BY_约定]如果在构建 Notepad-- 时开启了此项,将会向 CMake 构建系统询问相关模块
例如:
询问 Qt5 基本模块: 将会在 find_package(NotepadPlugin REQUIRED) 时自动加入
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
为开发者自动添加 Qt5 模块依赖: 将会在 add_notepad_plugin 时自动加入
if(NOTEPAD_PLUGIN_QT5)
target_link_libraries(${PLUGIN_VAR} Qt5::Core Qt5::Widgets)
endif(NOTEPAD_PLUGIN_QT5)
```
- 当前提供插件的 Linux 目录结构
```
build/_CPack_Packages/Linux/DEB/notepad---1.22.0-Linux
├── control
├── control.tar.gz
├── data.tar.gz
├── debian-binary
├── md5sums
└── usr
├── bin
│   └── notepad--
├── include
│   └── NotepadPlugin
│   ├── pluginGl.h
│   └── Qsci
│   ├── qsciabstractapis.h
│   ├── qsciapis.h
│   ├── qscicommand.h
│   ├── qscicommandset.h
│   ├── qscidocument.h
│   ├── qsciglobal.h
│   ├── qscilexerasm.h
│   ├── qscilexeravs.h
│   ├── qscilexerbash.h
│   ├── qscilexerbatch.h
│   ├── qscilexercmake.h
│   ├── qscilexercoffeescript.h
│   ├── qscilexercpp.h
│   ├── qscilexercsharp.h
│   ├── qscilexercss.h
│   ├── qscilexercustom.h
│   ├── qscilexerd.h
│   ├── qscilexerdiff.h
│   ├── qscilexeredifact.h
│   ├── qscilexerfortran77.h
│   ├── qscilexerfortran.h
│   ├── qscilexerglobal.h
│   ├── qscilexergo.h
│   ├── qscilexer.h
│   ├── qscilexerhtml.h
│   ├── qscilexeridl.h
│   ├── qscilexerjava.h
│   ├── qscilexerjavascript.h
│   ├── qscilexerjson.h
│   ├── qscilexerlua.h
│   ├── qscilexermakefile.h
│   ├── qscilexermarkdown.h
│   ├── qscilexermatlab.h
│   ├── qscilexernsis.h
│   ├── qscilexeroctave.h
│   ├── qscilexerpascal.h
│   ├── qscilexerperl.h
│   ├── qscilexerpo.h
│   ├── qscilexerpostscript.h
│   ├── qscilexerpov.h
│   ├── qscilexerproperties.h
│   ├── qscilexerpython.h
│   ├── qscilexerruby.h
│   ├── qscilexerrust.h
│   ├── qscilexerspice.h
│   ├── qscilexersql.h
│   ├── qscilexertcl.h
│   ├── qscilexertex.h
│   ├── qscilexertext.h
│   ├── qscilexervb.h
│   ├── qscilexerverilog.h
│   ├── qscilexervhdl.h
│   ├── qscilexerxml.h
│   ├── qscilexeryaml.h
│   ├── qscimacro.h
│   ├── qsciprinter.h
│   ├── qsciscintillabase.h
│   ├── qsciscintilla.h
│   ├── qscistyledtext.h
│   └── qscistyle.h
├── lib
│   ├── cmake
│   │   └── NotepadPlugin
│   │   └── NotepadPluginConfig.cmake
│   └── NotepadPlugin
│   └── libQSci.a
└── share
├── applications
│   └── notepad--.desktop
└── notepad--
└── icons
└── spark.png
13 directories, 71 files
```

View File

@ -0,0 +1,218 @@
# NotepadPluginConfig.cmake
# Notepad-- CMake
# Linux
# /usr/lib/x86_64-linux-gnu/cmake/NotepadPlugin/NotepadPluginConfig.cmake
# 使
# 1. NotepadPlugin
# find_package(NotepadPlugin)
# 2. 使 add_notepad_plugin(<模块名称> <源代码、资源文件> [...])
# add_notepad_plugin(<plugin_name> <plugin_srcs> ...)
# 使
# include(CMakePackageConfigHelpers)
# include(GNUInstallDirs)
#
set(NOTEPAD_PLUGIN @NOTEPAD_PLUGIN@)
set(NOTEPAD_BUILD_BY_QT5 @NOTEPAD_BUILD_BY_QT5@)
set(NOTEPAD_BUILD_BY_QT6 @NOTEPAD_BUILD_BY_QT6@)
set(NOTEPAD_BUILD_BY_SHARED FALSE)
set(NOTEPAD_PLUGIN_CORELIB @NOTEPAD_PLUGIN_CORELIB@)
# "Notepad 提供的插件安装目录(位置)"
set(NOTEPAD_PLUGIN_EXTERNAL_PLUGIN_INSTALL_DIRECTORY
@NOTEPAD_PLUGIN_EXTERNAL_PLUGIN_DIRECTORY@)
#
# set(NOTEPAD_PLUGIN_INCLUDEDIR @NOTEPAD_PLUGIN_INCLUDEDIR@)
# set(NOTEPAD_PLUGIN_LIBDIR @NOTEPAD_PLUGIN_LIBDIR@)
#
# ./usr/bin/
# ./usr/bin/notepad--
# ./usr/include/
# ./usr/include/NotepadPlugin/
# ./usr/include/NotepadPlugin/Qsci/
# ./usr/include/NotepadPlugin/Qsci/...
# ./usr/include/NotepadPlugin/qscint/
# ./usr/include/NotepadPlugin/qscint/scintilla/src/XPM.cp
# ./usr/lib/
# ./usr/lib/NotepadPlugin/
# ./usr/lib/NotepadPlugin/libQSci.a
# ./usr/lib/cmake/
# ./usr/lib/cmake/NotepadPlugin/
# ./usr/lib/cmake/NotepadPlugin/NotepadPluginConfig.cmake
# ^ Linux/Windows
# ../ /usr/lib/cmake
# ../../ /usr/lib
# ../../../ /usr
# ../../../include /usr/include
# ../../../lib /usr/lib
# ../../../include/NotepadPlugin # (/usr)头文件目录(NOTEPAD_PLUGIN_INCLUDEDIR)
# ../../NotepadPlugin # (/usr/lib)库文件目录(NOTEPAD_PLUGIN_LIBDIR)
# ../../cmake # (/usr/lib)cmake文件目录(无需关心)
set(NOTEPAD_PLUGIN_INCLUDEDIR
${CMAKE_CURRENT_LIST_DIR}/../../../include/${NOTEPAD_PLUGIN}
${CMAKE_CURRENT_LIST_DIR}/../../../include/${NOTEPAD_PLUGIN}/Qsci)
set(NOTEPAD_PLUGIN_LIBDIR
${CMAKE_CURRENT_LIST_DIR}/../../${NOTEPAD_PLUGIN})
if(NOTEPAD_BUILD_BY_QT5)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
endif(NOTEPAD_BUILD_BY_QT5)
if(NOTEPAD_BUILD_BY_QT6)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt6 COMPONENTS Core Widgets REQUIRED)
endif(NOTEPAD_BUILD_BY_QT6)
if(NOTEPAD_BUILD_BY_SHARED)
set(NOTEPAD_IMPORTED_CORELIB_PATH ${NOTEPAD_PLUGIN_LIBDIR}/lib${NOTEPAD_PLUGIN_CORELIB}.so)
add_library(${NOTEPAD_PLUGIN} SHARED IMPORTED)
set_target_properties(${${NOTEPAD_PLUGIN}} PROPERTIES
IMPORTED_LOCATION
${NOTEPAD_IMPORTED_CORELIB_PATH}
INCLUDE_DIRECTORIES
"${NOTEPAD_PLUGIN_INCLUDEDIR}"
)
else()
set(NOTEPAD_IMPORTED_CORELIB_PATH ${NOTEPAD_PLUGIN_LIBDIR}/lib${NOTEPAD_PLUGIN_CORELIB}.a)
add_library(${NOTEPAD_PLUGIN} STATIC IMPORTED)
set_target_properties(${${NOTEPAD_PLUGIN}} PROPERTIES
IMPORTED_LOCATION
${NOTEPAD_IMPORTED_CORELIB_PATH}
INCLUDE_DIRECTORIES
"${NOTEPAD_PLUGIN_INCLUDEDIR}"
)
endif()
if(CMAKE_HOST_UNIX)
# Linux compile_commands.json clangd
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif(CMAKE_HOST_UNIX)
# add_notepad_plugin(<PLUGIN_VAR> <PLUGIN_SRC> [...])
# Notepad--
macro(add_notepad_plugin PLUGIN_VAR PLUGIN_SRC)
# aux_source_directory(${PLUGIN_VAR}_SOURCES ${ARGN})
add_library(${PLUGIN_VAR} SHARED ${PLUGIN_SRC} ${ARGN})
if(CMAKE_HOST_WIN32)
# Win32
# target_compile_definitions(${PLUGIN_VAR} PUBLIC NDD_EXPORT=export)
endif(CMAKE_HOST_WIN32)
if(CMAKE_HOST_UNIX)
target_compile_definitions(${PLUGIN_VAR} PUBLIC NDD_EXPORT=)
endif(CMAKE_HOST_UNIX)
# ------------ 为在不同平台构建的插件定义输出名称(尾巴) ------------- #
# <OS> Windows/MacOS/Linux
# <ARCH> X86_64AMD64ARM64....
# <COMPILER> MinGWCygwinMSVCGNUClangIntel....
# <QT> Qt:
set(${PLUGIN_VAR}_OUTPUT_NAME ${PLUGIN_VAR})
# <OS> ------- Apple/Linux/Windows ------------------- #
if(APPLE)
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_MacOS")
elseif(UNIX AND NOT APPLE AND NOT WIN32 AND NOT ANDROID)
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_Linux")
elseif(WIN32)
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_Win32")
endif()
# <ARCH> ------- X86_64/AMD64/ARM64/... -------------- #
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_${CMAKE_HOST_SYSTEM_PROCESSOR}")
# if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
# if(CMAKE_APPLE_SILICON_PROCESSOR)
# string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_Silicon")
# endif(CMAKE_APPLE_SILICON_PROCESSOR)
# endif(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
# <COMPILER> -----
# string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_MinGW")
if(WIN32)
if(MINGW)
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_MinGW")
elseif(CYGWIN)
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_Cygwin")
elseif(MSVC)
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_MSVC")
else() # MinGW Cygwin MSVC
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "")
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_Unknow")
else() # CMAKE_CXX_COMPILER_ID
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_${CMAKE_CXX_COMPILER_ID}")
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "")
endif()
else()
# MINGW MINGW GNU
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_${CMAKE_CXX_COMPILER_ID}")
endif()
# : GNU Compiler
# if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
# string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_GCC")
# endif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
# <Qt 使 Qt5/Qt6 >
# if(NOT "${Qt5_}" STREQUAL "")
# string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_${QT_VERSION}")
# endif(NOT "${QT_VERSION}" STREQUAL "")
if(NOTEPAD_BUILD_BY_QT5)
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_Qt5")
else()
string(APPEND ${PLUGIN_VAR}_OUTPUT_NAME "_Qt6")
endif(NOTEPAD_BUILD_BY_QT5)
set_property(TARGET ${PLUGIN_VAR}
PROPERTY
OUTPUT_NAME "${${PLUGIN_VAR}_OUTPUT_NAME}")
# ------------ ------------- #
# Notepad-- 使
target_include_directories(${PLUGIN_VAR} PUBLIC
${NOTEPAD_PLUGIN_INCLUDEDIR})
target_link_directories(${PLUGIN_VAR} PUBLIC
${NOTEPAD_PLUGIN_LIBDIR})
target_link_libraries(${PLUGIN_VAR} ${NOTEPAD_PLUGIN_CORELIB})
if(NOTEPAD_BUILD_BY_QT5)
target_link_libraries(${PLUGIN_VAR} Qt5::Core Qt5::Widgets)
endif(NOTEPAD_BUILD_BY_QT5)
if(NOTEPAD_BUILD_BY_QT6)
target_link_libraries(${PLUGIN_VAR} Qt6::Core Qt6::Widgets)
endif(NOTEPAD_BUILD_BY_QT6)
# NOTEPAD_PLUGIN_MANAGER
# Notepad--
target_compile_definitions(${PLUGIN_VAR} PUBLIC NOTEPAD_PLUGIN_MANAGER=)
endmacro(add_notepad_plugin PLUGIN_VAR PLUGIN_SRC)
# support git plugin
# add_notepad_plugin_with_git <plugin_name> <git_repo_url> <plugin_sources_path>
# git
macro(add_notepad_plugin_with_git PLUGIN_VAR GIT_REPO_URL GIT_REPO_PLUGIN_PATH)
execute_process(COMMAND git clone ${GIT_REPO_URL} ${PLUGIN_VAR}_git
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
aux_source_directory(${CMAKE_BINARY_DIR}/${PLUGIN_VAR}_git/${GIT_REPO_PLUGIN_PATH} ${PLUGIN_VAR}_RESOURCES)
add_notepad_plugin(${PLUGIN_VAR} ${${PLUGIN_VAR}_RESOURCES})
endmacro(add_notepad_plugin_with_git PLUGIN_VAR GIT_REPO_URL GIT_REPO_PLUGIN_PATH)
message("- >>>>>>>>>>>>>>>>>> NotepadPlugin: <<<<<<<<<<<<<<<<<<")
message(" - ${CMAKE_CURRENT_LIST_FILE}")
message(" - ${NOTEPAD_PLUGIN_INCLUDEDIR}")
message(" - ${NOTEPAD_PLUGIN_LIBDIR}")
message(" - ${NOTEPAD_PLUGIN_CORELIB}")
message(" - ${NOTEPAD_IMPORTED_CORELIB_PATH}")
message("- >>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<")

View File

@ -0,0 +1,139 @@
# export PATH=/usr/lib/x86_64-linux-gnu/qt5/bin:$PATH
# export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
# export QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins:$QT_PLUGIN_PATH
# export QML2_IMPORT_PATH=/usr/lib/x86_64-linux-gnu/qt5/qml:$QML2_IMPORT_PATH
# export PATH=/usr/lib/x86_64-linux-gnu/qt5/bin:$PATH
# ~/linuxdeployqt-continuous-x86_64.AppImage spark-store-submitter -appimage
# cd ..
# ~/appimagetool-x86_64.AppImage appimage/
# LINUXDEPLOYQT=/home/zinface/linuxdeployqt-continuous-x86_64.AppImage
# APPIMAGETOOL=/home/zinface/appimagetool-x86_64.AppImage
# if ()
set(APPIMAGE_OUTPUT "${CMAKE_BINARY_DIR}/appimage")
set(APPIMAGE_ICON "${APPIMAGE_OUTPUT}/default.png")
set(APPIMAGE_DESTKOP "${APPIMAGE_OUTPUT}/default.desktop")
# set(LINUXDEPLOYQT)
# set(APPIMAGETOOL)
function(execute_linuxdeploy _PATH)
execute_process(COMMAND ${LINUXDEPLOYQT}
WORKING_DIRECTORY "${APPIMAGE_OUTPUT}"
)
endfunction(execute_linuxdeploy _PATH)
function(target_linuxdeploy)
add_custom_target(linuxdeploy pwd
BYPRODUCTS appimage
COMMAND cp ../${PROJECT_NAME} .
COMMAND "${LINUXDEPLOYQT}" ${PROJECT_NAME} -appimage -unsupported-allow-new-glibc -verbose=3 -no-strip|| true
COMMAND cp ../spark-appimage.desktop default.desktop
COMMAND cp ../spark-appimage.png default.png
WORKING_DIRECTORY "${APPIMAGE_OUTPUT}")
endfunction(target_linuxdeploy)
function(target_appimage)
add_custom_target(copy-desktop-appimage
COMMAND cp ../spark-appimage.desktop default.desktop
COMMAND cp ../spark-appimage.png default.png
WORKING_DIRECTORY "${APPIMAGE_OUTPUT}")
add_custom_target(appimage pwd
COMMAND ${APPIMAGETOOL} ${APPIMAGE_OUTPUT}
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
DEPENDS copy-desktop-appimage)
endfunction(target_appimage)
function(add_appimage)
# check linuxdeploy
if(NOT DEFINED LINUXDEPLOYQT)
message("AppImage> Not Found LINUXDEPLOYQT Variable!")
return()
endif(NOT DEFINED LINUXDEPLOYQT)
if(CMAKE_VERSION VERSION_LESS 3.19 AND NOT EXISTS ${LINUXDEPLOYQT})
message("> cmake version is less than 3.19")
message(WARNING "!Relative paths are not supported!")
else()
file(REAL_PATH ${LINUXDEPLOYQT} LINUXDEPLOYQT_REAL_PATH)
endif(CMAKE_VERSION VERSION_LESS 3.19 AND NOT EXISTS ${LINUXDEPLOYQT})
message("AppImage> Found LINUXDEPLOYQT Variable: ${LINUXDEPLOYQT_REAL_PATH}")
# check appimagetool
if(NOT DEFINED APPIMAGETOOL)
message("AppImage> Not Found APPIMAGETOOL Variable!")
return()
endif(NOT DEFINED APPIMAGETOOL)
if(CMAKE_VERSION VERSION_LESS 3.19 AND NOT EXISTS ${LINUXDEPLOYQT})
# execute_process(COMMAND realpath ${APPIMAGETOOL} OUTPUT_VARIABLE APPIMAGETOOL_REAL_PATH)
message("> cmake version is less than 3.19")
message(WARNING "!Relative paths are not supported!")
else()
file(REAL_PATH ${APPIMAGETOOL} APPIMAGETOOL_REAL_PATH)
endif(CMAKE_VERSION VERSION_LESS 3.19 AND NOT EXISTS ${LINUXDEPLOYQT})
message("AppImage> Found APPIMAGETOOL Variable: ${LINUXDEPLOYQT_REAL_PATH}")
# do add_custome_target
make_directory(${APPIMAGE_OUTPUT})
target_linuxdeploy()
target_appimage()
endfunction(add_appimage)
function(add_appimage_desktop)
configure_file(cmake/spark-appimage.desktop.in
${CMAKE_BINARY_DIR}/spark-appimage.desktop @ONLY)
endfunction(add_appimage_desktop)
function(add_appimage_icon _ICON_PATH)
if(CMAKE_VERSION VERSION_LESS 3.21)
message("> cmake version is less than 3.21")
configure_file(${_ICON_PATH} ${CMAKE_BINARY_DIR}/spark-appimage.png COPYONLY)
else()
file(COPY_FILE ${_ICON_PATH} ${CMAKE_BINARY_DIR}/spark-appimage.png)
endif(CMAKE_VERSION VERSION_LESS 3.21)
endfunction(add_appimage_icon _ICON_PATH)
# glic>=2.27, -unsupported-allow-new-glibc (意思就是不再低版本发行版使用了)
# -unsupported-bundle-everything
# -unsupported-bundle-everything
# ld-linux.so glibc使
# -unsupported-allow-new-glibc
# linuxdeployqt Ubuntu LTS AppImage
# ./linuxdeployqt-7-x86_64.AppImage / -appimage -unsupported-allow-new-glibc
# ./linuxdeployqt-7-x86_64.AppImage / -appimage -unsupported-bundle-everything
# 1. Appimage
# include(cmake/SparkAppimageConfig.cmake) # Spark Appimage
# add_appimage_icon(assets/spark.png) # Appimage
# add_appimage_desktop() # Appimage 中的默认desktop(使用来自 Spark 构建的 Desktop 构建中配置的信息(必须要求 spark-desktop))
# add_appimage() # Appimage
# 2. Makefile Appimage --
# Makefile Appimage (要求提供工具的绝对路径然后可依次进行linuxdeployqt, genrate-appimage)
# https://github.com/probonopd/linuxdeployqt linuxdeployqt
# https://github.com/AppImage/AppImageKit appimagetool
# https://gitlink.org.cn/zinface/bundle-linuxdeployqt.git
#
# BUNDLE_LINUXDEPLOYQT := $(shell pwd)/build/bundle-linuxdeployqt
# download-bundle-linuxdeploytools:
# -git clone https://gitlink.org.cn/zinface/bundle-linuxdeployqt.git $(BUNDLE_LINUXDEPLOYQT)
# LINUXDEPLOYQT := "$(BUNDLE_LINUXDEPLOYQT)/linuxdeployqt-continuous-x86_64.AppImage"
# APPIMAGETOOL := "$(BUNDLE_LINUXDEPLOYQT)/appimagetool-x86_64.AppImage"
# linuxdeploy: release download-bundle-linuxdeploytools
# cd build && cmake .. -DLINUXDEPLOYQT=$(LINUXDEPLOYQT) -DAPPIMAGETOOL=$(APPIMAGETOOL)
# cd build && make linuxdeploy
# genrate-appimage:
# cd build && cmake .. -DLINUXDEPLOYQT=$(LINUXDEPLOYQT) -DAPPIMAGETOOL=$(APPIMAGETOOL)
# cd build && make appimage

View File

@ -0,0 +1,36 @@
macro(spark_desktop_macros _APP_NAME _APP_NAME_ZH_CN _APP_COMMENT _APP_TYPE _APP_EXECUTE_PATH _APP_EXECUTE_ICON_PATH _APP_CATEGORIES)
set(APP_NAME ${_APP_NAME})
set(APP_NAME_ZH_CN ${_APP_NAME_ZH_CN})
set(APP_COMMENT ${_APP_COMMENT})
set(APP_TYPE ${_APP_TYPE})
set(APP_EXECUTE_PATH ${_APP_EXECUTE_PATH})
set(APP_EXECUTE_ICON_PATH ${_APP_EXECUTE_ICON_PATH})
set(APP_CATEGORIES ${_APP_CATEGORIES})
configure_file(cmake/spark-desktop.desktop.in
${CMAKE_BINARY_DIR}/${_APP_NAME}.desktop
)
set(SPARK_DESKTOP_FILE ${CMAKE_BINARY_DIR}/${_APP_NAME}.desktop)
endmacro(spark_desktop_macros _APP_NAME _APP_NAME_ZH_CN _APP_COMMENT _APP_TYPE _APP_EXECUTE_PATH _APP_EXECUTE_ICON_PATH _APP_CATEGORIES)
# include(cmake/SparkDesktopMacros.cmake)
# : Name=
# spark_desktop_macros(
# : Name=
# : Name[zh_CN]=
# : Comment=
# : Type=
# : Exec=
# : Icon=
# : Category=
# )
# configure_file(<input> <output>
# [NO_SOURCE_PERMISSIONS | USE_SOURCE_PERMISSIONS |
# FILE_PERMISSIONS <permissions>...]
# [COPYONLY] [ESCAPE_QUOTES] [@ONLY]
# [NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
# install(FILES ${APP_NAME}.desktop
# DESTINATION /usr/share/applications
# )

View File

@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.5.1)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
# set(CMAKE_BUILD_TYPE "Debug")

View File

@ -0,0 +1,153 @@
cmake_minimum_required(VERSION 3.5.1)
set(SPARK_FIND_QT5 TRUE)
find_package(Qt5 COMPONENTS Core Widgets Network REQUIRED)
# function(target_link_qt5 NAME)
# target_link_libraries(${NAME}
# Qt5::Core
# Qt5::Widgets
# Qt5::Network)
# endfunction(target_link_qt5 NAME)
# 使 spark_add_link target_link_qt5
spark_add_link(qt5 Qt5::Core Qt5::Widgets Qt5::Network)
# spark_add_link_qt5
# spark_add_link_qt5 target_link_qt5_<name>
# _IN_NAME: 使 spark_add_link <name>
# spark_add_link(qt_<name> ${ARGN})
macro(spark_add_link_qt5 _IN_NAME)
spark_add_link(qt5_${_IN_NAME} ${ARGN})
endmacro(spark_add_link_qt5 _IN_NAME)
# 使 spark_add_link_qt5 target_link_qt5_<name>
# spark_add_link_qt5(Concurrent Qt5::Concurrent)
#
# spark_add_links_qt5
# spark_add_links_qt5 spark_add_link_qt5
# :
# qt5_item: python3 中的 (for item in items:)
# : qt5_item Core
# spark_add_link_qt5(${qt5_item} Qt5::${qt5_item})
# spark_add_link_qt5(Core Qt5::Core)
# spark_add_link(qt5_Core Qt5::Core)
# spark_add_link(qt5_Core Qt5::Core)
# : qt5_Core qt5_core
# string(TOLOWER <string> <output_variable>)
macro(spark_add_links_qt5)
set(qt5_items ${ARGN})
foreach(qt5_item IN LISTS qt5_items)
find_package(Qt5${qt5_item})
spark_add_link_qt5(${qt5_item} Qt5::${qt5_item})
string(TOLOWER "${qt5_item}" qt5_lower_item)
spark_add_link_qt5(${qt5_lower_item} Qt5::${qt5_item})
message("add_target_link_qt5_${qt5_item} or add_target_link_qt5_${qt5_lower_item}")
endforeach(qt5_item IN LISTS qt5_items)
endmacro(spark_add_links_qt5)
# Core
# GUI GUI OpenGL
# Multimedia 线
# Multimedia Widgets Widget
# Network 使
# QML QML JavaScript
# Quick UI
# Quick Controls QML
# Quick Dialogs Qt Quick
# Quick Layouts Qt Quick 2
# Quick Test QML JavaScript
# Qt Quick Test
# Qt SQL 使 SQL
# Qt Test Qt
# Qt Test
# Qt Widgets C++ Qt GUI
# Qt5
# find /usr/lib/x86_64-linux-gnu/cmake/ -name "*Config.cmake" | sed 's@^.*/Qt5@Qt5@;' | grep ^Qt5
#
# find /usr/lib/x86_64-linux-gnu/cmake/ -name "*Config.cmake" | sed 's@^.*/Qt5@Qt5@;' | grep ^Qt5 | sed 's@^Qt5@@; s@Config.cmake$@@; /^\s*$/d'
#
# find /usr/lib/x86_64-linux-gnu/cmake/ -name "*Config.cmake" | sed 's@^.*/Qt5@Qt5@;' | grep ^Qt5 | sed 's@^Qt5@@; s@Config.cmake$@@; /^\s*$/d' | sort | pr -t -3
spark_add_links_qt5(
# AccessibilitySupport
# AttributionsScannerTools
Concurrent
# Core
# DBus
# Designer
# DesignerComponents
# DeviceDiscoverySupport
# DocTools
# EdidSupport
# EglFSDeviceIntegration
# EglFsKmsSupport
# EglSupport
# EventDispatcherSupport
# FbSupport
# FontDatabaseSupport
# GlxSupport
Gui
# Help
# InputSupport
# KmsSupport
# LinguistTools
# LinuxAccessibilitySupport
# Network
# OpenGL
# OpenGLExtensions
# PacketProtocol
# PlatformCompositorSupport
# Positioning
# PositioningQuick
PrintSupport
# Qml
# QmlDebug
# QmlDevTools
# QmlImportScanner
# QmlModels
# QmlWorkerScript
# Quick
# QuickCompiler
# QuickControls2
# QuickParticles
# QuickShapes
# QuickTemplates2
# QuickTest
# QuickWidgets
# SerialBus
# SerialPort
# ServiceSupport
# Sql
# Svg
# Test
# ThemeSupport
# UiPlugin
# UiTools
# VulkanSupport
# WebChannel
# WebEngine
# WebEngineCore
# WebEngineWidgets
# WebKit
# WebKitWidgets
# WebSockets
# Widgets
# X11Extras
# XcbQpa
# XkbCommonSupport
# Xml
XmlPatterns
)

View File

@ -0,0 +1,130 @@
cmake_minimum_required(VERSION 3.5.1)
set(SPARK_FIND_QT6 TRUE)
find_package(Qt6 COMPONENTS Core Widgets Network REQUIRED)
# function(target_link_qt6 NAME)
# target_link_libraries(${NAME}
# Qt6::Core
# Qt6::Widgets
# Qt6::Network)
# endfunction(target_link_qt6 NAME)
# 使 spark_add_link target_link_qt6
spark_add_link(qt6 Qt6::Core Qt6::Widgets Qt6::Network)
# spark_add_link_qt6
# spark_add_link_qt6 target_link_qt6_<name>
# _IN_NAME: 使 spark_add_link <name>
# spark_add_link(qt_<name> ${ARGN})
macro(spark_add_link_qt6 _IN_NAME)
spark_add_link(qt6_${_IN_NAME} ${ARGN})
endmacro(spark_add_link_qt6 _IN_NAME)
# 使 spark_add_link_qt6 target_link_qt6_<name>
# spark_add_link_qt5(Concurrent Qt6::Concurrent)
#
# spark_add_links_qt6
# spark_add_links_qt6 spark_add_link_qt6
# :
# qt6_item: python3 中的 (for item in items:)
# : qt6_item Core
# spark_add_link_qt6(${qt6_item} Qt6::${qt6_item})
# spark_add_link_qt6(Core Qt6::Core)
# spark_add_link(qt6_Core Qt6::Core)
# spark_add_link(qt6_Core Qt6::Core)
# : qt6_Core qt6_core
# string(TOLOWER <string> <output_variable>)
macro(spark_add_links_qt6)
set(qt6_items ${ARGN})
foreach(qt6_item IN LISTS qt6_items)
find_package(Qt6${qt6_item})
spark_add_link_qt6(${qt6_item} Qt6::${qt6_item})
string(TOLOWER "${qt6_item}" qt6_lower_item)
spark_add_link_qt6(${qt6_lower_item} Qt6::${qt6_item})
message("add_target_link_qt6_${qt6_item} or add_target_link_qt6_${qt6_lower_item}")
endforeach(qt6_item IN LISTS qt6_items)
endmacro(spark_add_links_qt6)
# Qt6
# find /usr/lib/x86_64-linux-gnu/cmake/ -name "*Config.cmake" | sed 's@^.*/Qt6@Qt6@;' | grep ^Qt6
#
# find /usr/lib/x86_64-linux-gnu/cmake/ -name "*Config.cmake" | sed 's@^.*/Qt5@Qt5@;' | grep ^Qt5 | sed 's@^Qt5@@; s@Config.cmake$@@; /^\s*$/d'
#
# find /usr/lib/x86_64-linux-gnu/cmake/ -name "*Config.cmake" | sed 's@^.*/Qt5@Qt5@;' | grep ^Qt5 | sed 's@^Qt5@@; s@Config.cmake$@@; /^\s*$/d' | sort | pr -t -3
# find /usr/lib/x86_64-linux-gnu/cmake/ -name "*Config.cmake" | sed 's@^.*/Qt6@Qt6@;' | grep ^Qt6 | sed 's@^Qt6@@; s@Config.cmake$@@; /^\s*$/d' | sort | pr -t -3
spark_add_links_qt6(
# BuildInternals
# BuildInternals/StandaloneTests/Qt5CompatTests
# BuildInternals/StandaloneTests/QtBaseTests
Concurrent
# Core
Core5Compat
# CoreTools
# DBus
# DBusTools
# DeviceDiscoverySupportPrivate
# EglFSDeviceIntegrationPrivate
# EglFsKmsGbmSupportPrivate
# EglFsKmsSupportPrivate
# FbSupportPrivate
# Gui
# GuiTools
# HostInfo
# InputSupportPrivate
# KmsSupportPrivate
# Network
# OpenGL
# OpenGLWidgets
PrintSupport
# QComposePlatformInputContextPlugin
# QCupsPrinterSupportPlugin
# QEglFSEmulatorIntegrationPlugin
# QEglFSIntegrationPlugin
# QEglFSKmsEglDeviceIntegrationPlugin
# QEglFSKmsGbmIntegrationPlugin
# QEglFSX11IntegrationPlugin
# QEvdevKeyboardPlugin
# QEvdevMousePlugin
# QEvdevTabletPlugin
# QEvdevTouchScreenPlugin
# QGifPlugin
# QGtk3ThemePlugin
# QIBaseDriverPlugin
# QIbusPlatformInputContextPlugin
# QICOPlugin
# QJpegPlugin
# QLibInputPlugin
# QLinuxFbIntegrationPlugin
# QMinimalEglIntegrationPlugin
# QMinimalIntegrationPlugin
# QMYSQLDriverPlugin
# QNetworkManagerNetworkInformationPlugin
# QODBCDriverPlugin
# QOffscreenIntegrationPlugin
# QPSQLDriverPlugin
# QSQLiteDriverPlugin
# QTlsBackendCertOnlyPlugin
# QTlsBackendOpenSSLPlugin
# QTsLibPlugin
# QTuioTouchPlugin
# QVkKhrDisplayIntegrationPlugin
# QVncIntegrationPlugin
# QXcbEglIntegrationPlugin
# QXcbGlxIntegrationPlugin
# QXcbIntegrationPlugin
# QXdgDesktopPortalThemePlugin
# Sql
# Test
# Widgets
# WidgetsTools
# XcbQpaPrivate
# Xml
)

View File

@ -0,0 +1,132 @@
# spark_install_target
# /
# : A
# : A B C...
macro(spark_install_target INSTALL_TARGET_DIR INSTALL_TARGETS)
install(TARGETS
${INSTALL_TARGETS} ${ARGN}
DESTINATION ${INSTALL_TARGET_DIR})
endmacro(spark_install_target INSTALL_TARGET_DIR INSTALL_TARGETS)
# spark_install_file
# /
# : A
# : A B C...
macro(spark_install_file INSTALL_FILE_DIR INSTALL_FILE)
install(FILES
${INSTALL_FILE} ${ARGN}
DESTINATION ${INSTALL_FILE_DIR})
endmacro(spark_install_file INSTALL_FILE_DIR INSTALL_FILE)
# spark_install_program
# /
# : A
# : A B C...
macro(spark_install_program INSTALL_PROGRAM_DIR INSTALL_PROGRAM)
install(PROGRAMS
${INSTALL_PROGRAM} ${ARGN}
DESTINATION ${INSTALL_PROGRAM_DIR})
endmacro(spark_install_program INSTALL_PROGRAM_DIR INSTALL_PROGRAM)
# spark_install_directory
# /
# : A
# : A/* A
macro(spark_install_directory INSTALL_DIRECTORY_DIR INSTALL_DIRECOTRY)
# INSTALL_DIRECOTRY *
# 1. '*',
# 2. 使 spark_install_file
# 2. 使 spark_install_directory
# message(FATAL_ERROR "${INSTALL_DIRECTORY_DIR}")
# string(FIND <string> <substring> <output_variable> [REVERSE])
string(FIND "${INSTALL_DIRECOTRY}" "*" INSTALL_DIRECTORY_FIND_INDEX)
# message(FATAL_ERROR "${INSTALL_DIRECTORY_FIND_INDEX}: ${INSTALL_DIRECTORY_DIR}")
# file(GLOB <variable>
# [LIST_DIRECTORIES true|false] [RELATIVE <path>] [CONFIGURE_DEPENDS]
# [<globbing-expressions>...])
if (NOT INSTALL_DIRECTORY_FIND_INDEX EQUAL -1)
# string(SUBSTRING <string> <begin> <length> <output_variable>)
string(SUBSTRING "${INSTALL_DIRECOTRY}" 0 ${INSTALL_DIRECTORY_FIND_INDEX} INSTALL_DIRECTORY_FIND_INDEX_SUBSTRING)
# message(FATAL_ERROR "directory: ${INSTALL_DIRECTORY_FIND_INDEX_SUBSTRING}")
# file(GLOB <variable>
# [LIST_DIRECTORIES true|false] [RELATIVE <path>] [CONFIGURE_DEPENDS]
# [<globbing-expressions>...])
file(GLOB INSTALL_DIRECTORY_FIND_INDEX_SUBSTRING_FILE_GLOB_LIST ${INSTALL_DIRECTORY_FIND_INDEX_SUBSTRING}/*)
list(LENGTH INSTALL_DIRECTORY_FIND_INDEX_SUBSTRING_FILE_GLOB_LIST INSTALL_DIRECTORY_FIND_INDEX_SUBSTRING_FILE_GLOB_LIST_LENGTH)
foreach(item IN LISTS INSTALL_DIRECTORY_FIND_INDEX_SUBSTRING_FILE_GLOB_LIST)
# message("-> ${item}")
if(IS_DIRECTORY ${item})
message("-> ${item} IS_DIRECTORY")
# spark_install_directory(${INSTALL_DIRECTORY_DIR} ${item})
install(DIRECTORY
${item}
DESTINATION ${INSTALL_DIRECTORY_DIR}
USE_SOURCE_PERMISSIONS)
else()
message("-> ${item} NOT IS_DIRECTORY")
spark_install_program(${INSTALL_DIRECTORY_DIR} ${item})
# spark_install_file(${INSTALL_DIRECTORY_DIR} ${item})
endif(IS_DIRECTORY ${item})
endforeach(item IN LISTS INSTALL_DIRECTORY_FIND_INDEX_SUBSTRING_FILE_GLOB_LIST)
# message(FATAL_ERROR " directory: ${INSTALL_DIRECTORY_FIND_INDEX_SUBSTRING_FILE_GLOB_LIST}")
# message(FATAL_ERROR " directory: ${INSTALL_DIRECTORY_FIND_INDEX_SUBSTRING_FILE_GLOB_LIST_LENGTH}")
else()
# ISSUES You Must check here
# message(FATAL_ERROR "install ${INSTALL_DIRECTORY_DIR}")
install(DIRECTORY
${INSTALL_DIRECOTRY} ${ARGN}
DESTINATION ${INSTALL_DIRECTORY_DIR})
endif(NOT INSTALL_DIRECTORY_FIND_INDEX EQUAL -1)
endmacro(spark_install_directory INSTALL_DIRECTORY_DIR INSTALL_DIRECOTRY)
macro(spark_install_changelog CHANGE_LOG_FILE)
set(SOURCE_CHANGE_LOG_FILE ${CHANGE_LOG_FILE})
if (EXISTS ${SOURCE_CHANGE_LOG_FILE})
execute_process(COMMAND test -f ${SOURCE_CHANGE_LOG_FILE}
RESULT_VARIABLE changelog_test
)
execute_process(COMMAND which gzip
RESULT_VARIABLE gzip_test
)
if (NOT changelog_test EQUAL 0)
message(FATAL_ERROR "NOTE: 不是常规文件: ${SOURCE_CHANGE_LOG_FILE}")
endif(NOT changelog_test EQUAL 0)
if (NOT gzip_test EQUAL 0)
message(FATAL_ERROR "NOTE: 未安装 gzip, 无法压缩 changelog")
endif(NOT gzip_test EQUAL 0)
#
add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/changelog.gz"
COMMAND gzip -cn9 "${SOURCE_CHANGE_LOG_FILE}" > "${CMAKE_BINARY_DIR}/changelog.gz"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
COMMENT "Compressing changelog"
)
add_custom_target(changelog ALL DEPENDS "${CMAKE_BINARY_DIR}/changelog.gz")
# include(GNUInstallDirs)
set(SPARK_INSTALL_CHANGE_LOG_DIR "/usr/share/doc/${PROJECT_NAME}/")
install(FILES
${CMAKE_BINARY_DIR}/changelog.gz
debian/copyright
DESTINATION ${SPARK_INSTALL_CHANGE_LOG_DIR}
)
else()
message(FATAL_ERROR "未找到: ${SOURCE_CHANGE_LOG_FILE}")
endif(EXISTS ${SOURCE_CHANGE_LOG_FILE})
endmacro(spark_install_changelog CHANGE_LOG_FILE)

View File

@ -0,0 +1,161 @@
cmake_minimum_required(VERSION 3.5.1)
# macro
# spark_add_library <lib_name> [files]...
#
# target_link_<lib_name>
macro(spark_add_library _lib_name)
message("================ ${_lib_name} Library ================")
add_library(${_lib_name} ${ARGN})
set(SRCS ${ARGN})
foreach(item IN LISTS SRCS)
message(" -> ${item}")
endforeach(item IN LISTS SRCS)
function(target_link_${_lib_name} TARGET)
message("${_lib_name}")
target_link_libraries(${TARGET} ${_lib_name})
endfunction(target_link_${_lib_name} TARGET)
endmacro(spark_add_library _lib_name)
# spark_add_library_path <lib_name> <lib_path>
#
# target_link_<lib_name>
# <lib_path>
macro(spark_add_library_path _lib_name _lib_path)
set(${_lib_name}_SOURCE_PATH ${_lib_path})
set(${_lib_name}_TYPE)
if(${${_lib_name}_SOURCE_PATH} STREQUAL SHARED OR ${${_lib_name}_SOURCE_PATH} STREQUAL STATIC)
set(${_lib_name}_SOURCE_PATH ${ARGV2})
set(${_lib_name}_TYPE ${_lib_path})
message("_lib_path: ${${_lib_name}_SOURCE_PATH}(${ARGV2})[${${_lib_name}_TYPE}]")
if(${ARGC} LESS 3)
message(FATAL_ERROR "Missing parameter, library path not specified.")
endif(${ARGC} LESS 3)
endif(${${_lib_name}_SOURCE_PATH} STREQUAL SHARED OR ${${_lib_name}_SOURCE_PATH} STREQUAL STATIC)
aux_source_directory(${${_lib_name}_SOURCE_PATH} ${_lib_name}_SOURCES)
message("================ spark_add_library_path: ${_lib_name} ================")
file(GLOB UI_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${${_lib_name}_SOURCE_PATH}/*.ui)
add_library(${_lib_name} ${${_lib_name}_TYPE} ${${_lib_name}_SOURCES} ${UI_LIST})
message("${_lib_name}_SOURCES: ${${_lib_name}_SOURCES}, ${${_lib_name}_SOURCE_PATH}")
foreach(item IN LISTS ${_lib_name}_SOURCES)
message(" -> ${item}")
endforeach(item IN LISTS ${_lib_name}_SOURCES)
function(target_link_${_lib_name} TARGET)
# message("target_link_${_lib_name}")
message(" -> (include): ${${_lib_name}_SOURCE_PATH}")
target_include_directories(${TARGET} PUBLIC "${${_lib_name}_SOURCE_PATH}")
target_link_libraries(${TARGET} ${_lib_name})
endfunction(target_link_${_lib_name} TARGET)
function(target_include_${_lib_name} TARGET)
# message("target_link_${_lib_name}")
message(" -> (include): ${${_lib_name}_SOURCE_PATH}")
target_include_directories(${TARGET} PUBLIC "${${_lib_name}_SOURCE_PATH}")
# target_link_libraries(${TARGET} ${_lib_name})
endfunction(target_include_${_lib_name} TARGET)
# file(GLOB HEADER_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${${_lib_name}_SOURCE_PATH}/*.h)
target_include_directories(${_lib_name} PUBLIC "${${_lib_name}_SOURCE_PATH}")
# target_link_include_directories
# LIST 使 ""
# target_link_include_directories PUBLIC 将会填充(追加) INCLUDE_DIRECTORIES
# target_link_include_directories cmake
# target_link_include_directories
# 使
# get_target_property(_lib_include_directories ${_lib_name} INCLUDE_DIRECTORIES)
# list(APPEND _lib_include_directories "${CMAKE_CURRENT_LIST_DIR}/${${_lib_name}_SOURCE_PATH}")
# message("----> ${CMAKE_CURRENT_LIST_DIR}/${${_lib_name}_SOURCE_PATH}")
# message("----> ${_lib_include_directories}")
# set_target_properties(${_lib_name} PROPERTIES
# INCLUDE_DIRECTORIES "${_lib_include_directories}"
# INTERFACE_INCLUDE_DIRECTORIES "${_lib_include_directories}"
# )
endmacro(spark_add_library_path _lib_name _lib_path)
# spark_add_executable <exec_name> [files]...
#
# Qt *.h/*.cpp/*.qrc/*.qm/...
macro(spark_add_executable _exec_name)
message("================ ${_exec_name} Executable ================")
add_executable(${_exec_name} ${ARGN})
endmacro(spark_add_executable _exec_name)
macro(spark_add_executable_path _exec_name _exec_path)
aux_source_directory(${_exec_path} ${_exec_name}_SOURCES)
message("================ ${_exec_name} Executable ================")
file(GLOB UI_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${_exec_path}/*.ui)
add_executable(${_exec_name} ${${_exec_name}_SOURCES} ${ARGN} ${UI_LIST})
foreach(item IN LISTS ${_exec_name}_SOURCES)
message(" -> ${item}")
endforeach(item IN LISTS ${_exec_name}_SOURCES)
# function(target_link_${_exec_name} TARGET)
# message("target_link_${_lib_name}")
message(" -> (include): ${_exec_path}")
target_include_directories(${_exec_name} PUBLIC "${_exec_path}")
# target_link_libraries(${TARGET} ${_lib_name})
# endfunction(target_link_${_exec_name} TARGET)
# target_link_${_exec_name}(${_exec_name})
endmacro(spark_add_executable_path _exec_name _exec_path)
# spark_find_library
# pkg-config
# target_link_<prefix>
macro(spark_find_library _prefix)
find_package(PkgConfig REQUIRED)
# libnotify
pkg_check_modules(${_prefix} ${ARGN})
function(target_link_${_prefix} TARGET)
target_include_directories(${TARGET} PUBLIC
${${_prefix}_INCLUDE_DIRS})
target_link_libraries(${TARGET}
${${_prefix}_LIBRARIES})
endfunction(target_link_${_prefix} TARGET)
endmacro(spark_find_library _prefix)
# spark_add_executable_paths
#
# item: python3 中的 (for item in items:)
# file: 为在目录中不以递归(GLOB_RECURSE) qrc rcc
# prefix-<item>
macro(spark_add_executable_paths _prefix_path)
set(PATHS ${ARGN})
foreach(item IN LISTS PATHS)
file(GLOB QRCS "${item}/*.qrc")
message(">>> add_executable: " "${_prefix_path}-${item} ${item} + ${QRCS}")
spark_add_executable_path(${_prefix_path}-${item} ${item} ${QRCS})
target_link_qt5(${_prefix_path}-${item})
endforeach(item IN LISTS PATHS)
endmacro(spark_add_executable_paths _prefix_path)
# spark_add_link
# 使 fucntion target_link_<name>
# _IN_NAME: target_link_<name>
# ARGN:
# 使 target_link_<name>
# _NAME: fucntion : <_NAME>
macro(spark_add_link _IN_NAME)
function(target_link_${_IN_NAME} _NAME)
message("LINK ${_NAME} ${ARGN}")
target_link_libraries(${_NAME}
${ARGN})
endfunction(target_link_${_IN_NAME} _NAME)
endmacro(spark_add_link _IN_NAME)

View File

@ -0,0 +1,237 @@
# find_plus
# INVAl + OUTVAL
function(find_plus INVAL OUTVAL)
string(FIND "${INVAL}" "+" plus_index)
set(${OUTVAL} ${plus_index} PARENT_SCOPE)
# if(plus_index LESS 0)
# set(${OUTVAL} -1 PARENT_SCOPE)
# else()
# set(${OUTVAL} ${plus_index} PARENT_SCOPE)
# endif(plus_index LESS 0)
endfunction(find_plus INVAL OUTVAL)
# find_plus("FF" FFFF)
# message("--> FFFF ${FFFF}") # --> FFFF -1
# find_plus("F+F" FFFF)
# message("--> FFFF ${FFFF}") # --> FFFF 1
# find_plus("+F+F" FFFF)
# message("--> FFFF ${FFFF}") # --> FFFF 0
# set(FFF)
# list(APPEND FFFF )
# list(APPEND FFFF "F")
# list(APPEND FFFF "FA")
# message("--> FFFF: ${FFFF}") # --> FFFF: F;FA
# set(FFFFS "")
# list(APPEND FFFFS ${FFFF})
# message("--> FFFFS: ${FFFFS}") # --> FFFFS: F;FA
# set(FFFF "+AA+BB+CC+DD")
# string(REPLACE "+" ";" FFFFL "${FFFF}")
# list(LENGTH FFFFL FFFFLEN)
# message("--> FFFFL: ${FFFFL} --> ${FFFFLEN}") # --> FFFFL: F;
# plus_list
# "+AAA+BBB+CCC" 列表(list)
# 使 string + ";" 使 list
function(plus_list INVAL OUTVAL OUTVALLEN)
# set(${OUTVAL} "..." PARENT_SCOPE)
# set(${OUTVALLEN} 0 PARENT_SCOPE)
set(_tmps "") #
# +
find_plus(${INVAL} RIGHT_PLUS)
string(LENGTH "${INVAL}" INVALLEN)
message("--> 传入的 INVAL: --> 内容: ${INVAL}")
message("--> 传入的 INVAL: --> 长度: ${INVALLEN}")
message("--> 传入的 INVAL: --> +位置: ${RIGHT_PLUS}")
# +
if(RIGHT_PLUS LESS 0)
message("--> 传入的 INVAL: --> 无需计算新的+位置")
# message("--> 计算新的 + 位置: ${_PLUSINDEX}")
list(APPEND _tmps ${INVAL})
else()
math(EXPR _PLUSINDEX "${RIGHT_PLUS}+1")
message("--> 传入的 INVAL: --> 需计算+位置 --> 右移: ${_PLUSINDEX}")
string(SUBSTRING "${INVAL}" ${_PLUSINDEX} ${INVALLEN} NewVal)
message("--> 传入的 INVAL: --> 需计算+位置 --> 右移: ${_PLUSINDEX} -> 内容: ${NewVal}")
# string(REPLACE "+" ";" _tmps "${NewVal}")
# list(LENGTH FFFFL FFFFLEN)
# message("--> 计算新的 + 位置: ${_PLUSINDEX} --> 后面的 NewVal: ${NewVal}")
# find_plus(${NewVal} _NextPlus)
# if(_NextPlus LESS 0)
# list(APPEND _tmps ${NewVal})
# message("--> 追加新的 + 位置: ${_PLUSINDEX} --> 后面的")
# else()
# message("--> 追加新的 + 位置: ${_PLUSINDEX} --> 后面的")
# #
# # plus_list(${NewVal} NewValS )
# # foreach(item)
# # list(APPEND _tmps ${item})
# # endforeach(item)
# endif(_NextPlus LESS 0)
endif(RIGHT_PLUS LESS 0)
set(${OUTVAL} ${_tmps} PARENT_SCOPE)
list(LENGTH _tmps _tmps_len)
set(${OUTVALLEN} ${_tmps_len} PARENT_SCOPE)
endfunction(plus_list INVAL OUTVAL OUTVALLEN)
# plus_list("+AAA+BBB+CCC+DDD" FFF FFLEN)
# message("--------> ${FFF}: -> ${FFLEN}")
# spark_add_library_realpaths
#
# :
# : +A+B
macro(spark_add_library_realpaths)
message("---> 基于传入的项进行构建 <---")
# message("--> src/unclassified/ItemDelegates/NdStyledItemDelegate")
# string(FIND <string> <substring> <output_variable> [REVERSE])
# string(SUBSTRING <string> <begin> <length> <output_variable>)
# math(EXPR value "100 * 0xA" OUTPUT_FORMAT DECIMAL) # value is set to "1000"
set(REALPATHS ${ARGN})
foreach(REALPATH IN LISTS REALPATHS)
message("---> 传入路径: ${REALPATH} <--- ")
string(LENGTH "${REALPATH}" REALPATH_LENGTH)
message("---> 计算传入路径长度: --> 长度: ${REALPATH_LENGTH}")
string(FIND "${REALPATH}" "/" LASTINDEX REVERSE)
message("---> 计算传入路径末尾/位置: --> 长度: ${LASTINDEX}")
math(EXPR LASTINDEX "${LASTINDEX}+1")
message("---> 计算传入路径末尾/右移: --> 长度: ${LASTINDEX}")
string(SUBSTRING "${REALPATH}" ${LASTINDEX} ${REALPATH_LENGTH} REALNAME_Dependency)
# + +
find_plus(${REALPATH} RIGHT_PLUS)
# + -1
if(RIGHT_PLUS LESS 0) # 0: +
set(REALNAME "${REALNAME_Dependency}")
message("---> 传入路径末尾/右移部分: --> ${REALNAME} <-- 无依赖+")
message("---> 构建 ${REALNAME} -> ${REALNAME} ${REALPATH} ")
spark_add_library_path(${REALNAME} ${REALPATH})
if(SPARK_FIND_QT5)
target_link_qt5(${REALNAME})
endif(SPARK_FIND_QT5)
if(SPARK_FIND_QT6)
target_link_qt6(${REALNAME})
endif(SPARK_FIND_QT6)
else()
message("---> 传入路径末尾/右移部分: --> ${REALNAME_Dependency} <-- 依赖+")
# + / +
# src/unclassified/widgets/DocTypeListView+JsonDeploy
# ^(LASTINDEX) ^(RIGHT_PLUS)
# RIGHT_PLUS - LASTINDEX DocTypeListView
math(EXPR REALNAME_LENGTH "${RIGHT_PLUS}-${LASTINDEX}")
message("---> 计算传入路径末尾/右移部分: --> 位置: ${RIGHT_PLUS}")
# message("---> 计算传入路径末尾/右移部分: --> 长度: ${REALNAME_Dependency}")
# DocTypeListView
# JsonDeploy
# set(REALNAME "")
string(SUBSTRING "${REALPATH}" 0 ${RIGHT_PLUS} _REALPATH_DIR)
string(SUBSTRING "${REALPATH}" ${LASTINDEX} ${REALNAME_LENGTH} REALNAME)
message("---> 计算传入路径末尾/右移部分: --> 库名: ${REALNAME}")
string(SUBSTRING "${REALPATH}" ${RIGHT_PLUS} ${REALPATH_LENGTH} Dependency)
message("---> 计算传入路径末尾/右移部分: --> 库名: ${REALNAME} --> +部分: ${Dependency}")
# plus_list(${Dependency} dependencies dependencies_len)
string(REPLACE "+" ";" dependencies "${Dependency}")
message("---> 计算传入路径末尾/右移部分: --> 库名: ${REALNAME} --> +部分: ${Dependency} --> 列表: ${dependencies} <-- ")
message("---> 构建 ${REALNAME} -> ${REALNAME} ${_REALPATH_DIR}")
spark_add_library_path(${REALNAME} ${_REALPATH_DIR})
# target_link_qt5(${REALNAME}) # 使
target_include_directories(${REALNAME} PUBLIC ${_REALPATH_DIR})
target_link_libraries(${REALNAME} ${dependencies})
endif(RIGHT_PLUS LESS 0)
endforeach(REALPATH IN LISTS REALPATHS)
endmacro(spark_add_library_realpaths)
# spark_aux_source_paths
# AUX
macro(spark_aux_source_paths AUX_VAR)
set(${AUX_VAR} "")
set(${AUX_VAR}_PATHS ${ARGN})
foreach(aux_path IN LISTS ${AUX_VAR}_PATHS)
# message("aux_path: ${aux_path}")
aux_source_directory(${aux_path} ${AUX_VAR})
endforeach(aux_path IN LISTS ${AUX_VAR}_PATHS)
endmacro(spark_aux_source_paths AUX_VAR)
# spark_file_glob
#
macro(spark_file_glob FGLOB_VAR)
set(${FGLOB_VAR} "")
set(${FGLOB_VAR}_PATHS ${ARGN})
foreach(fglob_path IN LISTS ${FGLOB_VAR}_PATHS)
file(GLOB FGLOB_PATH_SRCS ${fglob_path})
foreach(fglob_path_src IN LISTS FGLOB_PATH_SRCS)
# message(" -> ${item}")
list(APPEND ${FGLOB_VAR} ${fglob_path_src})
endforeach(fglob_path_src IN LISTS FGLOB_PATH_SRCS)
endforeach(fglob_path IN LISTS ${FGLOB_VAR}_PATHS)
endmacro(spark_file_glob FGLOB_VAR)
# spark_add_source_paths
#
#
macro(spark_add_source_paths SOURCE_VAR)
set(${SOURCE_VAR} "")
set(${SOURCE_VAR}_PATHS ${ARGN})
spark_aux_source_paths(${SOURCE_VAR} ${ARGN})
foreach(source_path IN LISTS ${SOURCE_VAR}_PATHS)
# list(APPEND ${SOURCE_VAR}_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_PATH})
# aux_source_directory(${SOURCE_PATH} _SOURCES)
# foreach(item IN LISTS _SOURCES)
# # message(" -> ${item}")
# list(APPEND ${SOURCE_VAR} ${item})
# endforeach(item IN LISTS _SOURCES)
# file(GLOB HEADER_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${SOURCE_PATH}/*.h)
# foreach(item IN LISTS HEADER_LIST)
# # message(" -> ${item}")
# list(APPEND ${SOURCE_VAR} ${item})
# endforeach(item IN LISTS HEADER_LIST)
file(GLOB UI_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${source_path}/*.ui)
foreach(ui_src IN LISTS UI_SRCS)
# message(" -> ${item}")
list(APPEND ${SOURCE_VAR} ${ui_src})
endforeach(ui_src IN LISTS UI_SRCS)
endforeach(source_path IN LISTS ${SOURCE_VAR}_PATHS)
endmacro(spark_add_source_paths SOURCE_VAR)

View File

@ -0,0 +1,41 @@
# Notepad--.cmake
# Notepad--
# Notepad--
# 1. Notepad--
# 2. Notepad--
if(TRUE)
# Notepad--
set(QRC_SOURCES src/RealCompare.qrc)
spark_aux_source_paths(CCEditorSources
src
src/cceditor
)
spark_add_executable(${PROJECT_NAME} ${CCEditorSources} ${QRC_SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/cceditor
${PROJECT_SOURCE_DIR}/src/qscint/src
${PROJECT_SOURCE_DIR}/src/qscint/src/Qsci
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/src
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/include
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/lexlib
${PROJECT_SOURCE_DIR}/src/qscint/scintilla/boostregex
)
# target_link_libraries(${PROJECT_NAME} QSci)
target_link_QSci(${PROJECT_NAME})
target_link_qt5_XmlPatterns(${PROJECT_NAME})
endif(TRUE)
# ----------------- Notepad-- ----------------- #
if(TRUE)
#
target_compile_definitions(${PROJECT_NAME} PUBLIC NO_PLUGIN=0)
# ...
endif(TRUE)
# Notepad-- QSci Qt5::XmlPatterns

View File

@ -0,0 +1,39 @@
# QScint.cmake
# Qscintilla
# 1. libQSci.a
# 2. QSci
if(TRUE)
# add_subdirectory(${PROJECT_SOURCE_DIR}/src/qscint)
# file(GLOB MOC_HEADER src/qscint/src/Qsci/*.h)
spark_file_glob(MOC_HEADER "src/qscint/src/Qsci/*.h")
spark_add_source_paths(QSciSources
src/qscint/src
src/qscint/scintilla/lexers
src/qscint/scintilla/lexlib
src/qscint/scintilla/src
src/qscint/scintilla/boostregex
# src/qscint/src/Qsci
# FAIL: only *.ui will spark_file_glob(MOC_HEADER ...)
)
spark_add_library(QSci STATIC ${QSciSources} ${MOC_HEADER})
target_compile_definitions(QSci PRIVATE SCINTILLA_QT SCI_LEXER INCLUDE_DEPRECATED_FEATURES)
target_include_directories(QSci PRIVATE
src/qscint/scintilla/boostregex
src/qscint/scintilla/lexlib)
target_include_directories(QSci PUBLIC
src/qscint/src
src/qscint/src/Qsci
src/qscint/scintilla/src
src/qscint/scintilla/include)
target_link_qt5(QSci)
target_link_qt5_PrintSupport(QSci)
target_link_qt5_Concurrent(QSci)
endif(TRUE)
# QSci PrintSupportConcurrent
# QSci ...

View File

@ -0,0 +1,45 @@
# 注释行(使用方式)
# find_package(DebPackage PATHS ${CMAKE_SOURCE_DIR})
# add_package_descript(cmake/package-deb.descript)
# 打包后的文件名称
# FileName: 待定
# 配置 PACKAGE_SUFFIX 变量可添加尾巴名称
# 如在 Makefile 中硬编码方式
# OSID=$(shell lsb_release -si)
# OSRELEASE=$(shell lsb_release -sr)
# -DPACKAGE_SUFFIX="_$(OSID)$(OSRELEASE)"
# deb 安装包的安装时脚本
# 1.安装[前|后]执行脚本(preinst,postinst),
# 2.卸载[前|后]执行脚本(prerm,postrm)
# ControlExtra: 未定义(暂不支持)
# 如需指定请修改 DebPackageConfig.cmake 模板(第252行)
# CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA 变量
# 打包类型,暂支持 deb, 未来支持 tgz(tar.gz)
Type: deb
# 软件包名称(自动, 使用 PROJECT_NAME 变量值)
Package: com.hmja.notepad
# 软件包版本(自动, 使用 PROJECT_VERSION 变量值)
Version: auto
# 日历化尾部版本
CalVer: true
# 软件包架构(自动)
Architecture: auto
# 软件包属于的系统部分[admin|cli-mono|comm|database|debug|devel|doc|editors|education|electronics|embedded|fonts|games|gnome|gnu-r|gnustep|graphics|hamradio|haskell|httpd|interpreters|introspection|java|javascript|kde|kernel|libdevel|libs|lisp|localization|mail|math|metapackages|misc|net|news|ocaml|oldlibs|otherosfs|perl|php|python|ruby|rust|science|shells|sound|tasks|tex|text|utils|vcs|video|web|x11|xfce|zope]
Section: editors
# 软件包优先级[required|important|stantard|optional|extra]
Priority: optional
# 软件包依赖
Depends:
# 软件包维护者(组织或个人)
Maintainer: 尹作为 <757210198@qq.com>
# 软件包主页
Homepage: https://gitee.com/cxasm/notepad--
# 软件包建议
Recommends:
# 软件包描述信息
Descrition: Notepad--是一个国产跨平台、简单的文本编辑器。
Notepad--是一个国产跨平台、简单的文本编辑器是替换notepad++的一种选择。
其内置强大的代码对比功能让你丢掉付费的beyond compare。

View File

@ -0,0 +1,48 @@
# linux-appimage.cmake
# Linux Appimage
# 1. SparkAppimageConfig.cmake SparkDesktopMacros.cmake desktop
# 2. linuxdeployqt Appimage
# 3. 使 Appimagetool Appimage
# 4. Notepad--.X86_64.Appimage
# Appimagetool :
# https://doc.appimage.cn/docs/appimagetool-usage/
option(LINUX_DEPLOY_QT "为 Linux 中构建的应用进程 linuxdeployqt" OFF)
if(LINUX_DEPLOY_QT)
# ... Appimage
endif(LINUX_DEPLOY_QT)
option(USE_LINUX_APPIMAGE "为 Linux 生成 Appimage 可执行程序" OFF)
if(USE_LINUX_APPIMAGE)
include(cmake/SparkDesktopMacros.cmake)
# : Name=
spark_desktop_macros(
# : Name=
${PROJECT_NAME}
# : Name[zh_CN]=
"Notepad--"
# : Comment=
"Notepad-- "
# : Type=
"Application"
# : Exec=
# %F : https://gitee.com/zinface/z-tools/blob/desktop-dev/src/DesktopGenerater/desktopexecparamdialog.cpp
"notepad-- %F"
# : Icon=
"/usr/share/notepad--/icons/spark.png"
# : Category=
"Development"
)
# 1. Appimage
include(cmake/SparkAppimageConfig.cmake) # Spark Appimage
add_appimage_icon(assets/spark.png) # Appimage
add_appimage_desktop() # Appimage 中的默认desktop(使用来自 Spark 构建的 Desktop 构建中配置的信息(必须要求 spark-desktop))
add_appimage() # Appimage
endif(USE_LINUX_APPIMAGE)

View File

@ -0,0 +1,18 @@
# linux-debian.cmake
# Linux Debian
# 1. cmake/package-deb.descript
# 2. DebPackageConfig.cmake
option(USE_LINUX_DEBIAN "为 Linux 生成 deb 软件包" OFF)
if(USE_LINUX_DEBIAN)
find_package(DebPackage PATHS ${CMAKE_SOURCE_DIR})
add_package_descript(cmake/package-deb.descript)
endif(USE_LINUX_DEBIAN)

View File

@ -0,0 +1,110 @@
# linux-universal.cmake
# Linux
#
# /usr/bin/ Linux
# Notepad--
#
# /usr/inculde/ Linux
# NotepadPlugin/
# pluginGl.h
# QSci/
# qscint/scintilla/
#
# /usr/lib/ Linux
# NotepadPlugin/
# libQSci.so
#
# /usr/lib/cmake/ Linux
# NotepadPlugin/
# NotepadPluginConfig.cmake
#
# /usr/share/Notepad--/ Linux
# plugin/
# themes/
#
# CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" ??
# 使 Linux.cmake ?
if(CMAKE_HOST_UNIX)
include(cmake/SparkInstallMacrosConfig.cmake)
# 使 Linux
set(LINUX_APPLICATION_DIR /usr/share/${PROJECT_NAME})
# Linux
spark_install_directory(/usr cmake/platforms/linux/universal/usr/*)
# themes /themes
# plugin ? /plugin
spark_install_directory(${LINUX_APPLICATION_DIR} src/themes)
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
#
set(CMAKE_INSTALL_PREFIX "/usr")
set(NOTEPAD_PLUGIN NotepadPlugin)
# CMake
set(NOTEPAD_PLUGIN_CONFIG ${NOTEPAD_PLUGIN}Config.cmake)
# CMake
set(NOTEPAD_PLUGIN_CORELIB QSci) # QSci QScintllia
# CMake Notepad-- QT5
# Qt
# add_notepad_plugin
set(NOTEPAD_BUILD_BY_QT5 TRUE)
set(NOTEPAD_BUILD_BY_QT6 FALSE)
# 定义在平台中插件应该安装的位置(待确定)
# CMake Notepad-- "插件安装目录(位置)"
set(NOTEPAD_PLUGIN_EXTERNAL_PLUGIN_INSTALL_DIRECTORY "")
# 使 NotepadPlugin.cmake.in
set(NOTEPAD_PLUGIN_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/${NOTEPAD_PLUGIN})
set(NOTEPAD_PLUGIN_LIBDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${NOTEPAD_PLUGIN})
# NOTEPAD_PLUGIN_INCLUDEDIR NOTEPAD_PLUGIN_LIBDIR cmake
configure_package_config_file(cmake/NotepadPluginConfig.cmake.in
${CMAKE_BINARY_DIR}/${NOTEPAD_PLUGIN_CONFIG}
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${NOTEPAD_PLUGIN})
# cmake
spark_install_file(${CMAKE_INSTALL_LIBDIR}/cmake/${NOTEPAD_PLUGIN}
${CMAKE_BINARY_DIR}/${NOTEPAD_PLUGIN_CONFIG})
#
spark_install_file(${NOTEPAD_PLUGIN_INCLUDEDIR}
src/include/pluginGl.h)
# Qsci
spark_install_directory(${NOTEPAD_PLUGIN_INCLUDEDIR}
src/qscint/src/Qsci)
#
spark_install_directory(${NOTEPAD_PLUGIN_INCLUDEDIR}/qscint
src/qscint/scintilla)
# QSci 的头文件(从插件实现层面来看,目前是使用*.h pluginGl.h
# Qsci *.h 使 #include <Qsci/*.h> 使)
# spark_file_glob(QSci_HEADERS src/qscint/src/Qsci/*.h src/include/pluginGl.h)
# set_target_properties(QSci PROPERTIES PUBLIC_HEADER "${QSci_HEADERS}")
# Notepad-- 的接口文件(从逻辑层面来看,目前已经在前面安装了接口文件,所以此部分不被使用)
# spark_file_glob(Notepad_HEADERS src/include/pluginGl.h)
# set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${QSci_HEADERS}")
# QSci
install(TARGETS ${PROJECT_NAME} QSci
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${NOTEPAD_PLUGIN_LIBDIR}
ARCHIVE DESTINATION ${NOTEPAD_PLUGIN_LIBDIR}
PUBLIC_HEADER DESTINATION ${NOTEPAD_PLUGIN_INCLUDEDIR}
)
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
endif(CMAKE_HOST_UNIX)

View File

@ -0,0 +1,72 @@
# linux-uos.cmake
# Linux Uos Deepin
# 1. 使
# 2.
# 1. /opt/apps/<appid>/
# 2. : entries
# 1. iconapplicationsmetadata entries
# 3. files
# 1. Notepad-- files
# 2. themes files
# 3. plugin files
# /.
# /opt
# /opt/apps
# /opt/apps/com.hmja.notepad
# /opt/apps/com.hmja.notepad/entries
# /opt/apps/com.hmja.notepad/entries/applications
# /opt/apps/com.hmja.notepad/entries/applications/com.hmja.notepad.desktop
# /opt/apps/com.hmja.notepad/entries/icons
# /opt/apps/com.hmja.notepad/entries/icons/hicolor
# /opt/apps/com.hmja.notepad/entries/icons/hicolor/scalable
# /opt/apps/com.hmja.notepad/entries/icons/hicolor/scalable/apps
# /opt/apps/com.hmja.notepad/entries/icons/hicolor/scalable/apps/ndd.svg
# /opt/apps/com.hmja.notepad/files
# /opt/apps/com.hmja.notepad/files/Notepad--
# /opt/apps/com.hmja.notepad/files/themes
# /opt/apps/com.hmja.notepad/files/themes/....
# /opt/apps/com.hmja.notepad/info
option(USE_LINUX_UOS "为 Linux Uos 生成规范的软件包" OFF)
if(USE_LINUX_UOS)
#
set(UOS_APP_ID "com.hmja.notepad")
set(UOS_APP_HOME_DIR "/opt/apps/${UOS_APP_ID}")
set(UOS_APP_HOME_ENTRY_DIR "${UOS_APP_HOME_DIR}/entries")
set(UOS_APP_HOME_FILES_DIR "${UOS_APP_HOME_DIR}/files")
set(UOS_APP_HOME_INFO_FILE "${UOS_APP_HOME_DIR}/info")
# 使 Linux
set(LINUX_UOS_APP_HOME_DIR ${UOS_APP_HOME_DIR})
include(cmake/SparkInstallMacrosConfig.cmake)
# ------------------ ------------------ #
# 1. Uos /opt/apps/
spark_install_directory(/opt/apps/
cmake/platforms/linux/uos/${UOS_APP_HOME_DIR}
)
# ------------------ ------------------ #
# 1. files
spark_install_target(${UOS_APP_HOME_FILES_DIR}
${PROJECT_NAME}
)
# 2. themes files
spark_install_directory(${UOS_APP_HOME_FILES_DIR}
src/themes
)
# ------------------ deb ------------------ #
# 1. Uos Uos
set(PACKAGE_SUFFIX "_Uos")
# 2. 使 debian deb
find_package(DebPackage PATHS ${CMAKE_SOURCE_DIR})
add_package_descript(cmake/package-deb.descript)
endif(USE_LINUX_UOS)

113
cmake/platforms/linux.cmake Normal file
View File

@ -0,0 +1,113 @@
# CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" ??
# 使 Linux.cmake ?
if(CMAKE_HOST_UNIX)
include(cmake/SparkInstallMacrosConfig.cmake)
include(cmake/SparkDesktopMacros.cmake)
# : Name=
spark_desktop_macros(
# : Name=
${PROJECT_NAME}
# : Name[zh_CN]=
"Notepad--"
# : Comment=
"Notepad-- "
# : Type=
"Application"
# : Exec=
# %F : https://gitee.com/zinface/z-tools/blob/desktop-dev/src/DesktopGenerater/desktopexecparamdialog.cpp
"notepad-- %F"
# : Icon=
"/usr/share/notepad--/icons/spark.png"
# : Category=
"Development"
)
# spark_install_file(/usr/share/applications/ ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop)
# spark_install_file(/usr/share/notepad--/icons/ assets/spark.png)
# spark_install_target(/usr/bin/ ${PROJECT_NAME})
# 线 linux/destkop PR使
# spark_desktop_macros Appimage
# Appimage 要求(使用来自 Spark 构建的 Desktop 构建中配置的信息(必须要求 spark-desktop))
spark_install_directory(/usr src/linux/usr/*) # Linux
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
#
set(CMAKE_INSTALL_PREFIX "/usr")
set(NOTEPAD_PLUGIN NotepadPlugin)
# CMake
set(NOTEPAD_PLUGIN_CONFIG ${NOTEPAD_PLUGIN}Config.cmake)
# CMake
set(NOTEPAD_PLUGIN_CORELIB QSci) # QSci QScintllia
# CMake Notepad-- QT5
# Qt
# add_notepad_plugin
set(NOTEPAD_BUILD_BY_QT5 TRUE)
set(NOTEPAD_BUILD_BY_QT6 FALSE)
# 定义在平台中插件应该安装的位置(待确定)
# CMake Notepad-- "插件安装目录(位置)"
set(NOTEPAD_PLUGIN_EXTERNAL_PLUGIN_INSTALL_DIRECTORY "")
# 使 NotepadPlugin.cmake.in
set(NOTEPAD_PLUGIN_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/${NOTEPAD_PLUGIN})
set(NOTEPAD_PLUGIN_LIBDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${NOTEPAD_PLUGIN})
# NOTEPAD_PLUGIN_INCLUDEDIR NOTEPAD_PLUGIN_LIBDIR cmake
configure_package_config_file(cmake/NotepadPluginConfig.cmake.in
${CMAKE_BINARY_DIR}/${NOTEPAD_PLUGIN_CONFIG}
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${NOTEPAD_PLUGIN})
# cmake
spark_install_file(${CMAKE_INSTALL_LIBDIR}/cmake/${NOTEPAD_PLUGIN}
${CMAKE_BINARY_DIR}/${NOTEPAD_PLUGIN_CONFIG})
#
spark_install_file(${NOTEPAD_PLUGIN_INCLUDEDIR}
src/include/pluginGl.h)
# Qsci
spark_install_directory(${NOTEPAD_PLUGIN_INCLUDEDIR}
src/qscint/src/Qsci)
#
spark_install_directory(${NOTEPAD_PLUGIN_INCLUDEDIR}/qscint
src/qscint/scintilla)
# QSci 的头文件(从插件实现层面来看,目前是使用*.h pluginGl.h
# Qsci *.h 使 #include <Qsci/*.h> 使)
# spark_file_glob(QSci_HEADERS src/qscint/src/Qsci/*.h src/include/pluginGl.h)
# set_target_properties(QSci PROPERTIES PUBLIC_HEADER "${QSci_HEADERS}")
# Notepad-- 的接口文件(从逻辑层面来看,目前已经在前面安装了接口文件,所以此部分不被使用)
# spark_file_glob(Notepad_HEADERS src/include/pluginGl.h)
# set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${QSci_HEADERS}")
# QSci
install(TARGETS ${PROJECT_NAME} QSci
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${NOTEPAD_PLUGIN_LIBDIR}
ARCHIVE DESTINATION ${NOTEPAD_PLUGIN_LIBDIR}
PUBLIC_HEADER DESTINATION ${NOTEPAD_PLUGIN_INCLUDEDIR}
)
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# 1. Appimage
include(cmake/SparkAppimageConfig.cmake) # Spark Appimage
add_appimage_icon(assets/spark.png) # Appimage
add_appimage_desktop() # Appimage 中的默认desktop(使用来自 Spark 构建的 Desktop 构建中配置的信息(必须要求 spark-desktop))
add_appimage() # Appimage
# 注释行(使用方式)
find_package(DebPackage PATHS ${CMAKE_SOURCE_DIR})
add_package_descript(cmake/package-deb.descript)
endif(CMAKE_HOST_UNIX)

View File

@ -0,0 +1,13 @@
[Desktop Entry]
Version=1.0
Name=Notepad--
Name[zh_CN]=Notepad--
Comment=Notepad-- 是一个国产跨平台、简单的文本编辑器。
Type=Application
Exec=Notepad-- %F
Icon=notepad--
Categories=Development;Office;
Terminal=false
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-patch;text/x-adasrc;text/x-chdr;text/x-csrc;text/css;application/x-desktop;text/x-patch;text/x-fortran;text/html;text/x-java;text/x-tex;text/x-makefile;text/x-objcsrc;text/x-pascal;application/x-perl;application/x-perl;application/x-php;text/vnd.wap.wml;text/x-python;application/x-ruby;text/sgml;application/xml;model/vrml;image/svg+xml;application/json;
# Generated from the DesktopGenerater component of the z-Tools toolkit

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.gitee.cxasm.notepad--</id>
<name>Notepad--</name>
<summary>Notepad--</summary>
<metadata_license>MIT</metadata_license>
<project_license>GPL-2.0-or-later</project_license>
<description>
<p>
notepad--是一个国产跨平台、简单的文本编辑器是替换notepad++的一种选择。其内置强大的代码对比功能让你丢掉付费的beyond compare。
</p>
</description>
<launchable type="desktop-id">io.gitee.cxasm.notepad--.desktop</launchable>
</component>

View File

@ -0,0 +1,17 @@
[Desktop Entry]
Version=1.0
Name=Notepad--
Name[zh_CN]=Notepad--
Comment=Notepad-- 是一个国产跨平台、简单的文本编辑器。
Type=Application
Exec=/opt/apps/com.hmja.notepad/files/Notepad-- %U
Icon=/opt/apps/com.hmja.notepad/entries/icons/hicolor/scalable/apps/ndd.svg
Categories=TextEditor;
Encoding=UTF-8
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-patch;text/x-adasrc;text/x-chdr;text/x-csrc;text/css;application/x-desktop;text/x-patch;text/x-fortran;text/html;text/x-java;text/x-tex;text/x-makefile;text/x-objcsrc;text/x-pascal;application/x-perl;application/x-perl;application/x-php;text/vnd.wap.wml;text/x-python;application/x-ruby;text/sgml;application/xml;model/vrml;image/svg+xml;application/json;
StartupNotify=true
Terminal=false
TryExec=/opt/apps/com.hmja.notepad/files/Notepad--
X-DDE-FileManager-MenuTypes=SingleFile
# Generated from the DesktopGenerater component of the z-Tools toolkit

View File

@ -0,0 +1,2 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1653643519286" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8215" width="48" height="48" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M648.479968 0.00064h-511.99968A48.959969 48.959969 0 0 0 100.64031 15.36063 54.399966 54.399966 0 0 0 85.28032 51.200608v921.599424a48.959969 48.959969 0 0 0 15.35999 35.839978A50.559968 50.559968 0 0 0 136.480288 1024h751.039531a49.279969 49.279969 0 0 0 35.839977-15.35999 50.559968 50.559968 0 0 0 15.359991-35.839978V290.240459z" fill="#A5D940" p-id="8216"></path><path d="M938.719787 290.240459H699.679936a52.479967 52.479967 0 0 1-51.199968-51.199968V0.00064l290.239819 290.239819z" fill="#C4EAFF" p-id="8217"></path><path d="M407.520119 459.520353v29.759981H331.360166v198.719876H296.800188v-198.719876H220.320236v-29.759981zM462.240084 459.520353l55.679966 82.559948 55.679965-82.559948h42.559973l-77.439951 110.399931 82.879948 118.079926h-42.559974l-61.119961-90.559943-61.119962 90.559943h-42.559974l82.239949-118.079926-76.799952-110.399931zM815.199864 459.520353v29.759981h-76.159953v198.719876h-34.559978v-198.719876H629.27998v-29.759981z" fill="#FFFFFF" p-id="8218"></path></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.gitee.cxasm.notepad--</id>
<name>Notepad--</name>
<summary>Notepad--</summary>
<metadata_license>MIT</metadata_license>
<project_license>GPL-2.0-or-later</project_license>
<description>
<p>
notepad--是一个国产跨平台、简单的文本编辑器是替换notepad++的一种选择。其内置强大的代码对比功能让你丢掉付费的beyond compare。
</p>
</description>
<launchable type="desktop-id">io.gitee.cxasm.notepad--.desktop</launchable>
</component>

View File

@ -0,0 +1,18 @@
{
"appid": "com.hmja.notepad",
"name": "Notepad--",
"version": "1.22.1.0",
"arch": ["amd64"],
"permissions": {
"autostart": false,
"notification": false,
"trayicon": false,
"clipboard": true,
"account": false,
"bluetooth": false,
"camera": false,
"audio_record": false,
"installed_apps": false
}
}

View File

View File

@ -0,0 +1,94 @@
# windows-deployqt.cmake
# Windows windeployqt
# deployqt
# 1. windeployqt WINDOWS_DEPLOY_QT
# 2.
# 3. Windows Qt
set(WINDOWS_QT_DIR "")
option(WINDOWS_DEPLOY_QT "为 Windows 中构建的应用进行 windeployqt" OFF)
option(WINDOWS_DEPLOY_QT5 "为 Windows 中构建的 QT5 应用进行 windeployqt" OFF)
option(WINDOWS_DEPLOY_QT6 "为 Windows 中构建的 QT6 应用进行 windeployqt" OFF)
if(WINDOWS_DEPLOY_QT)
if(WINDOWS_DEPLOY_QT5)
# 使 WINDOWS_DEPLOY_QT5 使 Qt5
set(WINDOWS_QT_DIR "${Qt5_DIR}")
elseif(WINDOWS_DEPLOY_QT6)
# 使 WINDOWS_DEPLOY_QT6 使 Qt6
set(WINDOWS_QT_DIR "${Qt6_DIR}")
endif()
if (WINDOWS_DEPLOY_QT5 OR WINDOWS_DEPLOY_QT6)
message(" -------- ${CMAKE_INSTALL_PREFIX} ---------- ")
message("${WINDOWS_QT_DIR}/../../../bin/windeployqt")
# install(TARGETS ${PROJECT_NAME}
# DESTINATION ${CMAKE_BINARY_DIR}/windows-deployqt)
# windeployqt
# 使 Windows Deploy Qt
set(WINDOWS_APPLICATION_DEPLOY_PATH
${CMAKE_BINARY_DIR}/windows-deployqt/${PROJECT_NAME}.app/bin)
# windeployqt
# windeployqt WIN32
#
set_target_properties(${PROJECT_NAME}
PROPERTIES
# WIN32 使 WinMain(某种 Windows 内部特性)
WIN32_EXECUTABLE true
#
# ARCHIVE_OUTPUT_DIRECTORY ""
#
# LIBRARY_OUTPUT_DIRECTORY ""
#
RUNTIME_OUTPUT_DIRECTORY ${WINDOWS_APPLICATION_DEPLOY_PATH})
# Windows Deploy Qt Application
# : windeployqt --qmldir <path-to-app-qml-files> <path-to-app-binary>
add_custom_command(TARGET ${PROJECT_NAME}
#
POST_BUILD
#
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
# windeployqt
COMMAND ${WINDOWS_QT_DIR}/../../../bin/windeployqt
#
${WINDOWS_APPLICATION_DEPLOY_PATH}/${PROJECT_NAME}.exe
# QML-
--qmlimport ${WINDOWS_QT_DIR}/../../../qml
# 部署编译器运行时(仅限桌面)
--compiler-runtime
# 详细级别(0-2)
--verbose 2
# 使
--dir ${WINDOWS_APPLICATION_DEPLOY_PATH}
)
# windows-deployqt windeployqt
# Windows Deploy Qt Application
# : windeployqt --qmldir <path-to-app-qml-files> <path-to-app-binary>
add_custom_target(windows-deployqt
COMMAND ${WINDOWS_QT_DIR}/../../../bin/windeployqt
#
${WINDOWS_APPLICATION_DEPLOY_PATH}/${PROJECT_NAME}.exe
# QML-
--qmlimport ${WINDOWS_QT_DIR}/../../../qml
# 部署编译器运行时(仅限桌面)
--compiler-runtime
# 详细级别(0-2)
--verbose 2
# 使
--dir ${CMAKE_INSTALL_PREFIX}/bin
)
endif (WINDOWS_DEPLOY_QT5 OR WINDOWS_DEPLOY_QT6)
endif(WINDOWS_DEPLOY_QT)

View File

@ -0,0 +1,96 @@
# windows-universal.cmake
# Windows
# Notepad--
#
# /bin Windows
# Notepad--.exe
# plugin/
# themes
#
# /include/ Windows
# NotepadPlugin/
# pluginGl.h
# QSci/
# qscint/scintilla/
#
# /lib/ Windows
# cmake/
# NotepadPlugin/
# NotepadPluginConfig.cmake
# NotepadPlugin/
# QSci.lib
#
if(CMAKE_HOST_WIN32)
include(cmake/SparkInstallMacrosConfig.cmake)
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
#
# set(CMAKE_INSTALL_PREFIX "/usr") # Linux Windows 使
set(NOTEPAD_PLUGIN NotepadPlugin)
# CMake
set(NOTEPAD_PLUGIN_CONFIG ${NOTEPAD_PLUGIN}Config.cmake)
# CMake
set(NOTEPAD_PLUGIN_CORELIB QSci) # QSci QScintllia
# CMake Notepad-- QT5
# Qt
# add_notepad_plugin
set(NOTEPAD_BUILD_BY_QT5 TRUE)
set(NOTEPAD_BUILD_BY_QT6 FALSE)
# 定义在平台中插件应该安装的位置(待确定)
# CMake Notepad-- "插件安装目录(位置)"
set(NOTEPAD_PLUGIN_EXTERNAL_PLUGIN_INSTALL_DIRECTORY "")
# 使 NotepadPlugin.cmake.in
set(NOTEPAD_PLUGIN_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/${NOTEPAD_PLUGIN})
set(NOTEPAD_PLUGIN_LIBDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${NOTEPAD_PLUGIN})
# NOTEPAD_PLUGIN_INCLUDEDIR NOTEPAD_PLUGIN_LIBDIR cmake
configure_package_config_file(cmake/NotepadPluginConfig.cmake.in
${CMAKE_BINARY_DIR}/${NOTEPAD_PLUGIN_CONFIG}
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${NOTEPAD_PLUGIN})
# cmake
spark_install_file(${CMAKE_INSTALL_LIBDIR}/cmake/${NOTEPAD_PLUGIN}
${CMAKE_BINARY_DIR}/${NOTEPAD_PLUGIN_CONFIG})
#
spark_install_file(${NOTEPAD_PLUGIN_INCLUDEDIR}
src/include/pluginGl.h)
# Qsci
spark_install_directory(${NOTEPAD_PLUGIN_INCLUDEDIR}
src/qscint/src/Qsci)
#
spark_install_directory(${NOTEPAD_PLUGIN_INCLUDEDIR}/qscint
src/qscint/scintilla)
# QSci 的头文件(从插件实现层面来看,目前是使用*.h pluginGl.h
# Qsci *.h 使 #include <Qsci/*.h> 使)
# spark_file_glob(QSci_HEADERS src/qscint/src/Qsci/*.h src/include/pluginGl.h)
# set_target_properties(QSci PROPERTIES PUBLIC_HEADER "${QSci_HEADERS}")
# Notepad-- 的接口文件(从逻辑层面来看,目前已经在前面安装了接口文件,所以此部分不被使用)
# spark_file_glob(Notepad_HEADERS src/include/pluginGl.h)
# set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${QSci_HEADERS}")
# QSci
install(TARGETS ${PROJECT_NAME} QSci
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${NOTEPAD_PLUGIN_LIBDIR}
ARCHIVE DESTINATION ${NOTEPAD_PLUGIN_LIBDIR}
PUBLIC_HEADER DESTINATION ${NOTEPAD_PLUGIN_INCLUDEDIR}
)
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
endif(CMAKE_HOST_WIN32)

View File

@ -0,0 +1,80 @@
if(CMAKE_HOST_WIN32)
include(cmake/SparkInstallMacrosConfig.cmake)
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
#
# set(CMAKE_INSTALL_PREFIX "/usr") # Linux Windows 使
set(NOTEPAD_PLUGIN NotepadPlugin)
# CMake
set(NOTEPAD_PLUGIN_CONFIG ${NOTEPAD_PLUGIN}Config.cmake)
# CMake
set(NOTEPAD_PLUGIN_CORELIB QSci) # QSci QScintllia
# CMake Notepad-- QT5
# Qt
# add_notepad_plugin
set(NOTEPAD_BUILD_BY_QT5 TRUE)
set(NOTEPAD_BUILD_BY_QT6 FALSE)
# 定义在平台中插件应该安装的位置(待确定)
# CMake Notepad-- "插件安装目录(位置)"
set(NOTEPAD_PLUGIN_EXTERNAL_PLUGIN_INSTALL_DIRECTORY "")
# 使 NotepadPlugin.cmake.in
set(NOTEPAD_PLUGIN_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/${NOTEPAD_PLUGIN})
set(NOTEPAD_PLUGIN_LIBDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${NOTEPAD_PLUGIN})
# NOTEPAD_PLUGIN_INCLUDEDIR NOTEPAD_PLUGIN_LIBDIR cmake
configure_package_config_file(cmake/NotepadPluginConfig.cmake.in
${CMAKE_BINARY_DIR}/${NOTEPAD_PLUGIN_CONFIG}
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${NOTEPAD_PLUGIN})
# cmake
spark_install_file(${CMAKE_INSTALL_LIBDIR}/cmake/${NOTEPAD_PLUGIN}
${CMAKE_BINARY_DIR}/${NOTEPAD_PLUGIN_CONFIG})
#
spark_install_file(${NOTEPAD_PLUGIN_INCLUDEDIR}
src/include/pluginGl.h)
# Qsci
spark_install_directory(${NOTEPAD_PLUGIN_INCLUDEDIR}
src/qscint/src/Qsci)
#
spark_install_directory(${NOTEPAD_PLUGIN_INCLUDEDIR}/qscint
src/qscint/scintilla)
# QSci 的头文件(从插件实现层面来看,目前是使用*.h pluginGl.h
# Qsci *.h 使 #include <Qsci/*.h> 使)
# spark_file_glob(QSci_HEADERS src/qscint/src/Qsci/*.h src/include/pluginGl.h)
# set_target_properties(QSci PROPERTIES PUBLIC_HEADER "${QSci_HEADERS}")
# Notepad-- 的接口文件(从逻辑层面来看,目前已经在前面安装了接口文件,所以此部分不被使用)
# spark_file_glob(Notepad_HEADERS src/include/pluginGl.h)
# set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${QSci_HEADERS}")
# QSci
install(TARGETS ${PROJECT_NAME} QSci
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${NOTEPAD_PLUGIN_LIBDIR}
ARCHIVE DESTINATION ${NOTEPAD_PLUGIN_LIBDIR}
PUBLIC_HEADER DESTINATION ${NOTEPAD_PLUGIN_INCLUDEDIR}
)
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
# ------------------ INSTALL PLUGIN CONFIG ------------------ #
message(" -------- ${CMAKE_INSTALL_PREFIX} ---------- ")
message("${Qt5_DIR}/../../../bin/windeployqt")
# 1. WindowsQtDeploy
# Windows Qt
add_custom_target(windeployqt
COMMAND ${Qt5_DIR}/../../../bin/windeployqt ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.exe --compiler-runtime --verbose 2 --dir ${CMAKE_BINARY_DIR}/winqt/)
endif(CMAKE_HOST_WIN32)

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Name=@APP_NAME@
Name[zh_CN]=@APP_NAME_ZH_CN@
Exec=AppRun %F
Icon=default
Comment=@APP_COMMENT@
Terminal=true
Type=Application
Categories=@APP_CATEGORIES@
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-patch;text/x-adasrc;text/x-chdr;text/x-csrc;text/css;application/x-desktop;text/x-patch;text/x-fortran;text/html;text/x-java;text/x-tex;text/x-makefile;text/x-objcsrc;text/x-pascal;application/x-perl;application/x-perl;application/x-php;text/vnd.wap.wml;text/x-python;application/x-ruby;text/sgml;application/xml;model/vrml;image/svg+xml;application/json;

View File

@ -0,0 +1,12 @@
[Desktop Entry]
Version=1.0
Name=@APP_NAME@
Name[zh_CN]=@APP_NAME_ZH_CN@
Comment=@APP_COMMENT@
Type=@APP_TYPE@
Exec=@APP_EXECUTE_PATH@
Icon=@APP_EXECUTE_ICON_PATH@
Categories=@APP_CATEGORIES@
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-patch;text/x-adasrc;text/x-chdr;text/x-csrc;text/css;application/x-desktop;text/x-patch;text/x-fortran;text/html;text/x-java;text/x-tex;text/x-makefile;text/x-objcsrc;text/x-pascal;application/x-perl;application/x-perl;application/x-php;text/vnd.wap.wml;text/x-python;application/x-ruby;text/sgml;application/xml;model/vrml;image/svg+xml;application/json;
# Generated from the DesktopGenerater component of the z-Tools toolkit

47
linux-appimage.mk Normal file
View File

@ -0,0 +1,47 @@
# Linux Appimage - 通用 Linux 平台 Appimage 构建方案
include linux-universal.mk
CPUS=$(shell nproc)
builddir := build/linux-appimage
# sourcedir := .
# CMAKE_DEBUG := -DCMAKE_BUILD_TYPE=Debug
# CMAKE_RELEASE := -DCMAKE_BUILD_TYPE=Release
CMAKE_OPTIONS := -DUSE_LINUX_APPIMAGE=ON $(CMAKE_OPTIONS)
# -------------------------------- Appimage Build Tools -------------------------------- #
# Appimage 的构建流 --
# 在 Makefile 进行构建目标构建 Appimage (要求提供工具的绝对路径然后可依次进行linuxdeployqt, genrate-appimage)
# 来自于 https://github.com/probonopd/linuxdeployqt 的 linuxdeployqt
# 来自于 https://github.com/AppImage/AppImageKit 的 appimagetool
# 来自于 https://gitlink.org.cn/zinface/bundle-linuxdeployqt.git 托管存储的工具
# 或指定你所想存放克隆项目的位置
BUNDLE_LINUXDEPLOYQT := $(shell pwd)/$(builddir)/bundle-linuxdeployqt
download-bundle-linuxdeploytools:
-git clone https://gitlink.org.cn/zinface/bundle-linuxdeployqt.git $(BUNDLE_LINUXDEPLOYQT)
LINUXDEPLOYQT := "$(BUNDLE_LINUXDEPLOYQT)/linuxdeployqt-continuous-x86_64.AppImage"
APPIMAGETOOL := "$(BUNDLE_LINUXDEPLOYQT)/appimagetool-x86_64.AppImage"
# 追加 Appimagetool、linuxdeployqt 构建配置
CMAKE_OPTIONS := -DLINUXDEPLOYQT=$(LINUXDEPLOYQT) -DAPPIMAGETOOL=$(APPIMAGETOOL) $(CMAKE_OPTIONS)
linuxdeploy: download-bundle-linuxdeploytools
cmake -B$(builddir) $(CMAKE_OPTIONS)
cmake --build $(builddir) -- linuxdeploy
genrate-appimage:
cmake -B$(builddir) $(CMAKE_OPTIONS)
cmake --build $(builddir) -- appimage
package: linux-universal-release linuxdeploy genrate-appimage
linux-build-options:
@echo $(CMAKE_OPTIONS)
# 此配置为构建 linux Appimage 通用版本构建

19
linux-debian.mk Normal file
View File

@ -0,0 +1,19 @@
# Linux Debian - 通用 Linux 平台 Debian 构建方案
include linux-universal.mk
CPUS=$(shell nproc)
builddir := build/linux-debian
# sourcedir := .
# CMAKE_DEBUG := -DCMAKE_BUILD_TYPE=Debug
# CMAKE_RELEASE := -DCMAKE_BUILD_TYPE=Release
CMAKE_OPTIONS := -DUSE_LINUX_DEBIAN=ON $(CMAKE_OPTIONS)
package: linux-universal-release
make -C $(builddir) package
linux-build-options:
@echo $(CMAKE_OPTIONS)
# 此配置为构建 linux debian 通用版本构建

21
linux-universal.mk Normal file
View File

@ -0,0 +1,21 @@
# Linux Universal - 通用 Linux 平台 构建方案
CPUS=$(shell nproc)
builddir := build/linux-universal
sourcedir := .
CMAKE_DEBUG := -DCMAKE_BUILD_TYPE=Debug
CMAKE_RELEASE := -DCMAKE_BUILD_TYPE=Release
CMAKE_OPTIONS := -DUSE_LINUX_UNIVERSAL=ON
linux-universal:
cmake -B$(builddir) $(CMAKE_OPTIONS) $(CMAKE_DEBUG)
cmake --build $(builddir) -- -j$(CPUS)
linux-universal-release:
cmake -B$(builddir) $(CMAKE_OPTIONS) $(CMAKE_RELEASE)
cmake --build $(builddir) -- -j$(CPUS)
# 此配置为构建 linux 通用版本构建

51
linux-uos.mk Normal file
View File

@ -0,0 +1,51 @@
# 独立 Linux 平台的 Uos 构建
include linux-universal.mk
# 覆盖 linux-universal.mk 中定义的部分
linux-universal:
@echo "此目标不应该由 UOS 配方构建"
linux-universal-release:
@echo "此目标不应该由 UOS 配方构建"
CPUS=$(shell nproc)
builddir := build/linux-uos
# sourcedir := .
# CMAKE_DEBUG := -DCMAKE_BUILD_TYPE=Debug
# CMAKE_RELEASE := -DCMAKE_BUILD_TYPE=Release
CMAKE_OPTIONS := -DUSE_LINUX_UOS=ON
linux-uos:
cmake -B$(builddir) $(CMAKE_OPTIONS) $(CMAKE_DEBUG)
cmake --build build -- -j$(CPUS)
linux-uos-release:
cmake -B$(builddir) $(CMAKE_OPTIONS) $(CMAKE_RELEASE)
cmake --build build -- -j$(CPUS)
package:
cmake -B$(builddir) $(CMAKE_OPTIONS) $(CMAKE_RELEASE)
cmake --build $(builddir) -- -j$(CPUS) package
package-contents:
-cd $(builddir)/_CPack_Packages/Linux/DEB/ && find
package-contents-tree:
-tree $(builddir)/_CPack_Packages/Linux/DEB/
# 此配置为构建 linux 通用版本构建
# 一次系统检察
UOS_OS_ID=$(shell lsb_release -si)
ifneq ($(UOS_OS_ID),Uos)
linux-uos:
@echo "此目标不应该由 $(UOS_OS_ID) 来构建 Uos 配方, 否则实际 Uos 系统可能由于 Qt 版本过低将无法使用."
linux-uos-release:
@echo "此目标不应该由 $(UOS_OS_ID) 来构建 Uos 配方, 否则实际 Uos 系统可能由于 Qt 版本过低将无法使用."
package:
@echo "此目标不应该由 $(UOS_OS_ID) 来构建 Uos 配方, 否则实际 Uos 系统可能由于 Qt 版本过低将无法使用."
endif
# repo: 要求使用 Uos 平台来进行独立 Linux 平台的 Uos 构建

View File

@ -1,42 +1,14 @@
CPUS=$(shell nproc)
CALENDAR=$(shell date '+%Y%m%d')
OSID=$(shell lsb_release -si)
OSRELEASE=$(shell lsb_release -sr)
SUFFIX=
ifneq ("$(OSID)", "")
SUFFIX=_$(OSID)$(OSRELEASE)
endif
Msg := 'Build with the following configuration:'
One := '1. make -f linux-universal.mk'
Two := '2. make -f linux-debian.mk package'
Three := '3. make -f linux-appimage.mk package'
Four := '4. make -f linux-uos.mk package'
PROJECT_NAME=notepad--
PACKAGE_NAME=com.hmja.notepad
all:
mkdir -p build
cd build && cmake ..
cd build && make -j$(CPUS)
run: all
exec $(shell find build/ -maxdepth 1 -type f -executable | grep $(PROJECT_NAME))
debug:
mkdir -p build
cd build && cmake -DCMAKE_BUILD_TYPE=Debug ..
cd build && make -j$(CPUS)
release:
mkdir -p build
cd build && cmake -DCMAKE_BUILD_TYPE=Release -DPLUGIN_EN=off -DPACKAGE_SUFFIX="$(SUFFIX)" ..
cd build && make -j$(CPUS)
package: release
cd build && make package
tree build/_CPack_Packages/Linux/DEB/$(PROJECT_NAME)-*
# dpkg-deb --contents build/$(PROJECT_NAME)$(SUFFIX).deb
builddeps:
cd build && make builddeps
cpus:
@echo "CPU数量: $(CPUS)"
@echo $(Msg)
@echo $(One) "\n\t默认的通用 Linux 平台构建."
@echo $(Two) "\n\t通用 Linux 平台的 Debian deb 构建."
@echo $(Three) "\n\t通用 Linux 平台的 Appimage 构建."
@echo $(Four) "\n\t独立 Linux 平台的 Uos 构建."

4
macos.mk Normal file
View File

@ -0,0 +1,4 @@
Msg := 'Build with the following configuration:'
all:
@echo $(Msg)

56
patchs/README.md Normal file
View File

@ -0,0 +1,56 @@
# 补丁操作说明
> 用于 patchs/coconil-cmake-spark-deb-appimage.patch 补丁化构建方式
- 如何使用此补丁(测试本补丁)
> 注:此补丁仅可基于 master 分支进行构建
1. 在项目中使用此补丁?
```shell
git am --whitespace=fix < patchs/coconil-cmake-spark-deb-appimage.patch
```
2. 使用在线的方式直接使用补丁文件,并对纯净的 ndd 项目进行打补丁
```
# 克隆 notepad-- 项目
git clone https://gitee.com/cxasm/notepad--
cd notepad--
# 打在线补丁
curl -s https://gitee.com/zinface/coconil-notepad--/raw/cmake-patchs/patchs/coconil-cmake-spark-deb-appimage.patch | git am --whitespace=fix
make package # 构建 release 模式的 deb 包
make linuxdeploy # 构建出相关文件与自动组织 appimage 的结构目录
make genrate-appimage # 基于已 linuxdeploy 的结构目录进行打包为 Appimage
```
- 在应用补丁时,并对补丁进行的更新操作
```shell
# 切换到一个新的分支,即可开始进行补丁内的更新提交
git checkout -b coconil-cmake-spark-deb-appimage
# origin/dev 表示本仓库的 dev 开发分支
# 在应用过补丁,并产生了新的提交,即可在当前所在补丁更新分支内
# 相对基于 origin/master 为参考,目前所包含的所有最新提交内容将生成为一个补丁文件(其中尾部为增量更新)
git format-patch --stdout origin/master > patchs/coconil-cmake-spark-deb-appimage.patch
# 最后,回到你的原 master 分支,将被改变的补丁文件进行提交
# 在推送完成后,即可放弃你在 coconil-cmake-spark-deb-appimage 分支中所有产生的内容(因为都已经进入补丁)
```
- 一些注意事项
```shell
# 在不了解补丁时,你需要认识一下补丁,但补丁与补丁之间有着不同的用法
# 本 patchs/coconil-cmake-spark-deb-appimage.patch 补丁为支持 Appimage 构建
# 关于补丁的一些方面
# 1. 首先你需要了解 git 是什么,以及简单的使用
# 2. 你需要了解补丁是什么,以及简单的使用(应用补丁)
# 3. 你需要了解如何创建一个补丁,最基本的就是相对于旧目标分支,将本分区新增的提交进行导出为补丁
# 4. 你可能只会将单个提交、或多个提交导出为补丁,但这还不够,你需要具有绝对的对于补丁的理解
# 5. 对于不同的目的补丁,应该是多个 patch 文件存在的形式
# 6. 最后,不管在什么时候,你在应用补丁前,你应该考虑是否应用到当前分支?为什么不切换到一个新的分支呢?
```

View File

@ -0,0 +1,890 @@
From 34d458cf82810609bee2c85f1eb772bbef40a152 Mon Sep 17 00:00:00 2001
From: zinface <zinface@163.com>
Date: Mon, 6 Feb 2023 16:40:36 +0800
Subject: [PATCH] =?UTF-8?q?linux-qt6:=20=E6=B7=BB=E5=8A=A0=E7=94=A8?=
=?UTF-8?q?=E4=BA=8E=20Qt6=20=E7=BC=96=E8=AF=91=E7=9A=84=E7=9B=B8=E5=85=B3?=
=?UTF-8?q?=E5=8F=98=E6=9B=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/CmpareMode.cpp | 4 +-
src/Encode.cpp | 2 +-
src/RealCompare.pro | 44 ++++++++++----------
src/batchfindreplace.cpp | 6 +--
src/cceditor/ccnotepad.cpp | 64 ++++++++++++++--------------
src/columnedit.cpp | 4 +-
src/ctipwin.cpp | 2 +-
src/draglineedit.cpp | 1 +
src/encodeconvert.cpp | 2 +-
src/findresultwin.cpp | 26 +++++++-----
src/findwin.cpp | 4 +-
src/langstyledefine.cpp | 8 ++--
src/nddsetting.cpp | 2 +-
src/qscint/src/qscilexer.cpp | 4 +-
src/qscint/src/qscintilla.pro | 18 ++------
src/qtlangset.cpp | 78 +++++++++++++++++------------------
src/scintillaeditview.cpp | 8 ++--
src/userlexdef.cpp | 6 +--
18 files changed, 139 insertions(+), 144 deletions(-)
diff --git a/src/CmpareMode.cpp b/src/CmpareMode.cpp
index b8fb335..1245275 100755
--- a/src/CmpareMode.cpp
+++ b/src/CmpareMode.cpp
@@ -181,7 +181,7 @@ quint32 CmpareMode::readLineFromFileWithUnicodeLe(uchar* m_fileFpr, const int fi
else if (mode == 2)
{
QString temp = lineInfo.unicodeStr;
- md4.addData(temp.replace(QRegExp("\\s"), QString("")).toUtf8());
+ md4.addData(temp.replace(QRegularExpression("\\s"), QString("")).toUtf8());
}
};
@@ -429,7 +429,7 @@ CODE_ID CmpareMode::readLineFromFile(uchar* m_fileFpr, const int fileLength, con
else if (mode == 2)
{
QString temp = lineInfo.unicodeStr;
- md4.addData(temp.replace(QRegExp("\\s"), QString("")).toUtf8());
+ md4.addData(temp.replace(QRegularExpression("\\s"), QString("")).toUtf8());
}
};
diff --git a/src/Encode.cpp b/src/Encode.cpp
index 2164880..9fd8af1 100755
--- a/src/Encode.cpp
+++ b/src/Encode.cpp
@@ -1,6 +1,6 @@
<>#include "Encode.h"
#include <QTextCodec>
-#include <QtDebug>
+#include <QDebug>
/* 妫€鏌ュ瓧绗︿覆缂栫爜鐨勭被銆傜湅浜嗗ぇ閲忔枃鐚<E69E83>紝缁撹<E7BC81>濡備笅锛<E7AC85>
*濡傛灉鏄疷TF BOM鏍煎紡锛屾垨鑰匲NICODE鏍煎紡锛屽叾鏂囦欢澶撮儴鍓嶅嚑涓<E59A91>瓧鑺傦紙2-3锛夋湁涓€瀹氱殑鏍囪瘑銆傜敱姝ゆ爣璇嗙洿鎺ユ寜瀵瑰簲缂栫爜澶勭悊銆<E6828A>
diff --git a/src/RealCompare.pro b/src/RealCompare.pro
index 1035414..0da717e 100755
--- a/src/RealCompare.pro
+++ b/src/RealCompare.pro
@@ -3,9 +3,9 @@ LANGUAGE = C++
TARGET = Notepad--
-CONFIG += qt warn_on Debug
+CONFIG += qt warn_on
-QT += core gui widgets concurrent network xmlpatterns
+QT += core gui widgets concurrent network core5compat
HEADERS += *.h \
@@ -33,47 +33,47 @@ INCLUDEPATH += cceditor
TRANSLATIONS += realcompare_zh.ts
- if(contains(QMAKE_HOST.arch, x86_64)){
- CONFIG(Debug, Debug|Release){
+ if(contains(QMAKE_HOST.arch, x86_64|loongarch64)){
+ CONFIG(debug, debug|release){
DESTDIR = x64/Debug
- LIBS += -Lx64/Debug
- LIBS += -lqmyedit_qt5d
+ LIBS += -Lx64/Debug
+ LIBS += -lqmyedit_qt6d
}else{
DESTDIR = x64/Release
LIBS += -Lx64/Release
- LIBS += -lqmyedit_qt5
+ LIBS += -lqmyedit_qt6
#QMAKE_CXXFLAGS += /openmp
}
- }
+}
+
unix{
-if(CONFIG(debug, Debug|Release)){
- LIBS += -L/home/yzw/build/CCNotePad/x64/Debug -lqmyedit_qt5
+ if(CONFIG(debug, debug|release)){
+ LIBS += -L/home/yzw/build/CCNotePad/x64/Debug -lqmyedit_qt6
-QMAKE_CXXFLAGS += -fopenmp
-LIBS += -lgomp -lpthread
+ QMAKE_CXXFLAGS += -fopenmp
+ LIBS += -lgomp -lpthread
}else{
- LIBS += -L/home/yzw/build/CCNotePad/x64/Release -lqmyedit_qt5
+ LIBS += -L/home/yzw/build/CCNotePad/x64/Release -lqmyedit_qt6
DESTDIR = x64/Release
QMAKE_CXXFLAGS += -fopenmp -O2
LIBS += -lgomp -lpthread
}
- }
-
+}
RC_FILE += RealCompare.rc
+
unix
{
-
-INCLUDEPATH += $$PWD/.
-DEPENDPATH += $$PWD/.
+ INCLUDEPATH += $$PWD/.
+ DEPENDPATH += $$PWD/.
-unix:!macx: LIBS += -L$$PWD/x64/Release/ -lqmyedit_qt5
+ unix:!macx: LIBS += -L$$PWD/x64/Release/ -lqmyedit_qt6
-INCLUDEPATH += $$PWD/x64/Release
-DEPENDPATH += $$PWD/x64/Release
+ INCLUDEPATH += $$PWD/x64/Release
+ DEPENDPATH += $$PWD/x64/Release
-unix:!macx: PRE_TARGETDEPS += $$PWD/x64/Release/libqmyedit_qt5.a
+ unix:!macx: PRE_TARGETDEPS += $$PWD/x64/Release/libqmyedit_qt6.a
}
diff --git a/src/batchfindreplace.cpp b/src/batchfindreplace.cpp
index cb071c3..2602e3c 100755
--- a/src/batchfindreplace.cpp
+++ b/src/batchfindreplace.cpp
@@ -89,7 +89,7 @@ void BatchFindReplace::appendToFindReplaceTable(QStringList& findKeyword)
bool BatchFindReplace::tranInputKeyword(QString& findKeyWord, QStringList& outputKeyWordList)
{
//把空白字符,空格或者\t \r\n 等字符进行替换为空格
- QRegExp re("\\s");
+ QRegularExpression re("\\s");
findKeyWord.replace(re, QString(" "));
//再进行空格分隔处理
@@ -257,7 +257,7 @@ void BatchFindReplace::on_export()
if (!fileName.isEmpty())
{
QSettings setting(fileName, QSettings::IniFormat);
- setting.setIniCodec("UTF-8");
+// setting.setIniCodec("UTF-8");
int rowNums = ui.findReplaceTable->rowCount();
@@ -303,7 +303,7 @@ void BatchFindReplace::on_import()
QFileInfo fi(fileNameList[0]);
QSettings setting(fi.filePath(), QSettings::IniFormat);
- setting.setIniCodec("UTF-8");
+// setting.setIniCodec("UTF-8");
ui.findKeywordEdit->setPlainText(setting.value("find").toStringList().join(" "));
ui.replaceKeywordEdit->setPlainText(setting.value("replace").toStringList().join(" "));
diff --git a/src/cceditor/ccnotepad.cpp b/src/cceditor/ccnotepad.cpp
index 1f04879..5efe091 100755
--- a/src/cceditor/ccnotepad.cpp
+++ b/src/cceditor/ccnotepad.cpp
@@ -507,7 +507,7 @@ void initFileTypeLangMap()
//鎶婃柊璇<E69F8A>█tagName,鍜屽叧鑱攅xt鍗曠嫭瀛樻斁璧锋潵ext_tag.ini銆傚彧璇诲彇涓€涓<E282AC>枃浠跺氨鑳借幏鍙栨墍鏈夛紝閬垮厤閬嶅巻鎱<E5B7BB>
QString extsFile = QString("notepad/userlang/ext_tag");//ext_tag鏄<67>瓨鍦ㄦ墍鏈塼ag ext鐨勬枃浠<E69E83>
QSettings qs(QSettings::IniFormat, QSettings::UserScope, extsFile);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
QStringList keys = qs.allKeys();
//LangType lexId = L_USER_TXT;
@@ -3981,7 +3981,7 @@ void CCNotePad::initFileListDockWin()
}
});
m_dockFileListWin->setAttribute(Qt::WA_DeleteOnClose);
- m_dockFileListWin->layout()->setMargin(0);
+ m_dockFileListWin->layout()->setContentsMargins(0, 0, 0, 0);
m_dockFileListWin->layout()->setSpacing(0);
//鏆傛椂涓嶆彁渚涘叧闂<E58FA7>紝鍥犱负鍏抽棴鍚庨渶瑕佸悓姝ヨ彍鍗曠殑check鐘舵€<E888B5>
@@ -4312,7 +4312,7 @@ void CCNotePad::slot_actionSaveFile_toggle(bool /*checked*/)
if (pEdit != nullptr)
{
//濡傛灉鏄<E78189>柊寤虹殑鏂囦欢锛屽垯寮瑰嚭淇濆瓨瀵硅瘽妗嗭紝杩涜<E69DA9>淇濆瓨
- if (pEdit->property(Edit_File_New) >= 0)
+ if (pEdit->property(Edit_File_New).toString().length() >= 0)
{
QString filter("Text files (*.txt);;XML files (*.xml);;h files (*.h);;cpp file(*.cpp);;All types(*.*)");
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), QString(), filter);
@@ -4472,7 +4472,7 @@ void CCNotePad::slot_actionSaveAsFile_toggle(bool /*checked*/)
if (pEdit != nullptr)
{
//濡傛灉鏄<E78189>柊寤虹殑鏂囦欢锛屽垯寮瑰嚭淇濆瓨瀵硅瘽妗嗭紝杩涜<E69DA9>淇濆瓨
- if (pEdit->property(Edit_File_New) >= 0)
+ if (pEdit->property(Edit_File_New).toString().length() >= 0)
{
QString filter("Text files (*.txt);;XML files (*.xml);;h files (*.h);;cpp file(*.cpp);;All types(*.*)");
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File As ..."),QString(), filter);
@@ -4763,7 +4763,7 @@ void CCNotePad::saveTempFile(ScintillaEditView* pEdit,int index, QSettings& qs)
return;
}
- QVariant v = pEdit->property(Edit_Text_Change);
+ QVariant v = pEdit->property(Edit_Text_Change);
bool isDirty = v.toBool();
//涓嶈剰鍒欎笉闇€瑕佷繚瀛橈紝鐩存帴璺宠繃銆備笉鑴忕殑鏂囦欢锛屽彧璁板綍1涓<31>悕绉帮紝涓嬫<E6B693>鎵撳紑鏃舵仮澶<E4BBAE>
@@ -4773,7 +4773,7 @@ void CCNotePad::saveTempFile(ScintillaEditView* pEdit,int index, QSettings& qs)
//鎶婃枃浠惰<E6B5A0>褰曞埌qs涓<73>
//index涓€瀹氫笉鑳介噸澶嶃€俷琛ㄧず鏂板缓
//濡傛灉鏄<E78189>柊寤虹殑鏂囦欢
- if (pEdit->property(Edit_File_New) >= 0)
+ if (pEdit->property(Edit_File_New).toInt() >= 0)
{
qs.setValue(QString("%1").arg(index), QString("%1|1").arg(fileName));
}
@@ -4792,7 +4792,7 @@ void CCNotePad::saveTempFile(ScintillaEditView* pEdit,int index, QSettings& qs)
}
//濡傛灉鏄<E78189>柊寤虹殑鏂囦欢
- if (pEdit->property(Edit_File_New) >= 0)
+ if (pEdit->property(Edit_File_New).toInt() >= 0)
{
QString qsSavePath = qs.fileName();
@@ -4963,7 +4963,7 @@ void CCNotePad::closeAllFileStatic()
{
QString tempFileList = QString("notepad/temp/list");
QSettings qs(QSettings::IniFormat, QSettings::UserScope, tempFileList);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
qs.clear();
//浠庡熬閮ㄥ紑濮嬩緷娆¤皟鐢ㄤ繚瀛樻墍鏈夋枃浠躲€傛病淇<E79785>敼鐨勪笉闇€瑕佷繚瀛<E7B99A>
@@ -5047,7 +5047,7 @@ void CCNotePad::closeEvent(QCloseEvent * event)
#else
if ((s_restoreLastFile == 1) && m_isMainWindows)
{
- closeAllFileStatic();
+ closeAllFileStatic();
m_isQuitCancel = false;
}
else
@@ -5094,9 +5094,9 @@ void CCNotePad::closeEvent(QCloseEvent * event)
{
c->showNormal();
}
- qlonglong winId = (qlonglong)c->effectiveWinId();
- m_shareMem->lock();
- memcpy(m_shareMem->data(), &winId, sizeof(qlonglong));
+ qlonglong winId = (qlonglong)c->effectiveWinId();
+ m_shareMem->lock();
+ memcpy(m_shareMem->data(), &winId, sizeof(qlonglong));
m_shareMem->unlock();
c->m_isMainWindows = true;
}
@@ -5480,7 +5480,7 @@ void CCNotePad::initFindWindow()
//浠庡巻鍙叉煡鎵捐<E98EB5>褰曟枃浠朵腑鍔犺浇
QString searchHistory = QString("notepad/searchHistory");//鍘嗗彶鏌ユ壘璁板綍
QSettings qs(QSettings::IniFormat, QSettings::UserScope, searchHistory);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
if (qs.contains("keys"))
{
@@ -5545,7 +5545,7 @@ void CCNotePad::slot_saveSearchHistory()
//浠庡巻鍙叉煡鎵捐<E98EB5>褰曟枃浠朵腑鍔犺浇
QString searchHistory = QString("notepad/searchHistory");//鍘嗗彶鏌ユ壘璁板綍
QSettings qs(QSettings::IniFormat, QSettings::UserScope, searchHistory);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
if (s_findHistroy.count() > 15)
{
@@ -5772,7 +5772,7 @@ void CCNotePad::initFindResultDockWin()
m_dockSelectTreeWin = new QDockWidget(tr("Find result"), this);
connect(m_dockSelectTreeWin, &QDockWidget::dockLocationChanged, this, &CCNotePad::slot_findResultPosChangeed);
- m_dockSelectTreeWin->layout()->setMargin(0);
+ m_dockSelectTreeWin->layout()->setContentsMargins(0, 0, 0, 0);
m_dockSelectTreeWin->layout()->setSpacing(0);
//鏆傛椂涓嶆彁渚涘叧闂<E58FA7>紝鍥犱负鍏抽棴鍚庨渶瑕佸悓姝ヨ彍鍗曠殑check鐘舵€<E888B5>
@@ -6573,7 +6573,7 @@ bool CCNotePad::eventFilter(QObject * watched, QEvent * event)
}
return false;
}
-
+
#ifdef Q_OS_WIN
static const ULONG_PTR CUSTOM_TYPE = 10000;
@@ -6581,16 +6581,16 @@ static const ULONG_PTR OPEN_NOTEPAD_TYPE = 10001;
bool CCNotePad::nativeEvent(const QByteArray & eventType, void * message, long * result)
{
- MSG *param = static_cast<MSG *>(message);
-
- switch (param->message)
- {
- case WM_COPYDATA:
- {
- COPYDATASTRUCT *cds = reinterpret_cast<COPYDATASTRUCT*>(param->lParam);
- if (cds->dwData == CUSTOM_TYPE)
- {
- QString openFilePath = QString::fromUtf8(reinterpret_cast<char*>(cds->lpData), cds->cbData);
+ MSG *param = static_cast<MSG *>(message);
+
+ switch (param->message)
+ {
+ case WM_COPYDATA:
+ {
+ COPYDATASTRUCT *cds = reinterpret_cast<COPYDATASTRUCT*>(param->lParam);
+ if (cds->dwData == CUSTOM_TYPE)
+ {
+ QString openFilePath = QString::fromUtf8(reinterpret_cast<char*>(cds->lpData), cds->cbData);
int retIndex = findFileIsOpenAtPad(openFilePath);
if (-1 == retIndex)
@@ -6622,9 +6622,9 @@ bool CCNotePad::nativeEvent(const QByteArray & eventType, void * message, long *
this->activateWindow();
- *result = 1;
- return true;
- }
+ *result = 1;
+ return true;
+ }
else if (cds->dwData == OPEN_NOTEPAD_TYPE)
{
activateWindow();
@@ -6632,8 +6632,8 @@ bool CCNotePad::nativeEvent(const QByteArray & eventType, void * message, long *
*result = 1;
return true;
- }
- }
+ }
+ }
}
return QWidget::nativeEvent(eventType, message, result);
@@ -7124,7 +7124,7 @@ int CCNotePad::restoreLastFiles()
QString tempFileList = QString("notepad/temp/list");
QSettings qs(QSettings::IniFormat, QSettings::UserScope, tempFileList);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
QStringList fileList = qs.allKeys();
//浠庡皬鍒板ぇ鎺掑簭涓€涓<E282AC>
diff --git a/src/columnedit.cpp b/src/columnedit.cpp
index 50fd9ae..aaf93f1 100755
--- a/src/columnedit.cpp
+++ b/src/columnedit.cpp
@@ -216,13 +216,13 @@ void ColumnEdit::slot_ok()
{
QByteArray s_space(cursorCol - lineEndCol, ' ');
lineData.append(s_space);
- lineData.append(text);
+ lineData.append(text.toLatin1());
}
else
{
int posAbs2Start = pEdit->execute(SCI_FINDCOLUMN, i, cursorCol);
int posRelative2Start = posAbs2Start - lineBegin;
- lineData.insert(posRelative2Start, text);
+ lineData.insert(posRelative2Start, text.toLatin1());
}
pEdit->SendScintilla(SCI_SETTARGETRANGE, lineBegin, lineEnd);
diff --git a/src/ctipwin.cpp b/src/ctipwin.cpp
index 9412777..5bf16a9 100755
--- a/src/ctipwin.cpp
+++ b/src/ctipwin.cpp
@@ -9,7 +9,7 @@ CTipWin::CTipWin(QWidget *parent)
this->setWindowFlags(Qt::ToolTip);
QPalette palette(this->palette());
- palette.setColor(QPalette::Background, QColor(0xfff29d));
+ palette.setColor(QPalette::Window, QColor(0xfff29d));
this->setPalette(palette);
}
diff --git a/src/draglineedit.cpp b/src/draglineedit.cpp
index c21f3de..d8a8513 100755
--- a/src/draglineedit.cpp
+++ b/src/draglineedit.cpp
@@ -1,4 +1,5 @@
#include "draglineedit.h"
+#include <QFile>
DragLineEdit::DragLineEdit(QWidget *parent)
: QLineEdit(parent)
diff --git a/src/encodeconvert.cpp b/src/encodeconvert.cpp
index c17022e..7bbcfc5 100755
--- a/src/encodeconvert.cpp
+++ b/src/encodeconvert.cpp
@@ -11,7 +11,7 @@
#include <QtConcurrent>
#include <QInputDialog>
#include <QDragEnterEvent>
-
+#include <QTextCodec>
const int ITEM_CODE = Qt::UserRole + 1;
diff --git a/src/findresultwin.cpp b/src/findresultwin.cpp
index 7d86701..ad01b46 100755
--- a/src/findresultwin.cpp
+++ b/src/findresultwin.cpp
@@ -5,7 +5,7 @@
#include <QTreeWidgetItem>
#include <QStyleFactory>
#include <QToolButton>
-#include <qtreeview.h>
+#include <QTreeView>>
#include <QStandardItem>
#include <QStandardItemModel>
#include <QClipboard>
@@ -151,8 +151,8 @@ void FindResultWin::slot_selectAll()
QModelIndex pMi = curSelItem.parent();
if (pMi.isValid())
{
- curSelItem = pMi;
-}
+ curSelItem = pMi;
+ }
else
{
break;
@@ -176,12 +176,13 @@ void FindResultWin::slot_selectAll()
//閬嶅巻涓嬮潰鐨勫瓙鑺傜偣
int i = 0;
QModelIndex childMi;
- childMi = sectionItem.child(i, 0);
+ const QAbstractItemModel *const sectionItemModel = sectionItem.model();
+ childMi = sectionItemModel->index(i, 0);
while (childMi.isValid())
{
++i;
ui.resultTreeView->selectionModel()->select(childMi, QItemSelectionModel::Select);
- childMi = sectionItem.child(i, 0);
+ childMi = sectionItemModel->index(i, 0);
}
return i+1;
};
@@ -189,17 +190,20 @@ void FindResultWin::slot_selectAll()
QModelIndex rootItem = firstRootItem;
int j = 0;
int selectCount = 0;
+ const QAbstractItemModel *const rootItemModel = rootItem.model();
+ const QAbstractItemModel *const firstRootItemModel = firstRootItem.model();
+
while (rootItem.isValid())
{
//閬嶅巻鏍硅妭鐐逛笅闈㈡瘡涓€涓猻ection
{
int i = 0;
- QModelIndex section = rootItem.child(i, 0);
+ QModelIndex section = rootItemModel->index(i, 0);
while (section.isValid() && !section.data(ResultItemEditor).isNull())
{
++i;
selectCount += selectSection(section);
- section = firstRootItem.child(i, 0);
+ section = firstRootItemModel->index(i, 0);
}
}
@@ -223,12 +227,12 @@ void FindResultWin::slot_selectSection()
//閬嶅巻涓嬮潰鐨勫瓙鑺傜偣
int i = 0;
QModelIndex childMi;
- childMi = sectionItem.child(i, 0);
+ childMi = sectionItem.model()->index(i, 0);
while (childMi.isValid())
{
++i;
ui.resultTreeView->selectionModel()->select(childMi, QItemSelectionModel::Select);
- childMi = sectionItem.child(i, 0);
+ childMi = sectionItem.model()->index(i, 0);
}
return i+1;
};
@@ -420,7 +424,7 @@ QString FindResultWin::highlightFindText(FindRecord& record)
}
src = QString("<font style='background-color:#ffffbf'>%1</font>").arg(QString(utf8bytes.mid(targetStart, targetLens)).toHtmlEscaped());
tail = QString(utf8bytes.mid(tailStart));
- if (tail > MAX_TAIL_LENGTH)
+ if (tail.size() > MAX_TAIL_LENGTH)
{
tail = (tail.mid(0, MAX_TAIL_LENGTH) + "...").toHtmlEscaped();
}
@@ -454,7 +458,7 @@ QString FindResultWin::highlightFindText(FindRecord& record)
src = QString("<font style='font-weight:bold;color:#ffaa00'>%1</font>").arg(QString(utf8bytes.mid(targetStart, targetLens)).toHtmlEscaped());
QString tailContens = QString(utf8bytes.mid(tailStart));
- if (tailContens > MAX_TAIL_LENGTH)
+ if (tailContens.size() > MAX_TAIL_LENGTH)
{
tailContens = (tailContens.mid(0, MAX_TAIL_LENGTH) + "...").toHtmlEscaped();
}
diff --git a/src/findwin.cpp b/src/findwin.cpp
index 7a55059..8fe891e 100755
--- a/src/findwin.cpp
+++ b/src/findwin.cpp
@@ -559,8 +559,8 @@ bool readBase(const QChar * str, int * value, int base, int size)
current = str[i];
if (current >= 'A')
{
- current = current.digitValue() & 0xdf;
- current = current.digitValue() - ('A' - '0' - 10);
+ current = static_cast<QChar>(current.digitValue() & 0xdf);
+ current = static_cast<QChar>(current.digitValue() - ('A' - '0' - 10));
}
else if (current > '9')
return false;
diff --git a/src/langstyledefine.cpp b/src/langstyledefine.cpp
index 2df3a4f..f667f09 100755
--- a/src/langstyledefine.cpp
+++ b/src/langstyledefine.cpp
@@ -30,7 +30,7 @@ bool LangStyleDefine::readLangSetFile(QString langName, bool isLoadToUI)
{
QString userLangFile = QString("notepad/userlang/%1").arg(langName);//鑷<>畾涔夎<E6B694>瑷€涓<E282AC>笉鑳芥湁.瀛楃<E7809B>锛屽惁鍒欏彲鑳芥湁閿欙紝鍚庣画瑕佹<E79195><EFBFBD>
QSettings qs(QSettings::IniFormat, QSettings::UserScope, userLangFile);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
qDebug() << qs.fileName();
if (!qs.contains("mz"))
@@ -160,7 +160,7 @@ void LangStyleDefine::slot_save()
//鎶婃柊璇<E69F8A>█tagName,鍜屽叧鑱攅xt鍗曠嫭瀛樻斁璧锋潵銆傚悗闈㈠彧璇诲彇涓€涓<E282AC>枃浠跺氨鑳借幏鍙栨墍鏈夛紝閬垮厤閬嶅巻鎱<E5B7BB>
QString extsFile = QString("notepad/userlang/ext_tag");//ext_tag鏄<67>瓨鍦ㄦ墍鏈塼ag ext鐨勬枃浠<E69E83>
QSettings qs(QSettings::IniFormat, QSettings::UserScope, extsFile);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
QStringList extList = ui.extNameLe->text().trimmed().split(" ");
extList.append(QString::number(motherLangs)); //鏈€鍚庝竴涓<E7ABB4>槸mother lexer
@@ -201,7 +201,7 @@ void LangStyleDefine::slot_delete()
{
QString userLangFile = QString("notepad/userlang/%1").arg(name);//鑷<>畾涔夎<E6B694>瑷€涓<E282AC>笉鑳芥湁.瀛楃<E7809B>锛屽惁鍒欏彲鑳芥湁閿欙紝鍚庣画瑕佹<E79195><EFBFBD>
QSettings qs(QSettings::IniFormat, QSettings::UserScope, userLangFile);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
//鍒犻櫎userlang涓嬮潰鐨則ag.ini
QFile::remove(qs.fileName());
@@ -211,7 +211,7 @@ void LangStyleDefine::slot_delete()
//鎶婃柊璇<E69F8A>█鍦╡xt_tag涓<67>殑鍏宠仈鏂囦欢璁板綍涔熷垹闄<E59EB9>
QString extsFile = QString("notepad/userlang/ext_tag");//ext_tag鏄<67>瓨鍦ㄦ墍鏈塼ag ext鐨勬枃浠<E69E83>
QSettings qs(QSettings::IniFormat, QSettings::UserScope, extsFile);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
QStringList extList = qs.value(name).toStringList();
//鏇存柊褰撳墠ExtLexerManager::getInstance()銆傚<E98A86>鏋滀笉鏇存柊锛屽氨瑕侀噸鍚<E599B8>蒋浠舵墠鑳界敓鏁<E69593>
diff --git a/src/nddsetting.cpp b/src/nddsetting.cpp
index ed20f73..7e2070a 100755
--- a/src/nddsetting.cpp
+++ b/src/nddsetting.cpp
@@ -50,7 +50,7 @@ void NddSetting::init()
QString qsSetPath = qs.fileName();
s_nddSet = new QSettings(QSettings::IniFormat, QSettings::UserScope, settingDir);
- s_nddSet->setIniCodec("UTF-8");
+// s_nddSet->setIniCodec("UTF-8");
bool initOk = true;
auto initNddSet = []() {
diff --git a/src/qscint/src/qscilexer.cpp b/src/qscint/src/qscilexer.cpp
index b49fdc5..f21fff8 100755
--- a/src/qscint/src/qscilexer.cpp
+++ b/src/qscint/src/qscilexer.cpp
@@ -896,7 +896,7 @@ const char* QsciLexer::getUserDefineKeywords()
QString userLangFile = QString("notepad/userlang/%1").arg(m_tagName);//鑷<>畾涔夎<E6B694>瑷€涓<E282AC>笉鑳芥湁.瀛楃<E7809B>锛屽惁鍒欏彲鑳芥湁閿欙紝鍚庣画瑕佹<E79195><EFBFBD>
QSettings qs(QSettings::IniFormat, QSettings::UserScope, userLangFile);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
if (!qs.contains("mz"))
{
@@ -948,4 +948,4 @@ void QsciLexer::setCommentEnd(QByteArray commentEnd)
void QsciLexer::setCurThemes(int themesId)
{
m_themesId = themesId;
-}
\ No newline at end of file
+}
diff --git a/src/qscint/src/qscintilla.pro b/src/qscint/src/qscintilla.pro
index 2704d72..9ef4520 100755
--- a/src/qscint/src/qscintilla.pro
+++ b/src/qscint/src/qscintilla.pro
@@ -21,24 +21,14 @@
!win32:VERSION = 15.1.0
TEMPLATE = lib
-CONFIG += qt warn_off thread exceptions hide_symbols debug staticlib
+CONFIG += qt warn_off thread exceptions hide_symbols staticlib
CONFIG(debug, debug|release) {
- mac: {
- TARGET = qmyedit_qt$${QT_MAJOR_VERSION}_debug
- } else {
- win32: {
- TARGET = qmyedit_qt$${QT_MAJOR_VERSION}d
- } else {
- TARGET = qmyedit_qt$${QT_MAJOR_VERSION}
- }
- }
-
- DESTDIR = ../../x64/Debug
+ TARGET = qmyedit_qt$${QT_MAJOR_VERSION}
+ DESTDIR = ../../x64/Debug
} else {
TARGET = qmyedit_qt$${QT_MAJOR_VERSION}
-
- DESTDIR = ../../x64/Release
+ DESTDIR = ../../x64/Release
}
macx:!CONFIG(staticlib) {
diff --git a/src/qtlangset.cpp b/src/qtlangset.cpp
index e88d132..99b6258 100755
--- a/src/qtlangset.cpp
+++ b/src/qtlangset.cpp
@@ -36,8 +36,8 @@ enum LangType {
// Don't use L_JS, use L_JAVASCRIPT instead
// The end of enumated language type, so it should be always at the end
L_EXTERNAL = 100, L_USER_DEFINE = 200
-};
-#endif
+};
+#endif
//static const QColor blackColor(Qt::black);
//static const QColor lightColor(0xdedede);
@@ -421,14 +421,14 @@ void QtLangSet::updateAllLangeStyleWithGlobal(GLOBAL_STYLE_SET flag)
QsciLexer *pLexer = ScintillaEditView::createLexer(index);
if (nullptr != pLexer)
{
-
+
switch (flag)
{
case GLOBAL_FONT:
{
- for (int i = 0; i <= 255; ++i)
- {
- if (!pLexer->description(i).isEmpty())
+ for (int i = 0; i <= 255; ++i)
+ {
+ if (!pLexer->description(i).isEmpty())
{
oldfont = pLexer->font(i);
oldfont.setFamily(m_curStyleData.font.family());
@@ -439,9 +439,9 @@ void QtLangSet::updateAllLangeStyleWithGlobal(GLOBAL_STYLE_SET flag)
break;
case GLOBAL_FONT_SIZE:
{
- for (int i = 0; i <= 255; ++i)
- {
- if (!pLexer->description(i).isEmpty())
+ for (int i = 0; i <= 255; ++i)
+ {
+ if (!pLexer->description(i).isEmpty())
{
oldfont = pLexer->font(i);
oldfont.setPointSize(m_curStyleData.font.pointSize());
@@ -452,9 +452,9 @@ void QtLangSet::updateAllLangeStyleWithGlobal(GLOBAL_STYLE_SET flag)
break;
case GLOBAL_FONT_BOLD:
{
- for (int i = 0; i <= 255; ++i)
- {
- if (!pLexer->description(i).isEmpty())
+ for (int i = 0; i <= 255; ++i)
+ {
+ if (!pLexer->description(i).isEmpty())
{
oldfont = pLexer->font(i);
oldfont.setBold(m_curStyleData.font.bold());
@@ -465,9 +465,9 @@ void QtLangSet::updateAllLangeStyleWithGlobal(GLOBAL_STYLE_SET flag)
break;
case GLOBAL_FONT_UNDERLINE:
{
- for (int i = 0; i <= 255; ++i)
- {
- if (!pLexer->description(i).isEmpty())
+ for (int i = 0; i <= 255; ++i)
+ {
+ if (!pLexer->description(i).isEmpty())
{
oldfont = pLexer->font(i);
oldfont.setUnderline(m_curStyleData.font.underline());
@@ -478,9 +478,9 @@ void QtLangSet::updateAllLangeStyleWithGlobal(GLOBAL_STYLE_SET flag)
break;
case GLOBAL_FONT_ITALIC:
{
- for (int i = 0; i <= 255; ++i)
- {
- if (!pLexer->description(i).isEmpty())
+ for (int i = 0; i <= 255; ++i)
+ {
+ if (!pLexer->description(i).isEmpty())
{
oldfont = pLexer->font(i);
oldfont.setItalic(m_curStyleData.font.italic());
@@ -503,10 +503,10 @@ void QtLangSet::updateAllLangeStyleWithGlobal(GLOBAL_STYLE_SET flag)
break;
default:
break;
- }
+ }
saveLangeSet(pLexer);
- }
+ }
delete pLexer;
}
}
@@ -537,7 +537,7 @@ void QtLangSet::restoreOriginLangAllStyle()
{
QFile::remove(qs.fileName());
}
-
+
delete pLexer;
pLexer = nullptr;
}
@@ -578,12 +578,12 @@ void QtLangSet::restoreOriginLangOneStyle(GLOBAL_STYLE_SET flag)
QsciLexer *pLexer = ScintillaEditView::createLexer(index);
QsciLexer *pOriginLexer = ScintillaEditView::createLexer(index,"",true);
if (nullptr != pLexer)
- {
- for (int i = 0; i <= 255; ++i)
- {
- if (!pLexer->description(i).isEmpty())
- {
-
+ {
+ for (int i = 0; i <= 255; ++i)
+ {
+ if (!pLexer->description(i).isEmpty())
+ {
+
switch (flag)
{
case GLOBAL_FONT:
@@ -649,11 +649,11 @@ void QtLangSet::restoreOriginLangOneStyle(GLOBAL_STYLE_SET flag)
break;
default:
break;
- }
- }
+ }
+ }
}
saveLangeSet(pLexer);
- }
+ }
delete pLexer;
delete pOriginLexer;
}
@@ -795,7 +795,7 @@ bool QtLangSet::readLangSetFile(QString langName,QString &keyword, QString &moth
{
QString userLangFile = QString("notepad/userlang/%1").arg(langName);//自定义语言中不能有.字符,否则可能有错,后续要检查
QSettings qs(QSettings::IniFormat, QSettings::UserScope, userLangFile);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
//qDebug() << qs.fileName();
if (!qs.contains("mz"))
@@ -917,15 +917,15 @@ void QtLangSet::slot_itemSelect(QListWidgetItem *item)
ui.keywordTe->setPlainText(keyword);
ui.motherLangCb->setCurrentIndex(0);
- for (int i = 0; i <= 255; ++i)
- {
- QString desc = pLexer->description(i);
- if (!desc.isEmpty())
- {
+ for (int i = 0; i <= 255; ++i)
+ {
+ QString desc = pLexer->description(i);
+ if (!desc.isEmpty())
+ {
QListWidgetItem *itemtemp = new QListWidgetItem(desc);
- itemtemp->setData(Qt::UserRole, i);
- ui.styleListWidget->addItem(itemtemp);
- }
+ itemtemp->setData(Qt::UserRole, i);
+ ui.styleListWidget->addItem(itemtemp);
+ }
}
}
diff --git a/src/scintillaeditview.cpp b/src/scintillaeditview.cpp
index 60181dd..fac3648 100755
--- a/src/scintillaeditview.cpp
+++ b/src/scintillaeditview.cpp
@@ -2155,7 +2155,7 @@ void ScintillaEditView::changeCase(const TextCaseType & caseToConvert, QString&
else if (caseToConvert == TITLECASE_FORCE)
strToConvert[i] = strToConvert[i].toLower();
//An exception
- if ((i < 2) ? false : (strToConvert[i - 1] == L'\'' && (strToConvert[i - 2].isLetter())))
+ if ((i < 2) ? false : (strToConvert[i - 1] == QChar(L'\'') && (strToConvert[i - 2].isLetter())))
strToConvert[i] = strToConvert[i].toLower();
}
}
@@ -2183,11 +2183,11 @@ void ScintillaEditView::changeCase(const TextCaseType & caseToConvert, QString&
wasEolR = false;
wasEolN = false;
//An exception
- if (strToConvert[i] == L'i' &&
+ if (strToConvert[i] == static_cast<QChar>(L'i') &&
((i < 1) ? false : (strToConvert[i - 1].isSpace() || strToConvert[i - 1] == '(' || strToConvert[i - 1] == '"')) && \
((i + 1 == nbChars) ? false : (strToConvert[i + 1].isSpace() || strToConvert[i + 1] == '\'')))
{
- strToConvert[i] = L'I';
+ strToConvert[i] = static_cast<QChar>(L'I');
}
}
else if (strToConvert[i] == '.' || strToConvert[i] == '!' || strToConvert[i] == '?')
@@ -2856,7 +2856,7 @@ bool isUrlQueryDelimiter(QChar const c)
void scanToUrlEnd(QString & text, int textLen, int start, int* distance)
{
int p = start;
- QChar q = 0;
+ QChar q;
enum { sHostAndPath, sQuery, sQueryAfterDelimiter, sQueryQuotes, sQueryAfterQuotes, sFragment } s = sHostAndPath;
while (p < textLen)
{
diff --git a/src/userlexdef.cpp b/src/userlexdef.cpp
index 6b8c7d2..86e238b 100755
--- a/src/userlexdef.cpp
+++ b/src/userlexdef.cpp
@@ -24,7 +24,7 @@ bool UserLexDef::readUserSettings(QString langTagName)
QString userLangFile = QString("notepad/userlang/%1").arg(langTagName);
QSettings qs(QSettings::IniFormat, QSettings::UserScope, userLangFile);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
if (!qs.contains(QString("mz")))
{
@@ -93,13 +93,13 @@ bool UserLexDef::writeUserSettings(QString langTagName)
QString userLangFile = QString("notepad/userlang/%1").arg(langTagName);
QSettings qs(QSettings::IniFormat, QSettings::UserScope, userLangFile);
- qs.setIniCodec("UTF-8");
+// qs.setIniCodec("UTF-8");
qs.clear();
qs.setValue("mz", langTagName);
qs.setValue("mother", m_motherLang);
qs.setValue("ext", m_extTypes);
- qs.setValue("keyword", m_keyword.data());
+ qs.setValue("keyword", m_keyword.toStdString().c_str());
return true;
}
--
2.20.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
From 3dd815a0893c7200605ba0f3e0806e460d0b2be7 Mon Sep 17 00:00:00 2001
From: zinface <zinface@163.com>
Date: Sun, 5 Feb 2023 13:59:44 +0800
Subject: [PATCH] =?UTF-8?q?cmake-version:=20=E5=B0=86=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E9=99=8D=E5=88=B0=203.16=20=E4=BB=A5=E9=80=82=E7=94=A8?=
=?UTF-8?q?=E4=BA=8E=20cmake=20=E6=9E=84=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d990b1d..e86ba02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.22)
+cmake_minimum_required(VERSION 3.16)
project(notepad-- VERSION 1.22.0)
--
2.20.1

View File

@ -0,0 +1,38 @@
From afb95e9e995366874845f021d4fb7dd9d7d2fdd1 Mon Sep 17 00:00:00 2001
From: zinface <zinface@163.com>
Date: Thu, 2 Feb 2023 14:47:56 +0800
Subject: [PATCH] =?UTF-8?q?cmake-version:=20=E5=B0=86=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E9=99=8D=E5=88=B0=203.22=20=E4=BB=A5=E9=80=82=E7=94=A8?=
=?UTF-8?q?=E4=BA=8E=20cmake=20=E6=9E=84=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CMakeLists.txt | 2 +-
src/qscint/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fed2a51..dc957c3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.24)
+cmake_minimum_required(VERSION 3.22)
project(notepad-- VERSION 1.22.0)
set(CMAKE_AUTOMOC ON)
diff --git a/src/qscint/CMakeLists.txt b/src/qscint/CMakeLists.txt
index f132dc6..77f02f2 100644
--- a/src/qscint/CMakeLists.txt
+++ b/src/qscint/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.24)
+cmake_minimum_required(VERSION 3.22)
project(qscint CXX)
set(CMAKE_AUTOMOC ON)
--
2.20.1

View File

@ -0,0 +1,38 @@
From 3ced487bd23b92a6f35eb590123bc510c9e2429c Mon Sep 17 00:00:00 2001
From: zinface <zinface@163.com>
Date: Mon, 6 Feb 2023 21:13:23 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=A8=20Windows=20QtCreator=20?=
=?UTF-8?q?=E4=B8=AD=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=A4=84=E7=90=86=E5=AF=BC?=
=?UTF-8?q?=E8=87=B4=E7=BC=96=E8=AF=91=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/cceditor/ccnotepad.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/cceditor/ccnotepad.cpp b/src/cceditor/ccnotepad.cpp
index ae615be..b2071d3 100755
--- a/src/cceditor/ccnotepad.cpp
+++ b/src/cceditor/ccnotepad.cpp
@@ -983,11 +983,12 @@ int CCNotePad::runAsAdmin(const QString& filePath)
//}
QString argStr = QString("-muti %1").arg(filePath);
- std::basic_string<TCHAR> args = StringToWString(argStr.toStdString());
- size_t shellExecRes = (size_t)::ShellExecute(NULL, TEXT("runas"), nddFullPath, args.c_str(), TEXT("."), SW_SHOW);
+// std::basic_string<TCHAR> args = StringToWString(argStr.toStdString());
+// size_t shellExecRes = (size_t)::ShellExecute(NULL, TEXT("runas"), nddFullPath, args.c_str(), TEXT("."), SW_SHOW);
+ size_t shellExecRes = (size_t)::ShellExecute(NULL, TEXT("runas"), nddFullPath, argStr.toUtf8(), TEXT("."), SW_SHOW);
// If the function succeeds, it returns a value greater than 32. If the function fails,
- // it returns an error value that indicates the cause of the failure.
+ // it returns an error value that indicates the cause of the failure.
// https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx
if (shellExecRes < 32)
--
2.39.1.windows.1

View File

@ -16,13 +16,13 @@
struct ndd_proc_data
{
QString m_strPlugName; //插件名称 必选
QString m_strFilePath; //lib 插件的全局路径。必选。插件内部不用管,主程序传递下来
QString m_strComment; //插件说明
QString m_version; //版本号码。可选
QString m_auther;//作者名称。可选
int m_menuType;//菜单类型。0不使用二级菜单 1创建二级菜单
QMenu* m_rootMenu;//如果m_menuType = 1给出二级根菜单的地址。其他值nullptr
QString m_strPlugName; // [必选]插件名称
QString m_strFilePath; // [留空]插件的全局路径,主程序传递下来的路径
QString m_strComment; // [可选]插件说明
QString m_version; // [可选]版本号码
QString m_auther; // [可选]作者名称
int m_menuType; // [可选]菜单类型(0不使用二级菜单 1创建二级菜单)
QMenu* m_rootMenu; // [依赖]当 m_menuType = 1给出二级根菜单的地址(默认为 nullptr)
ndd_proc_data(): m_rootMenu(nullptr), m_menuType(0)
{
@ -35,3 +35,44 @@ typedef struct ndd_proc_data NDD_PROC_DATA;
typedef bool (*NDD_PROC_IDENTIFY_CALLBACK)(NDD_PROC_DATA* pProcData);
typedef void (*NDD_PROC_FOUND_CALLBACK)(NDD_PROC_DATA* pProcData, void* pUserData);
/***********在编译插件时提供的内容**************/
#ifdef NOTEPAD_PLUGIN_MANAGER
#if defined(Q_OS_WIN)
# if defined(NDD_EXPORTDLL)
# define NDD_EXPORT __declspec(dllexport)
# else
# define NDD_EXPORT __declspec(dllimport)
# endif
#endif
#include <Qsci/qsciscintilla.h>
#ifdef __cplusplus
extern "C" {
#endif
NDD_EXPORT bool NDD_PROC_IDENTIFY(NDD_PROC_DATA* pProcData);
NDD_EXPORT int NDD_PROC_MAIN(QWidget* pNotepad, const QString& strFileName, std::function<QsciScintilla* ()>getCurEdit);
#ifdef __cplusplus
}
#endif
#define NOTEPAD_PLUGIN_METADATA(name, version, author, comment, filepath)\
pProcData->m_strPlugName = QString(name); \
pProcData->m_version = QString(version); \
pProcData->m_strComment = QString(comment); \
pProcData->m_auther = QString(author); \
pProcData->m_strFilePath = QString(filepath); \
#define NOTEPAD_PLUGIN_IMPLEMENT(imp_class) \
imp_class *imp = new imp_class(pNotepad, getCurEdit()); \
//imp->setWindowFlag(Qt::Window); \
imp->show();
#endif //NOTEPAD_PLUGIN_MANAGER
/***********在编译插件时提供的内容**************/

View File

@ -37,14 +37,17 @@
// Define QSCINTILLA_MAKE_DLL to create a QScintilla shared library, or
// define QSCINTILLA_DLL to link against a QScintilla shared library, or define
// neither to either build or link against a static QScintilla library.
#define QSCINTILLA_DLL
// Bug: 在 Visual Studio 中引发无法构建的问题,此处被锁定构建为动态库
// Unassign as Q_DECL_IMPORT.
// #define QSCINTILLA_DLL
#if defined(QSCINTILLA_DLL)
#define QSCINTILLA_EXPORT Q_DECL_IMPORT
# define QSCINTILLA_EXPORT Q_DECL_IMPORT
#elif defined(QSCINTILLA_MAKE_DLL)
#define QSCINTILLA_EXPORT Q_DECL_EXPORT
# define QSCINTILLA_EXPORT Q_DECL_EXPORT
#else
#define QSCINTILLA_EXPORT
# define QSCINTILLA_EXPORT
#endif

31
windows-universal.mk Normal file
View File

@ -0,0 +1,31 @@
# windows-universal.mk
# Windows Universal - 通用 Windows 平台构建方案
builddir := build
sourcedir := .
CMAKE_DEBUG := -DCMAKE_BUILD_TYPE=Debug
CMAKE_RELEASE := -DCMAKE_BUILD_TYPE=Release
CMAKE_OPTIONS := -DUSE_WINDOWS_UNIVERSAL=ON
CMAKE_GENERATER := ""
CMAKE_UNIVERSAL_QT := $(CMAKE_OPTIONS) -DWINDOWS_DEPLOY_QT=ON
CMAKE_UNIVERSAL_QT5 := $(CMAKE_UNIVERSAL_QT) -DWINDOWS_DEPLOY_QT5=ON
CMAKE_UNIVERSAL_QT6 := $(CMAKE_UNIVERSAL_QT) -DWINDOWS_DEPLOY_QT6=ON
JOBS=$(shell nproc)
windows-universal:
cmake -B$(builddir) $(CMAKE_DEBUG) $(CMAKE_GENERATER) $(CMAKE_OPTIONS)
cmake --build $(builddir) -- -j$(JOBS)
windows-universal-release:
cmake -B$(builddir) $(CMAKE_RELEASE) $(CMAKE_GENERATER) $(CMAKE_OPTIONS)
cmake --build $(builddir) -- -j$(JOBS)
windows-universal-release-qt5:
cmake $(CMAKE_GENERATER) -B$(builddir) $(CMAKE_RELEASE) $(CMAKE_UNIVERSAL_QT5)
cmake --build $(builddir) -- -j$(JOBS)
windows-universal-release-qt6:
cmake $(CMAKE_GENERATER) -B$(builddir) $(CMAKE_RELEASE) $(CMAKE_UNIVERSAL_QT6)
cmake --build $(builddir) -- -j$(JOBS)

6
windows.mk Normal file
View File

@ -0,0 +1,6 @@
Msg := 'Build with the following configuration:'
One := '1. make -f windows-universal.mk'
all:
@echo -e $(Msg)
@echo -e $(One) "\n\tThe default Universal Windows platform build"