Skip to content

Commit

Permalink
2.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
xland committed May 27, 2024
1 parent 203392d commit 22a17dd
Show file tree
Hide file tree
Showing 9 changed files with 958 additions and 774 deletions.
8 changes: 4 additions & 4 deletions res/res.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ IDI_LOGO ICON "logo.ico"
IDR_ICON_FONT ICON_FONT "icon.ttf"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,1,5,0
PRODUCTVERSION 2,1,5,0
FILEVERSION 2,1,6,0
PRODUCTVERSION 2,1,6,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -26,12 +26,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "GitHub xland"
VALUE "FileDescription", "ScreenCapture"
VALUE "FileVersion", "2.1.5.0"
VALUE "FileVersion", "2.1.6.0"
VALUE "InternalName", "ScreenCapture.exe"
VALUE "LegalCopyright", "Copyright (C) LiuXiaolun 2023-2024"
VALUE "OriginalFilename", "ScreenCapture.exe"
VALUE "ProductName", "ScreenCapture"
VALUE "ProductVersion", "2.1.5.0"
VALUE "ProductVersion", "2.1.6.0"
END
END
BLOCK "VarFileInfo"
Expand Down
28 changes: 16 additions & 12 deletions src/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "ToolSub.h"
#include "Recorder.h"
#include "CutMask.h"
#include "Lang.h"


SkFont* fontIcon{ nullptr };
Expand All @@ -33,8 +34,19 @@ void App::Init(std::wstring&& cmd)
fontMgr = SkFontMgr_New_GDI();
initFontText();
initFontIcon();
auto foundPos = cmd.find(L"--pin:clipboard");
if (foundPos != std::wstring::npos) {
auto pos = cmd.find(L"--lang:");
if (pos != std::wstring::npos) {
pos += 7; //'--lang:' 7
size_t endPos = cmd.find(L' ', pos);
std::wstring lang = cmd.substr(pos, endPos - pos);
Lang::Init(lang);
}
else {
std::wstring lang = L"zh_cn";
Lang::Init(lang);
}
pos = cmd.find(L"--pin:clipboard");
if (pos != std::wstring::npos) {
pinClipboard();
}
else {
Expand Down Expand Up @@ -125,18 +137,10 @@ void App::initFontIcon()
{
HMODULE instance = GetModuleHandle(NULL);
HRSRC resID = FindResource(instance, MAKEINTRESOURCE(IDR_ICON_FONT), L"ICON_FONT");
if (resID == 0)
{
MessageBox(NULL, L"查找字体图标资源失败", L"系统提示", NULL);
return;
}
if (resID == 0) return;
size_t resSize = SizeofResource(instance, resID);
HGLOBAL res = LoadResource(instance, resID);
if (res == 0)
{
MessageBox(NULL, L"加载字体图标资源失败", L"系统提示", NULL);
return;
}
if (res == 0) return;
LPVOID resData = LockResource(res);
auto fontData = SkData::MakeWithoutCopy(resData, resSize);
fontIcon = new SkFont(fontMgr->makeFromData(fontData));
Expand Down
64 changes: 33 additions & 31 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
set(SRC
main.cpp
App.cpp
App.h
State.h
Icon.h
Cursor.h
WindowBase.cpp
WindowBase.h
WindowMain.cpp
WindowMain.h
WindowPin.cpp
WindowPin.h
PixelInfo.cpp
PixelInfo.h
CutMask.cpp
CutMask.h
Recorder.cpp
Recorder.h
ToolBase.cpp
ToolBase.h
ToolBtn.cpp
ToolBtn.h
ToolMain.cpp
ToolMain.h
ToolSub.cpp
ToolSub.h
ColorBlender.h
ColorBlender.cpp
)
target_sources(ScreenCapture PRIVATE ${SRC})
set(SRC
main.cpp
App.cpp
App.h
State.h
Icon.h
Cursor.h
WindowBase.cpp
WindowBase.h
WindowMain.cpp
WindowMain.h
WindowPin.cpp
WindowPin.h
PixelInfo.cpp
PixelInfo.h
CutMask.cpp
CutMask.h
Recorder.cpp
Recorder.h
ToolBase.cpp
ToolBase.h
ToolBtn.cpp
ToolBtn.h
ToolMain.cpp
ToolMain.h
ToolSub.cpp
ToolSub.h
ColorBlender.h
ColorBlender.cpp
Lang.h
Lang.cpp
)
target_sources(ScreenCapture PRIVATE ${SRC})
add_subdirectory(Shape)
Loading

0 comments on commit 22a17dd

Please sign in to comment.