diff --git a/CMakeLists.txt b/CMakeLists.txt index df7060b..a3cec5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ endif() set(MYNOTEPAD_VERSION_MAJOR 1) set(MYNOTEPAD_VERSION_MINOR 0) -set(MYNOTEPAD_VERSION_PATCH 6) +set(MYNOTEPAD_VERSION_PATCH 7) message(STATUS "MyNotePad version: ${MYNOTEPAD_VERSION_MAJOR}." "${MYNOTEPAD_VERSION_MINOR}.${MYNOTEPAD_VERSION_PATCH}") @@ -55,6 +55,11 @@ if (UNIX) # message(STATUS "GTK headers: ${GTK_INCLUDE_DIRS}") # message(STATUS "GTK libraries: ${GTK_LIBRARIES}") # set(EXTRA_LIBS ${EXTRA_LIBS} ${GTK_LIBRARIES}) +else() + configure_file( + "${PROJECT_SOURCE_DIR}/static/wx.rc.in" + "${PROJECT_SOURCE_DIR}/static/wx.rc" + ) endif() # Specify the path manually @@ -93,8 +98,8 @@ set(TARGET mynotepad) add_executable(${TARGET} WIN32 ${SOURCES}) # Markdown to HTML converter -option(USE_EXTERN_LIB "Use external library to convert markdown to HTML" OFF) -if (USE_EXTERN_LIB) +option(USE_EXTERNAL_MD2HTML "Use external library to convert markdown to HTML" OFF) +if (USE_EXTERNAL_MD2HTML) include(FetchContent) FetchContent_Declare(maddy GIT_REPOSITORY https://github.com/progsource/maddy.git @@ -106,7 +111,7 @@ if (USE_EXTERN_LIB) # Do not add_subdirectory() because we only want the header files include_directories("${maddy_SOURCE_DIR}/include") endif() - add_definitions("-DUSE_EXTERN_LIB") + add_definitions("-DUSE_EXTERNAL_MD2HTML") else() add_subdirectory(md2html) set(EXTRA_LIBS ${EXTRA_LIBS} md2html) diff --git a/src/main.cpp b/src/main.cpp index 846bd00..3bf6680 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,8 +12,9 @@ #include #include #include -#include -#include + +#include +#include #include "config.h" #include "main.h" @@ -403,7 +404,7 @@ MathJax.Hub.Config({ out << wxS(""); } -#ifdef USE_EXTERN_LIB +#ifdef USE_EXTERNAL_MD2HTML #include "maddy/parser.h" #else #include "lex_parse.h" diff --git a/static/.gitignore b/static/.gitignore index 0a9a7ac..7a50310 100644 --- a/static/.gitignore +++ b/static/.gitignore @@ -1 +1,2 @@ -wx.aps \ No newline at end of file +wx.aps +wx.rc diff --git a/static/wx.rc b/static/wx.rc deleted file mode 100644 index 0d12c7b..0000000 Binary files a/static/wx.rc and /dev/null differ diff --git a/static/wx.rc.in b/static/wx.rc.in new file mode 100644 index 0000000..01d5cd6 --- /dev/null +++ b/static/wx.rc.in @@ -0,0 +1,108 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +/ +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +/ +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// 中文(简体,中国) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +ICON_MYNOTEPAD ICON "mynotepad.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @MYNOTEPAD_VERSION_MAJOR@,@MYNOTEPAD_VERSION_MINOR@,@MYNOTEPAD_VERSION_PATCH@,0 + PRODUCTVERSION @MYNOTEPAD_VERSION_MAJOR@,@MYNOTEPAD_VERSION_MINOR@,@MYNOTEPAD_VERSION_PATCH@,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080404b0" + BEGIN + VALUE "CompanyName", "moooc.cc" + VALUE "FileDescription", "MyNotePad" + VALUE "FileVersion", "@MYNOTEPAD_VERSION_MAJOR@.@MYNOTEPAD_VERSION_MINOR@.@MYNOTEPAD_VERSION_PATCH@.0" + VALUE "InternalName", "mynotepad.exe" + VALUE "LegalCopyright", "Copyright (C) 2021" + VALUE "OriginalFilename", "mynotepad.exe" + VALUE "ProductName", "MyNotePad" + VALUE "ProductVersion", "@MYNOTEPAD_VERSION_MAJOR@.@MYNOTEPAD_VERSION_MINOR@.@MYNOTEPAD_VERSION_PATCH@.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x804, 1200 + END +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // 中文(简体,中国) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED +