mirror of https://gitee.com/cxasm/notepad--.git
cmake-plugin: 调整 external-plugin 插件适配可扩展宏方案
This commit is contained in:
parent
cbd8d0e97b
commit
505bb25c0e
|
@ -7,6 +7,9 @@
|
|||
# external-plugin -> your plugin name
|
||||
|
||||
set(LOCAL_PLUGIN_NAME "external-plugin")
|
||||
set(LOCAL_PLUGIN_VERSION "0.1")
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/config.h.in plugin-config.h @ONLY)
|
||||
|
||||
# external-plugin 核心构建
|
||||
# 在模块化构建中,这个部分代表着构建 external-plugin 插件
|
||||
|
@ -55,6 +58,11 @@ endif(TRUE)
|
|||
|
||||
# ----------------- external-plugin 构建宏支持相关 ----------------- #
|
||||
|
||||
target_compile_definitions(${LOCAL_PLUGIN_NAME}
|
||||
# 构建插件时,自动引入的插件配置
|
||||
PRIVATE
|
||||
NOTEPAD_PLUGIN_DECLARE_PLUGIN_CONFIG)
|
||||
|
||||
if(WIN32 AND NOTEPAD_BUILD_BY_SHARED)
|
||||
# 在 Windows 中构建时,需要关注此库的构建形式,QScintilla 应该以何种方式编译
|
||||
target_compile_definitions(${LOCAL_PLUGIN_NAME}
|
||||
|
|
|
@ -6,6 +6,20 @@
|
|||
#include "ndd_plugin_implement.h"
|
||||
|
||||
|
||||
NOTEPAD_PLUGIN_METADATA_IDENTIFY_V1(u8"外部插件扩展测试", "0.1", "zinface", u8"基于 QMainWindow Ui 的插件", "");
|
||||
NOTEPAD_PLUGIN_METADATA_IDENTIFY_1 {
|
||||
USE_IDENTIFY_VARIABLES
|
||||
|
||||
NOTEPAD_PLUGIN_METADATA_IMPLEMENT_V1(NddPluginImplement, false);
|
||||
NOTEPAD_PLUGIN_METADATA(u8"外部插件扩展测试", PLUGIN_VERSION, "zinface", u8"基于 QMainWindow Ui 的插件", "")
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
NOTEPAD_PLUGIN_METADATA_IMPLEMENT_1 {
|
||||
USE_IMPLEMENT_VARIABLES
|
||||
|
||||
auto imp = new NddPluginImplement(s_pNotepad, s_getCurEdit());
|
||||
imp->setCurrentEditFunc(s_getCurEdit);
|
||||
imp->setMenuActions(s_pProcData.m_rootMenu);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue