From 0bd15fc7a8d7a8bc42e33a1f60bab8448e7e4303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E5=AE=87=E6=B8=85=E9=9F=B3?= <2422523675@qq.com> Date: Wed, 1 Mar 2023 22:19:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84HighLight=E7=89=B9=E6=80=A7?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WordsIDE/WordsIDE.pro | 7 +++++-- WordsIDE/appcore.cpp | 4 ++-- WordsIDE/appcore.h | 6 +++--- WordsIDE/design.md | 9 +++++++++ WordsIDE/keywordshighlighter.h | 4 ++-- WordsIDE/mainwindow.h | 2 +- WordsIDE/srcedit_storyboard.h | 2 +- WordsIDE/srcedit_storychain.h | 2 +- WordsIDE/srcedit_storyconcept.h | 2 +- WordsIDE/srcedit_storyunit.h | 2 +- WordsIDE/srcedit_storyvolume.h | 2 +- ...isiableprojectcontroller.cpp => vcontrol_project.cpp} | 2 +- .../{visiableprojectcontroller.h => vcontrol_project.h} | 0 13 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 WordsIDE/design.md rename WordsIDE/{visiableprojectcontroller.cpp => vcontrol_project.cpp} (99%) rename WordsIDE/{visiableprojectcontroller.h => vcontrol_project.h} (100%) diff --git a/WordsIDE/WordsIDE.pro b/WordsIDE/WordsIDE.pro index 9a97ba8..c63955a 100644 --- a/WordsIDE/WordsIDE.pro +++ b/WordsIDE/WordsIDE.pro @@ -38,7 +38,7 @@ SOURCES += \ storyconceptspresent.cpp \ storyunitspresent.cpp \ tools.cpp \ - visiableprojectcontroller.cpp \ + vcontrol_project.cpp \ xapplication.cpp HEADERS += \ @@ -62,7 +62,7 @@ HEADERS += \ storyconceptspresent.h \ storyunitspresent.h \ tools.h \ - visiableprojectcontroller.h \ + vcontrol_project.h \ xapplication.h TRANSLATIONS += \ @@ -95,3 +95,6 @@ else:unix: LIBS += -L$$OUT_PWD/../libParse/ -llibParse INCLUDEPATH += $$PWD/../libParse DEPENDPATH += $$PWD/../libParse + +DISTFILES += \ + design.md diff --git a/WordsIDE/appcore.cpp b/WordsIDE/appcore.cpp index 70499f5..fc83996 100644 --- a/WordsIDE/appcore.cpp +++ b/WordsIDE/appcore.cpp @@ -43,14 +43,14 @@ AppCore::AppCore(MainWindow *win, QObject *parent) } -void AppCore::registerHighlightType(Enhancement::HighlightDemand *base_type) +void AppCore::registerHighlightType(Enhancement::HighlightFeature *base_type) { render_types << base_type; } bool AppCore::isHighlightDemand(void *ins) const { - return render_types.contains((Enhancement::HighlightDemand*)ins); + return render_types.contains((Enhancement::HighlightFeature*)ins); } void AppCore::save() diff --git a/WordsIDE/appcore.h b/WordsIDE/appcore.h index e872e55..272da8f 100644 --- a/WordsIDE/appcore.h +++ b/WordsIDE/appcore.h @@ -9,7 +9,7 @@ class MainWindow; namespace Enhancement { - class HighlightDemand; + class HighlightFeature; } namespace MakeTools { @@ -51,7 +51,7 @@ namespace Core { AppCore(MainWindow *win, QObject *parent = nullptr); virtual ~AppCore() = default; - void registerHighlightType(Enhancement::HighlightDemand *base_type); + void registerHighlightType(Enhancement::HighlightFeature *base_type); bool isHighlightDemand(void* ins) const; /** @@ -81,7 +81,7 @@ namespace Core { Config::Configration *const global_config; Project::ProjectManager * current_project; QList present_types; - QList render_types; + QList render_types; MakeTools::StoryTool *const makes_core; diff --git a/WordsIDE/design.md b/WordsIDE/design.md new file mode 100644 index 0000000..343ca1c --- /dev/null +++ b/WordsIDE/design.md @@ -0,0 +1,9 @@ +# WordsIDE设计思路 + +## 简化软件架构,强化测试体验 +1. 界面、控制、模型相互分离: + * 界面UI:操作生成控制命令,图形化显示数据,响应数据模型内容 + * 提供控制台:控制台输入命令等价界面操作 + * 控制核心:解析控制命令,操作数据模型,提供控制命令记录功能,输出控制命令执行脚本 + * 数据模型:实现数据抽象与表达,数据载入与输出 + * 控制命令集:各种控制命令的文本序列化和反序列化 diff --git a/WordsIDE/keywordshighlighter.h b/WordsIDE/keywordshighlighter.h index 6e3da0d..d67d7ca 100644 --- a/WordsIDE/keywordshighlighter.h +++ b/WordsIDE/keywordshighlighter.h @@ -10,10 +10,10 @@ namespace Core { } namespace Enhancement { - class HighlightDemand + class HighlightFeature { public: - virtual ~HighlightDemand() = default; + virtual ~HighlightFeature() = default; virtual void contexBinding(Core::AppCore *app, Parse::Result::DocCore *core) = 0; virtual void renderRepeat() const = 0; diff --git a/WordsIDE/mainwindow.h b/WordsIDE/mainwindow.h index edfcac0..ebfdf6b 100644 --- a/WordsIDE/mainwindow.h +++ b/WordsIDE/mainwindow.h @@ -12,7 +12,7 @@ #include "messagepresent.h" #include "storychainspresent.h" #include "storyunitspresent.h" -#include "visiableprojectcontroller.h" +#include "vcontrol_project.h" #include "ContentPresent.h" #include "storyboardspresent.h" #include "storyconceptspresent.h" diff --git a/WordsIDE/srcedit_storyboard.h b/WordsIDE/srcedit_storyboard.h index 0ebbb96..a6852a5 100644 --- a/WordsIDE/srcedit_storyboard.h +++ b/WordsIDE/srcedit_storyboard.h @@ -9,7 +9,7 @@ namespace Components { class StoryboardSourceEdit : public Presents::ModeView, - public MakeTools::ContentPresent, public Enhancement::HighlightDemand + public MakeTools::ContentPresent, public Enhancement::HighlightFeature { public: StoryboardSourceEdit(); diff --git a/WordsIDE/srcedit_storychain.h b/WordsIDE/srcedit_storychain.h index 6668558..26533a9 100644 --- a/WordsIDE/srcedit_storychain.h +++ b/WordsIDE/srcedit_storychain.h @@ -14,7 +14,7 @@ namespace Components { /** * @brief Storychain婧愮爜缂栬緫鍣 */ class StorychainSourceEdit : public Presents::ModeView, - public MakeTools::ContentPresent, public Enhancement::HighlightDemand + public MakeTools::ContentPresent, public Enhancement::HighlightFeature { public: StorychainSourceEdit(); diff --git a/WordsIDE/srcedit_storyconcept.h b/WordsIDE/srcedit_storyconcept.h index bc9cbe2..3472b27 100644 --- a/WordsIDE/srcedit_storyconcept.h +++ b/WordsIDE/srcedit_storyconcept.h @@ -10,7 +10,7 @@ namespace Components { class StoryconceptSourceEdit : public Presents::ModeView, - public MakeTools::ContentPresent, public Enhancement::HighlightDemand + public MakeTools::ContentPresent, public Enhancement::HighlightFeature { public: StoryconceptSourceEdit(); diff --git a/WordsIDE/srcedit_storyunit.h b/WordsIDE/srcedit_storyunit.h index ee54258..2d118b2 100644 --- a/WordsIDE/srcedit_storyunit.h +++ b/WordsIDE/srcedit_storyunit.h @@ -10,7 +10,7 @@ namespace Components { class StoryunitSourceEdit : public MakeTools::ContentPresent, - public Presents::ModeView, public Enhancement::HighlightDemand + public Presents::ModeView, public Enhancement::HighlightFeature { public: StoryunitSourceEdit(); diff --git a/WordsIDE/srcedit_storyvolume.h b/WordsIDE/srcedit_storyvolume.h index c6720cf..a9b3be6 100644 --- a/WordsIDE/srcedit_storyvolume.h +++ b/WordsIDE/srcedit_storyvolume.h @@ -7,7 +7,7 @@ namespace Components { class StoryvolumeSourceEdit : public Presents::ModeView, - public MakeTools::ContentPresent, public Enhancement::HighlightDemand + public MakeTools::ContentPresent, public Enhancement::HighlightFeature { public: StoryvolumeSourceEdit(); diff --git a/WordsIDE/visiableprojectcontroller.cpp b/WordsIDE/vcontrol_project.cpp similarity index 99% rename from WordsIDE/visiableprojectcontroller.cpp rename to WordsIDE/vcontrol_project.cpp index 7ae33c0..464e740 100644 --- a/WordsIDE/visiableprojectcontroller.cpp +++ b/WordsIDE/vcontrol_project.cpp @@ -1,4 +1,4 @@ -#include "visiableprojectcontroller.h" +#include "vcontrol_project.h" #include #include diff --git a/WordsIDE/visiableprojectcontroller.h b/WordsIDE/vcontrol_project.h similarity index 100% rename from WordsIDE/visiableprojectcontroller.h rename to WordsIDE/vcontrol_project.h