base:基本架子。

This commit is contained in:
taynpg 2024-12-26 11:56:43 +08:00
commit 9caf79b3f4
9 changed files with 123 additions and 0 deletions

17
.clang-format Normal file
View File

@ -0,0 +1,17 @@
BasedOnStyle: LLVM
IndentWidth: 4
PointerAlignment: Left
AccessModifierOffset: -4
BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: true
AfterClass: true
Cpp11BracedListStyle: true
ReflowComments: true
SpacesBeforeTrailingComments: 3
TabWidth: 4
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ColumnLimit: 80
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: None
AllowShortEnumsOnASingleLine: false

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
build
.vs
.cache
cmake-*

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "ofen"]
path = ofen
url = https://www.sinxmiao.cn/taynpg/ofen

35
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,35 @@
{
"files.autoSave": "onFocusChange",
"editor.fontSize": 14,
"editor.fontFamily": "'FiraCode Nerd Font Mono', 'FiraCode Nerd Font Mono', 'FiraCode Nerd Font Mono'",
"cmake.configureOnOpen": true,
"cmake.debugConfig": {
"console": "integratedTerminal",
"setupCommands": [
{
"description": "-gdb-set charset utf-8",
"text": "-gdb-set charset UTF-8"
},
{
"description": "Enable gdb pretty-printing",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"args": [
]
},
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "${env:VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
"cmake.options.statusBarVisibility": "visible",
"cmake.generator": "Ninja",
"C_Cpp.default.compileCommands": "${workspaceRoot}/build/compile_commands.json",
"C_Cpp.default.cppStandard": "c++17",
"editor.inlayHints.enabled": "off",
"editor.unicodeHighlight.allowedLocales": {
"ja": true,
"zh-hant": true,
"zh-hans": true
}
}

22
CMakeLists.txt Normal file
View File

@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.16)
project(PictureTool LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (MSVC)
add_compile_options(/source-charset:utf-8)
endif()
message(STATUS "System: ${CMAKE_SYSTEM_NAME}")
message(STATUS "Compiler CXX ID: ${CMAKE_CXX_COMPILER_ID}")
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/)
add_subdirectory(ofen)
find_package(wxWidgets CONFIG REQUIRED)
find_package(OpenCV CONFIG REQUIRED)
add_executable(PictureTool main.cpp MainFrame.h MainFrame.cpp)
target_link_libraries(PictureTool PRIVATE wx::core wx::base Ofen ${OpenCV_LIBS})
set_target_properties(PictureTool PROPERTIES WIN32_EXECUTABLE TRUE)

9
MainFrame.cpp Normal file
View File

@ -0,0 +1,9 @@
#include "MainFrame.h"
CMainFrame::CMainFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title)
{
}
CMainFrame::~CMainFrame()
{
}

11
MainFrame.h Normal file
View File

@ -0,0 +1,11 @@
#pragma once
#include <wx/wx.h>
class CMainFrame : public wxFrame
{
public:
CMainFrame(const wxString& title);
virtual ~CMainFrame();
public:
};

21
main.cpp Normal file
View File

@ -0,0 +1,21 @@
#include "MainFrame.h"
#include <wx/wx.h>
class CPictureTool : public wxApp
{
public:
virtual bool OnInit()
{
wxString title = wxString::Format(wxT(""));
auto* f = new CMainFrame(title);
f->Show(true);
return true;
}
virtual int OnExit()
{
return wxApp::OnExit();
}
};
IMPLEMENT_APP(CPictureTool);
DECLARE_APP(CPictureTool);

1
ofen Submodule

@ -0,0 +1 @@
Subproject commit 1d86de126afe83c7a9c934adca74006ca90ec65f