From b24e1a42b00ee3cab08dd5d512372bfd90d632c5 Mon Sep 17 00:00:00 2001 From: wilfz Date: Sat, 3 May 2025 17:51:36 +0200 Subject: [PATCH 01/22] added VS16 project nd solution files --- CLCLPlugin/tool_test/tool_test.sln | 22 +++ CLCLPlugin/tool_test/tool_test.vcxproj | 148 ++++++++++++++++++ .../tool_test/tool_test.vcxproj.filters | 32 ++++ 3 files changed, 202 insertions(+) create mode 100644 CLCLPlugin/tool_test/tool_test.sln create mode 100644 CLCLPlugin/tool_test/tool_test.vcxproj create mode 100644 CLCLPlugin/tool_test/tool_test.vcxproj.filters diff --git a/CLCLPlugin/tool_test/tool_test.sln b/CLCLPlugin/tool_test/tool_test.sln new file mode 100644 index 0000000..d8bd48f --- /dev/null +++ b/CLCLPlugin/tool_test/tool_test.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29418.71 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tool_test", "tool_test.vcxproj", "{D4837AC4-2903-4344-A248-4EC2321875A3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D4837AC4-2903-4344-A248-4EC2321875A3}.Debug|x86.ActiveCfg = Debug|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Debug|x86.Build.0 = Debug|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Release|x86.ActiveCfg = Release|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/CLCLPlugin/tool_test/tool_test.vcxproj b/CLCLPlugin/tool_test/tool_test.vcxproj new file mode 100644 index 0000000..d97d9ed --- /dev/null +++ b/CLCLPlugin/tool_test/tool_test.vcxproj @@ -0,0 +1,148 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + {D4837AC4-2903-4344-A248-4EC2321875A3} + + + + DynamicLibrary + v141_xp + false + Unicode + + + DynamicLibrary + v141_xp + false + Unicode + + + + + + + + + + + + + + + .\Release\ + .\Release\ + false + + + .\Debug\ + .\Debug\ + true + + + + MultiThreaded + Default + true + true + MaxSpeed + true + Level3 + WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;TOOL_TEST_EXPORTS;UNICODE;%(PreprocessorDefinitions) + .\Release\ + .\Release\tool_test.pch + .\Release\ + .\Release\ + + + true + NDEBUG;%(PreprocessorDefinitions) + .\Release\tool_test.tlb + true + Win32 + + + 0x0411 + NDEBUG;%(PreprocessorDefinitions) + + + true + .\Release\tool_test.bsc + + + true + true + Console + .\Release\tool_test.dll + .\Release\tool_test.lib + %(AdditionalDependencies) + .\tool_test.def + + + + + MultiThreadedDebug + Default + true + Disabled + true + Level3 + EditAndContinue + WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;TOOL_TEST_EXPORTS;UNICODE;%(PreprocessorDefinitions) + .\Debug\ + .\Debug\tool_test.pch + .\Debug\ + .\Debug\ + EnableFastChecks + + + true + _DEBUG;%(PreprocessorDefinitions) + .\Debug\tool_test.tlb + true + Win32 + + + 0x0411 + _DEBUG;%(PreprocessorDefinitions) + + + true + .\Debug\tool_test.bsc + + + true + true + true + Console + .\Debug\tool_test.dll + .\Debug\tool_test.lib + %(AdditionalDependencies) + .\tool_test.def + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CLCLPlugin/tool_test/tool_test.vcxproj.filters b/CLCLPlugin/tool_test/tool_test.vcxproj.filters new file mode 100644 index 0000000..70528be --- /dev/null +++ b/CLCLPlugin/tool_test/tool_test.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {576c9505-a968-4d71-bdc2-b87765ca972e} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {a2e48bfe-092a-4bcc-abcd-1193127b1572} + h;hpp;hxx;hm;inl + + + {e76b06a0-edf4-4667-8974-5c591076284d} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + + + Header Files + + + + + Source Files + + + \ No newline at end of file From 0c2d3cd51db1e3be5f39f9daa90de99ec63194cc Mon Sep 17 00:00:00 2001 From: wilfz Date: Sat, 3 May 2025 19:12:56 +0200 Subject: [PATCH 02/22] Revert "added VS16 project nd solution files" This reverts commit b24e1a42b00ee3cab08dd5d512372bfd90d632c5. --- CLCLPlugin/tool_test/tool_test.sln | 22 --- CLCLPlugin/tool_test/tool_test.vcxproj | 148 ------------------ .../tool_test/tool_test.vcxproj.filters | 32 ---- 3 files changed, 202 deletions(-) delete mode 100644 CLCLPlugin/tool_test/tool_test.sln delete mode 100644 CLCLPlugin/tool_test/tool_test.vcxproj delete mode 100644 CLCLPlugin/tool_test/tool_test.vcxproj.filters diff --git a/CLCLPlugin/tool_test/tool_test.sln b/CLCLPlugin/tool_test/tool_test.sln deleted file mode 100644 index d8bd48f..0000000 --- a/CLCLPlugin/tool_test/tool_test.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29418.71 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tool_test", "tool_test.vcxproj", "{D4837AC4-2903-4344-A248-4EC2321875A3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D4837AC4-2903-4344-A248-4EC2321875A3}.Debug|x86.ActiveCfg = Debug|Win32 - {D4837AC4-2903-4344-A248-4EC2321875A3}.Debug|x86.Build.0 = Debug|Win32 - {D4837AC4-2903-4344-A248-4EC2321875A3}.Release|x86.ActiveCfg = Release|Win32 - {D4837AC4-2903-4344-A248-4EC2321875A3}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/CLCLPlugin/tool_test/tool_test.vcxproj b/CLCLPlugin/tool_test/tool_test.vcxproj deleted file mode 100644 index d97d9ed..0000000 --- a/CLCLPlugin/tool_test/tool_test.vcxproj +++ /dev/null @@ -1,148 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - {D4837AC4-2903-4344-A248-4EC2321875A3} - - - - DynamicLibrary - v141_xp - false - Unicode - - - DynamicLibrary - v141_xp - false - Unicode - - - - - - - - - - - - - - - .\Release\ - .\Release\ - false - - - .\Debug\ - .\Debug\ - true - - - - MultiThreaded - Default - true - true - MaxSpeed - true - Level3 - WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;TOOL_TEST_EXPORTS;UNICODE;%(PreprocessorDefinitions) - .\Release\ - .\Release\tool_test.pch - .\Release\ - .\Release\ - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\tool_test.tlb - true - Win32 - - - 0x0411 - NDEBUG;%(PreprocessorDefinitions) - - - true - .\Release\tool_test.bsc - - - true - true - Console - .\Release\tool_test.dll - .\Release\tool_test.lib - %(AdditionalDependencies) - .\tool_test.def - - - - - MultiThreadedDebug - Default - true - Disabled - true - Level3 - EditAndContinue - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;TOOL_TEST_EXPORTS;UNICODE;%(PreprocessorDefinitions) - .\Debug\ - .\Debug\tool_test.pch - .\Debug\ - .\Debug\ - EnableFastChecks - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\tool_test.tlb - true - Win32 - - - 0x0411 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\tool_test.bsc - - - true - true - true - Console - .\Debug\tool_test.dll - .\Debug\tool_test.lib - %(AdditionalDependencies) - .\tool_test.def - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CLCLPlugin/tool_test/tool_test.vcxproj.filters b/CLCLPlugin/tool_test/tool_test.vcxproj.filters deleted file mode 100644 index 70528be..0000000 --- a/CLCLPlugin/tool_test/tool_test.vcxproj.filters +++ /dev/null @@ -1,32 +0,0 @@ - - - - - {576c9505-a968-4d71-bdc2-b87765ca972e} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {a2e48bfe-092a-4bcc-abcd-1193127b1572} - h;hpp;hxx;hm;inl - - - {e76b06a0-edf4-4667-8974-5c591076284d} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - - - Header Files - - - - - Source Files - - - \ No newline at end of file From e409e16656ecc77de340e004870b06ae752a21e8 Mon Sep 17 00:00:00 2001 From: wilfz Date: Sat, 3 May 2025 19:34:28 +0200 Subject: [PATCH 03/22] tool_test plugin: added VS16 project nd solution files --- CLCLPlugin/tool_test/tool_test.sln | 22 +++ CLCLPlugin/tool_test/tool_test.vcxproj | 148 ++++++++++++++++++ .../tool_test/tool_test.vcxproj.filters | 32 ++++ 3 files changed, 202 insertions(+) create mode 100644 CLCLPlugin/tool_test/tool_test.sln create mode 100644 CLCLPlugin/tool_test/tool_test.vcxproj create mode 100644 CLCLPlugin/tool_test/tool_test.vcxproj.filters diff --git a/CLCLPlugin/tool_test/tool_test.sln b/CLCLPlugin/tool_test/tool_test.sln new file mode 100644 index 0000000..f945178 --- /dev/null +++ b/CLCLPlugin/tool_test/tool_test.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29418.71 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tool_test", "tool_test.vcxproj", "{D4837AC4-2903-4344-A248-4EC2321875A3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D4837AC4-2903-4344-A248-4EC2321875A3}.Debug|x86.ActiveCfg = Debug|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Debug|x86.Build.0 = Debug|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Release|x86.ActiveCfg = Release|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/CLCLPlugin/tool_test/tool_test.vcxproj b/CLCLPlugin/tool_test/tool_test.vcxproj new file mode 100644 index 0000000..1102799 --- /dev/null +++ b/CLCLPlugin/tool_test/tool_test.vcxproj @@ -0,0 +1,148 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + {D4837AC4-2903-4344-A248-4EC2321875A3} + + + + DynamicLibrary + v141_xp + false + Unicode + + + DynamicLibrary + v141_xp + false + Unicode + + + + + + + + + + + + + + + .\Release\ + .\Release\ + false + + + .\Debug\ + .\Debug\ + true + + + + MultiThreaded + Default + true + true + MaxSpeed + true + Level3 + WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;TOOL_TEST_EXPORTS;UNICODE;%(PreprocessorDefinitions) + .\Release\ + .\Release\tool_test.pch + .\Release\ + .\Release\ + + + true + NDEBUG;%(PreprocessorDefinitions) + .\Release\tool_test.tlb + true + Win32 + + + 0x0411 + NDEBUG;%(PreprocessorDefinitions) + + + true + .\Release\tool_test.bsc + + + true + true + Console + .\Release\tool_test.dll + .\Release\tool_test.lib + %(AdditionalDependencies) + .\tool_test.def + + + + + MultiThreadedDebug + Default + true + Disabled + true + Level3 + EditAndContinue + WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;TOOL_TEST_EXPORTS;UNICODE;%(PreprocessorDefinitions) + .\Debug\ + .\Debug\tool_test.pch + .\Debug\ + .\Debug\ + EnableFastChecks + + + true + _DEBUG;%(PreprocessorDefinitions) + .\Debug\tool_test.tlb + true + Win32 + + + 0x0411 + _DEBUG;%(PreprocessorDefinitions) + + + true + .\Debug\tool_test.bsc + + + true + true + true + Console + .\Debug\tool_test.dll + .\Debug\tool_test.lib + %(AdditionalDependencies) + .\tool_test.def + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CLCLPlugin/tool_test/tool_test.vcxproj.filters b/CLCLPlugin/tool_test/tool_test.vcxproj.filters new file mode 100644 index 0000000..421b723 --- /dev/null +++ b/CLCLPlugin/tool_test/tool_test.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {576c9505-a968-4d71-bdc2-b87765ca972e} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {a2e48bfe-092a-4bcc-abcd-1193127b1572} + h;hpp;hxx;hm;inl + + + {e76b06a0-edf4-4667-8974-5c591076284d} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + + + Header Files + + + + + Source Files + + + \ No newline at end of file From e01986f32ef0879bee476e047e30d3a6ef6e6d39 Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 11:48:22 +0200 Subject: [PATCH 04/22] plugin tool_text: added files from https://nakka.com/soft/clcl/plugin/tltxt002_eng.zip --- CLCLPlugin/tool_text/delete_crlf.c | 190 ++++++++++++ CLCLPlugin/tool_text/join_text.c | 204 +++++++++++++ CLCLPlugin/tool_text/put_text.c | 177 +++++++++++ CLCLPlugin/tool_text/quote.c | 179 ++++++++++++ CLCLPlugin/tool_text/resource.h | 44 +++ CLCLPlugin/tool_text/text_edit.c | 155 ++++++++++ CLCLPlugin/tool_text/to_lower.c | 71 +++++ CLCLPlugin/tool_text/to_upper.c | 71 +++++ CLCLPlugin/tool_text/tool_text.c | 187 ++++++++++++ CLCLPlugin/tool_text/tool_text.def | 29 ++ CLCLPlugin/tool_text/tool_text.dsp | 157 ++++++++++ CLCLPlugin/tool_text/tool_text.dsw | 29 ++ CLCLPlugin/tool_text/tool_text.rc | 233 +++++++++++++++ CLCLPlugin/tool_text/tool_text.txt | 4 + CLCLPlugin/tool_text/unquote.c | 197 +++++++++++++ CLCLPlugin/tool_text/word_break.c | 455 +++++++++++++++++++++++++++++ 16 files changed, 2382 insertions(+) create mode 100644 CLCLPlugin/tool_text/delete_crlf.c create mode 100644 CLCLPlugin/tool_text/join_text.c create mode 100644 CLCLPlugin/tool_text/put_text.c create mode 100644 CLCLPlugin/tool_text/quote.c create mode 100644 CLCLPlugin/tool_text/resource.h create mode 100644 CLCLPlugin/tool_text/text_edit.c create mode 100644 CLCLPlugin/tool_text/to_lower.c create mode 100644 CLCLPlugin/tool_text/to_upper.c create mode 100644 CLCLPlugin/tool_text/tool_text.c create mode 100644 CLCLPlugin/tool_text/tool_text.def create mode 100644 CLCLPlugin/tool_text/tool_text.dsp create mode 100644 CLCLPlugin/tool_text/tool_text.dsw create mode 100644 CLCLPlugin/tool_text/tool_text.rc create mode 100644 CLCLPlugin/tool_text/tool_text.txt create mode 100644 CLCLPlugin/tool_text/unquote.c create mode 100644 CLCLPlugin/tool_text/word_break.c diff --git a/CLCLPlugin/tool_text/delete_crlf.c b/CLCLPlugin/tool_text/delete_crlf.c new file mode 100644 index 0000000..f446be2 --- /dev/null +++ b/CLCLPlugin/tool_text/delete_crlf.c @@ -0,0 +1,190 @@ +/* + * tool_text + * + * delete_crlf.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE + +#include "..\CLCLPlugin.h" + +#include "resource.h" + +/* Define */ + +/* Global Variables */ +extern HINSTANCE hInst; +extern TCHAR ini_path[]; + +extern int delete_crlf_delete_space; + +/* Local Function Prototypes */ + +/* + * item_delete_crlf - s̏ + */ +static int item_delete_crlf(DATA_INFO *di) +{ + HANDLE ret; + BYTE *from_mem, *to_mem; + TCHAR *p, *r; + int size; + + // Rs[bN + if ((from_mem = GlobalLock(di->data)) == NULL) { + return TOOL_ERROR; + } + + // sTCY擾 + size = 0; + p = (TCHAR *)from_mem; + if (delete_crlf_delete_space == 1) { + for (; *p == TEXT(' ') || *p == TEXT('\t'); p++) + ; + } + while (*p != TEXT('\0')) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + p += 2; + size += 2; + continue; + } +#endif + if (*p == TEXT('\r') || *p == TEXT('\n')) { + for (; *p == TEXT('\r') || *p == TEXT('\n'); p++) + ; + if (delete_crlf_delete_space == 1) { + for (; *p == TEXT(' ') || *p == TEXT('\t'); p++) + ; + } + } else { + p++; + size++; + } + } + size++; + + // Rs[m + if ((ret = GlobalAlloc(GHND, sizeof(TCHAR) * size)) == NULL) { + GlobalUnlock(di->data); + return TOOL_ERROR; + } + // Rs[惍bN + if ((to_mem = GlobalLock(ret)) == NULL) { + GlobalFree(ret); + GlobalUnlock(di->data); + return TOOL_ERROR; + } + + // s̏ + p = (TCHAR *)from_mem; + r = (TCHAR *)to_mem; + if (delete_crlf_delete_space == 1) { + for (; *p == TEXT(' ') || *p == TEXT('\t'); p++) + ; + } + while (*p != TEXT('\0')) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + *(r++) = *(p++); + *(r++) = *(p++); + continue; + } +#endif + if (*p == TEXT('\r') || *p == TEXT('\n')) { + for (; *p == TEXT('\r') || *p == TEXT('\n'); p++) + ; + if (delete_crlf_delete_space == 1) { + for (; *p == TEXT(' ') || *p == TEXT('\t'); p++) + ; + } + } else { + *(r++) = *(p++); + } + } + *r = TEXT('\0'); + + GlobalUnlock(ret); + GlobalUnlock(di->data); + + GlobalFree(di->data); + di->data = ret; + di->size = sizeof(TCHAR) * size; + return TOOL_DATA_MODIFIED; +} + +/* + * delete_crlf - s̏ + */ +__declspec(dllexport) int CALLBACK delete_crlf(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + DATA_INFO *di; + int ret = TOOL_SUCCEED; + + for (; tdi != NULL; tdi = tdi->next) { +#ifdef UNICODE + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)tdi->di); +#else + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("TEXT"), (LPARAM)tdi->di); +#endif + if (di != NULL && di->data != NULL) { + ret |= item_delete_crlf(di); + } + } + return ret; +} + +/* + * set_delete_crlf_proc - ݒ + */ +BOOL CALLBACK set_delete_crlf_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + TCHAR buf[BUF_SIZE]; + + switch (uMsg) { + case WM_INITDIALOG: + CheckDlgButton(hDlg, IDC_CHECK_DELETE_SPACE, delete_crlf_delete_space); + break; + + case WM_CLOSE: + EndDialog(hDlg, FALSE); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + delete_crlf_delete_space = IsDlgButtonChecked(hDlg, IDC_CHECK_DELETE_SPACE); + + wsprintf(buf, TEXT("%d"), delete_crlf_delete_space); + WritePrivateProfileString(TEXT("delete_crlf"), TEXT("delete_space"), buf, ini_path); + EndDialog(hDlg, TRUE); + break; + + case IDCANCEL: + EndDialog(hDlg, FALSE); + break; + } + break; + + default: + return FALSE; + } + return TRUE; +} + +/* + * delete_crlf_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK delete_crlf_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_DELETE_CRLF), hWnd, set_delete_crlf_proc, 0); + return TRUE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_text/join_text.c b/CLCLPlugin/tool_text/join_text.c new file mode 100644 index 0000000..6d3d504 --- /dev/null +++ b/CLCLPlugin/tool_text/join_text.c @@ -0,0 +1,204 @@ +/* + * tool_text + * + * join_text.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE + +#include "..\CLCLPlugin.h" + +#include "resource.h" + +/* Define */ + +/* Global Variables */ +extern HINSTANCE hInst; +extern TCHAR ini_path[]; + +extern int join_text_add_return; + +/* Local Function Prototypes */ + +/* + * get_text_item - eLXgf[^܂ރACe擾 + */ +static TOOL_DATA_INFO *get_text_item(TOOL_DATA_INFO *tdi) +{ + // `I + if (tdi->di->type == TYPE_ITEM) { +#ifdef UNICODE + for (tdi = tdi->child; tdi != NULL && lstrcmpi(tdi->di->format_name, TEXT("UNICODE TEXT")) != 0; tdi = tdi->next) + ; +#else + for (tdi = tdi->child; tdi != NULL && lstrcmpi(tdi->di->format_name, TEXT("TEXT")) != 0; tdi = tdi->next) + ; +#endif + if (tdi == NULL) { + return NULL; + } + } else if (tdi->di->type == TYPE_DATA) { +#ifdef UNICODE + if (lstrcmpi(tdi->di->format_name, TEXT("UNICODE TEXT")) != 0) { +#else + if (lstrcmpi(tdi->di->format_name, TEXT("TEXT")) != 0) { +#endif + return NULL; + } + } else { + return NULL; + } + if (tdi->di->data == NULL) { + return NULL; + } + return tdi; +} + +/* + * join_text - eLXg̘A + */ +__declspec(dllexport) int CALLBACK join_text(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + TOOL_DATA_INFO *wk_tdi; + DATA_INFO *di; + HANDLE data; + BYTE *from_mem, *to_mem; + TCHAR *p; + DWORD size = 0; + + if (tdi == NULL) { + return TOOL_SUCCEED; + } + + // TCY擾 + for (wk_tdi = tdi; wk_tdi != NULL; wk_tdi = wk_tdi->next) { +#ifdef UNICODE + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)wk_tdi->di); +#else + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("TEXT"), (LPARAM)wk_tdi->di); +#endif + if (di == NULL || di->data == NULL) { + continue; + } + if ((from_mem = GlobalLock(di->data)) != NULL) { + size += lstrlen((TCHAR *)from_mem); + GlobalUnlock(di->data); + if (join_text_add_return == 1) { + size += 2; + } + } + } + if (size == 0) { + return TOOL_SUCCEED; + } + size++; + + // Rs[m + if ((data = GlobalAlloc(GHND, sizeof(TCHAR) * size)) == NULL) { + return TOOL_ERROR; + } + // Rs[惍bN + if ((to_mem = GlobalLock(data)) == NULL) { + GlobalFree(data); + return TOOL_ERROR; + } + // eLXg̘A + p = (TCHAR *)to_mem; + for (wk_tdi = tdi; wk_tdi != NULL; wk_tdi = wk_tdi->next) { +#ifdef UNICODE + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)wk_tdi->di); +#else + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("TEXT"), (LPARAM)wk_tdi->di); +#endif + if (di == NULL || di->data == NULL) { + continue; + } + if ((from_mem = GlobalLock(di->data)) != NULL) { + lstrcpy(p, (TCHAR *)from_mem); + p += lstrlen(p); + GlobalUnlock(di->data); + if (join_text_add_return == 1) { + lstrcpy(p, TEXT("\r\n")); + p += 2; + } + } + } + GlobalUnlock(data); + + // Nbv{[hɑ + if (OpenClipboard(hWnd) == FALSE) { + GlobalFree(data); + return TOOL_ERROR; + } + if (EmptyClipboard() == FALSE) { + CloseClipboard(); + GlobalFree(data); + return TOOL_ERROR; + } +#ifdef UNICODE + if (SetClipboardData(CF_UNICODETEXT, data) == NULL) { +#else + if (SetClipboardData(CF_TEXT, data) == NULL) { +#endif + CloseClipboard(); + GlobalFree(data); + return TOOL_ERROR; + } + CloseClipboard(); + return TOOL_SUCCEED; +} + +/* + * set_join_text_proc - eLXg̘Aݒ + */ +BOOL CALLBACK set_join_text_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + TCHAR buf[BUF_SIZE]; + + switch (uMsg) { + case WM_INITDIALOG: + CheckDlgButton(hDlg, IDC_CHECK_ADD_RETURN, join_text_add_return); + break; + + case WM_CLOSE: + EndDialog(hDlg, FALSE); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + join_text_add_return = IsDlgButtonChecked(hDlg, IDC_CHECK_ADD_RETURN); + + wsprintf(buf, TEXT("%d"), join_text_add_return); + WritePrivateProfileString(TEXT("join_text"), TEXT("add_return"), buf, ini_path); + EndDialog(hDlg, TRUE); + break; + + case IDCANCEL: + EndDialog(hDlg, FALSE); + break; + } + break; + + default: + return FALSE; + } + return TRUE; +} + +/* + * join_text_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK join_text_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_JOIN_TEXT), hWnd, set_join_text_proc, 0); + return TRUE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_text/put_text.c b/CLCLPlugin/tool_text/put_text.c new file mode 100644 index 0000000..eba719c --- /dev/null +++ b/CLCLPlugin/tool_text/put_text.c @@ -0,0 +1,177 @@ +/* + * tool_text + * + * put_text.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE + +#include "..\CLCLPlugin.h" + +#include "resource.h" + +/* Define */ + +/* Global Variables */ +extern HINSTANCE hInst; +extern TCHAR ini_path[]; + +extern TCHAR put_text_open[]; +extern TCHAR put_text_close[]; + +/* Local Function Prototypes */ + +/* + * set_put_text_proc - ݍޕݒ + */ +static BOOL CALLBACK set_put_text_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) { + case WM_INITDIALOG: + SendDlgItemMessage(hDlg, IDC_EDIT_OPEN, WM_SETTEXT, 0, (LPARAM)put_text_open); + SendDlgItemMessage(hDlg, IDC_EDIT_CLOSE, WM_SETTEXT, 0, (LPARAM)put_text_close); + break; + + case WM_CLOSE: + EndDialog(hDlg, FALSE); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + SendDlgItemMessage(hDlg, IDC_EDIT_OPEN, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)put_text_open); + SendDlgItemMessage(hDlg, IDC_EDIT_CLOSE, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)put_text_close); + + WritePrivateProfileString(TEXT("put_text"), TEXT("open"), put_text_open, ini_path); + WritePrivateProfileString(TEXT("put_text"), TEXT("close"), put_text_close, ini_path); + EndDialog(hDlg, TRUE); + break; + + case IDCANCEL: + EndDialog(hDlg, FALSE); + break; + } + break; + + default: + return FALSE; + } + return TRUE; +} + +/* + * item_put_text - eLXg̋ݍ + */ +static int item_put_text(DATA_INFO *di, const TCHAR *str_open, const TCHAR *str_close) +{ + HANDLE ret; + BYTE *from_mem, *to_mem; + TCHAR *r; + int size; + + // Rs[bN + if ((from_mem = GlobalLock(di->data)) == NULL) { + return TOOL_ERROR; + } + + // TCY擾 + size = lstrlen((TCHAR *)str_open) + lstrlen((TCHAR *)from_mem) + lstrlen(str_close) + 1; + + // Rs[m + if ((ret = GlobalAlloc(GHND, sizeof(TCHAR) * size)) == NULL) { + GlobalUnlock(di->data); + return TOOL_ERROR; + } + // Rs[惍bN + if ((to_mem = GlobalLock(ret)) == NULL) { + GlobalFree(ret); + GlobalUnlock(di->data); + return TOOL_ERROR; + } + + // ݍ + r = lstrcpy((TCHAR *)to_mem, str_open) + lstrlen(str_open); + r = lstrcpy(r, (TCHAR *)from_mem) + lstrlen((TCHAR *)from_mem); + lstrcpy(r, str_close); + + GlobalUnlock(ret); + GlobalUnlock(di->data); + + GlobalFree(di->data); + di->data = ret; + di->size = sizeof(TCHAR) * size; + return TOOL_DATA_MODIFIED; +} + +/* + * put_text - eLXg̋ݍ + */ +__declspec(dllexport) int CALLBACK put_text(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + DATA_INFO *di; + TCHAR str_open[BUF_SIZE]; + TCHAR str_close[BUF_SIZE]; + TCHAR *p, *r; + int ret = TOOL_SUCCEED; + + if (tei->cmd_line != NULL && *tei->cmd_line != TEXT('\0')) { + for (p = tei->cmd_line, r = str_open; *p != TEXT('\0') && *p != TEXT(','); p++) { + if (*p == TEXT('\\') && *(p + 1) == TEXT(',')) { + p++; + } + *(r++) = *p; + } + *r = TEXT('\0'); + if (*p == TEXT(',')) { + p++; + } + for (r = str_close; *p != TEXT('\0'); p++) { + if (*p == TEXT('\\') && *(p + 1) == TEXT(',')) { + p++; + } + *(r++) = *p; + } + *r = TEXT('\0'); + + } else { + if ((tei->cmd_line == NULL || *tei->cmd_line == TEXT('\0')) && + ((tei->call_type & CALLTYPE_MENU) || (tei->call_type & CALLTYPE_VIEWER))) { + if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_PUT_TEXT), GetForegroundWindow(), set_put_text_proc, 0) == FALSE) { + return TOOL_CANCEL; + } + } + lstrcpy(str_open, put_text_open); + lstrcpy(str_close, put_text_close); + } + for (; tdi != NULL; tdi = tdi->next) { + if (SendMessage(hWnd, WM_ITEM_CHECK, 0, (LPARAM)tdi->di) == -1) { + continue; + } +#ifdef UNICODE + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)tdi->di); +#else + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("TEXT"), (LPARAM)tdi->di); +#endif + if (di != NULL && di->data != NULL) { + ret |= item_put_text(di, str_open, str_close); + } + } + return ret; +} + +/* + * put_text_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK put_text_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_PUT_TEXT), hWnd, set_put_text_proc, 0); + return TRUE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_text/quote.c b/CLCLPlugin/tool_text/quote.c new file mode 100644 index 0000000..111206a --- /dev/null +++ b/CLCLPlugin/tool_text/quote.c @@ -0,0 +1,179 @@ +/* + * tool_text + * + * quote.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE + +#include "..\CLCLPlugin.h" + +#include "resource.h" + +/* Define */ + +/* Global Variables */ +extern HINSTANCE hInst; +extern TCHAR ini_path[]; + +extern TCHAR quote_char[]; + +/* Local Function Prototypes */ + +/* + * set_quote_proc - pݒ + */ +BOOL CALLBACK set_quote_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) { + case WM_INITDIALOG: + SendDlgItemMessage(hDlg, IDC_EDIT_QUOTE_CHAR, WM_SETTEXT, 0, (LPARAM)quote_char); + break; + + case WM_CLOSE: + EndDialog(hDlg, FALSE); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + SendDlgItemMessage(hDlg, IDC_EDIT_QUOTE_CHAR, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)quote_char); + + WritePrivateProfileString(TEXT("quote"), TEXT("char"), quote_char, ini_path); + EndDialog(hDlg, TRUE); + break; + + case IDCANCEL: + EndDialog(hDlg, FALSE); + break; + } + break; + + default: + return FALSE; + } + return TRUE; +} + +/* + * item_quote - eLXgɈpt + */ +static int item_quote(DATA_INFO *di, const TCHAR *q_char) +{ + HANDLE ret; + BYTE *from_mem, *to_mem; + TCHAR *p, *r; + int size; + + // Rs[bN + if ((from_mem = GlobalLock(di->data)) == NULL) { + return TOOL_ERROR; + } + + // p̕tTCY擾 + size = lstrlen(q_char); + for (p = (TCHAR *)from_mem; *p != TEXT('\0'); p++) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + p++; + size += 2; + continue; + } +#endif + size++; + if (*p == TEXT('\n') && *(p + 1) != TEXT('\0')) { + size += lstrlen(q_char); + } + } + size++; + + // Rs[m + if ((ret = GlobalAlloc(GHND, sizeof(TCHAR) * size)) == NULL) { + GlobalUnlock(di->data); + return TOOL_ERROR; + } + // Rs[惍bN + if ((to_mem = GlobalLock(ret)) == NULL) { + GlobalFree(ret); + GlobalUnlock(di->data); + return TOOL_ERROR; + } + + // p̕t + lstrcpy((TCHAR *)to_mem, q_char); + r = (TCHAR *)to_mem + lstrlen(q_char); + for (p = (TCHAR *)from_mem; *p != TEXT('\0'); p++) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + *(r++) = *(p++); + *(r++) = *p; + continue; + } +#endif + *(r++) = *p; + if (*p == TEXT('\n') && *(p + 1) != TEXT('\0')) { + lstrcpy(r, q_char); + r += lstrlen(q_char); + } + } + *r = TEXT('\0'); + + GlobalUnlock(ret); + GlobalUnlock(di->data); + + GlobalFree(di->data); + di->data = ret; + di->size = sizeof(TCHAR) * size; + return TOOL_DATA_MODIFIED; +} + +/* + * quote - eLXgɈpt + */ +__declspec(dllexport) int CALLBACK quote(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + DATA_INFO *di; + TCHAR *q_char = tei->cmd_line; + int ret = TOOL_SUCCEED; + + if ((tei->cmd_line == NULL || *tei->cmd_line == TEXT('\0')) && + ((tei->call_type & CALLTYPE_MENU) || (tei->call_type & CALLTYPE_VIEWER))) { + if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_QUOTE), GetForegroundWindow(), set_quote_proc, 0) == FALSE) { + return TOOL_CANCEL; + } + } + if (q_char == NULL || *q_char == TEXT('\0')) { + q_char = quote_char; + } + for (; tdi != NULL; tdi = tdi->next) { + if (SendMessage(hWnd, WM_ITEM_CHECK, 0, (LPARAM)tdi->di) == -1) { + continue; + } +#ifdef UNICODE + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)tdi->di); +#else + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("TEXT"), (LPARAM)tdi->di); +#endif + if (di != NULL && di->data != NULL) { + ret |= item_quote(di, q_char); + } + } + return ret; +} + +/* + * quote_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK quote_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_QUOTE), hWnd, set_quote_proc, 0); + return TRUE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_text/resource.h b/CLCLPlugin/tool_text/resource.h new file mode 100644 index 0000000..bb22ca0 --- /dev/null +++ b/CLCLPlugin/tool_text/resource.h @@ -0,0 +1,44 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by tool_text.rc +// +#define IDD_DIALOG_DATE_TIME_FORMAT 101 +#define IDD_DIALOG_QUOTE 102 +#define IDD_DIALOG_JOIN_TEXT 103 +#define IDD_DIALOG_MULTI_SAVE 104 +#define IDD_DIALOG_TEXT_EDIT 105 +#define IDD_DIALOG_DELETE_CRLF 106 +#define IDD_DIALOG_BREAK_CNT 107 +#define IDD_DIALOG_WORD_BREAK 108 +#define IDD_DIALOG_PUT_TEXT 109 +#define IDC_COMBO_DATE 1002 +#define IDC_COMBO_TIME 1003 +#define IDC_EDIT_QUOTE_CHAR 1003 +#define IDC_CHECK_SHOW 1004 +#define IDC_BUTTON1 1005 +#define IDC_BUTTON_SELECT_PATH 1005 +#define IDC_CHECK_ADD_RETURN 1006 +#define IDC_EDIT_PATH 1007 +#define IDC_COMBO_FORMAT 1008 +#define IDC_EDIT_FILE_NAME 1009 +#define IDC_EDIT_TEXT 1010 +#define IDC_CHECK_DELETE_SPACE 1011 +#define IDC_EDIT_BREAK_CNT 1012 +#define IDC_EDIT_M_OIDA 1013 +#define IDC_EDIT_M_BURA 1014 +#define IDC_EDIT_S_OIDA 1015 +#define IDC_EDIT_S_BURA 1016 +#define IDC_EDIT_TAB_SIZE 1017 +#define IDC_EDIT_OPEN 1018 +#define IDC_EDIT_CLOSE 1019 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 110 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1019 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/CLCLPlugin/tool_text/text_edit.c b/CLCLPlugin/tool_text/text_edit.c new file mode 100644 index 0000000..0d79c0e --- /dev/null +++ b/CLCLPlugin/tool_text/text_edit.c @@ -0,0 +1,155 @@ +/* + * tool_text + * + * to_lower.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE + +#include "..\CLCLPlugin.h" + +#include "resource.h" + +/* Define */ +#define ID_SELECT_TIMER 1 + +/* Global Variables */ +extern HINSTANCE hInst; + +/* Local Function Prototypes */ + +/* + * set_edit_proc - eLXgҏWvV[W + */ +BOOL CALLBACK set_edit_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + RECT window_rect; + DATA_INFO *di; + BYTE *mem; + int len; + + switch (uMsg) { + case WM_INITDIALOG: + SendDlgItemMessage(hDlg, IDC_EDIT_TEXT, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM(FALSE, 0)); + + di = (DATA_INFO *)lParam; + // ̃bN + if ((mem = GlobalLock(di->data)) != NULL) { + SendDlgItemMessage(hDlg, IDC_EDIT_TEXT, WM_SETTEXT, 0, (LPARAM)mem); + GlobalUnlock(di->data); + } + SetWindowLong(hDlg, GWL_USERDATA, lParam); + SetTimer(hDlg, ID_SELECT_TIMER, 1, NULL); + break; + + case WM_SIZE: + GetWindowRect(hDlg, (LPRECT)&window_rect); + SetWindowPos(GetDlgItem(hDlg, IDC_EDIT_TEXT), 0, 0, 0, + (window_rect.right - window_rect.left) - (GetSystemMetrics(SM_CXFRAME) * 2), + (window_rect.bottom - window_rect.top) - GetSystemMetrics(SM_CYSIZE) - (GetSystemMetrics(SM_CXFRAME) * 2) - 30, + SWP_NOZORDER); + SetWindowPos(GetDlgItem(hDlg, IDOK), 0, + (window_rect.right - window_rect.left) - (GetSystemMetrics(SM_CXFRAME) * 2) - 200, + (window_rect.bottom - window_rect.top) - GetSystemMetrics(SM_CYSIZE) - (GetSystemMetrics(SM_CXFRAME) * 2) - 25, + 0, 0, SWP_NOZORDER | SWP_NOSIZE); + SetWindowPos(GetDlgItem(hDlg, IDCANCEL), 0, + (window_rect.right - window_rect.left) - (GetSystemMetrics(SM_CXFRAME) * 2) - 100, + (window_rect.bottom - window_rect.top) - GetSystemMetrics(SM_CYSIZE) - (GetSystemMetrics(SM_CXFRAME) * 2) - 25, + 0, 0, SWP_NOZORDER | SWP_NOSIZE); + InvalidateRect(GetDlgItem(hDlg, IDOK), NULL, FALSE); + UpdateWindow(GetDlgItem(hDlg, IDOK)); + InvalidateRect(GetDlgItem(hDlg, IDCANCEL), NULL, FALSE); + UpdateWindow(GetDlgItem(hDlg, IDCANCEL)); + break; + + case WM_CLOSE: + EndDialog(hDlg, FALSE); + break; + + case WM_TIMER: + // ^C}[ + switch (wParam) { + case ID_SELECT_TIMER: + KillTimer(hDlg, wParam); + SendDlgItemMessage(hDlg, IDC_EDIT_TEXT, EM_SETSEL, 0, 0); + break; + } + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + di = (DATA_INFO *)GetWindowLong(hDlg, GWL_USERDATA); + if (di == NULL) { + EndDialog(hDlg, FALSE); + break; + } + GlobalFree(di->data); + + len = SendDlgItemMessage(hDlg, IDC_EDIT_TEXT, WM_GETTEXTLENGTH, 0, 0) + 1; + di->data = GlobalAlloc(GPTR, sizeof(TCHAR) * len); + if (di->data != NULL) { + if ((mem = GlobalLock(di->data)) != NULL) { + *mem = TEXT('\0'); + SendDlgItemMessage(hDlg, IDC_EDIT_TEXT, WM_GETTEXT, len, (LPARAM)mem); + GlobalUnlock(di->data); + di->size = sizeof(TCHAR) * len; + } + } + EndDialog(hDlg, TRUE); + break; + + case IDCANCEL: + EndDialog(hDlg, FALSE); + break; + } + break; + + default: + return FALSE; + } + return TRUE; +} + +/* + * text_edit - eLXgɕϊ + */ +__declspec(dllexport) int CALLBACK text_edit(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + DATA_INFO *di; + + if (tdi == NULL) { + return TOOL_SUCCEED; + } + + // `I +#ifdef UNICODE + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)tdi->di); +#else + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("TEXT"), (LPARAM)tdi->di); +#endif + if (di == NULL || di->data == NULL) { + return TOOL_SUCCEED; + } + + if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_TEXT_EDIT), GetForegroundWindow(), set_edit_proc, (LPARAM)di) == FALSE) { + return TOOL_CANCEL; + } + return TOOL_DATA_MODIFIED; +} + +/* + * text_edit_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK text_edit_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + return FALSE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_text/to_lower.c b/CLCLPlugin/tool_text/to_lower.c new file mode 100644 index 0000000..8b99816 --- /dev/null +++ b/CLCLPlugin/tool_text/to_lower.c @@ -0,0 +1,71 @@ +/* + * tool_text + * + * to_lower.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE + +#include "..\CLCLPlugin.h" + +/* Define */ + +/* Global Variables */ + +/* Local Function Prototypes */ + +/* + * item_to_lower - ɕϊ + */ +static int item_to_lower(DATA_INFO *di) +{ + BYTE *mem; + + // ̃bN + if ((mem = GlobalLock(di->data)) == NULL) { + return TOOL_ERROR; + } + + // ɕϊ + CharLower((TCHAR *)mem); + + GlobalUnlock(di->data); + return TOOL_DATA_MODIFIED; +} + +/* + * to_lower - eLXgɕϊ + */ +__declspec(dllexport) int CALLBACK to_lower(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + DATA_INFO *di; + int ret = TOOL_SUCCEED; + + for (; tdi != NULL; tdi = tdi->next) { +#ifdef UNICODE + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)tdi->di); +#else + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("TEXT"), (LPARAM)tdi->di); +#endif + if (di != NULL && di->data != NULL) { + ret |= item_to_lower(di); + } + } + return ret; +} + +/* + * to_lower_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK to_lower_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + return FALSE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_text/to_upper.c b/CLCLPlugin/tool_text/to_upper.c new file mode 100644 index 0000000..84bbf16 --- /dev/null +++ b/CLCLPlugin/tool_text/to_upper.c @@ -0,0 +1,71 @@ +/* + * tool_text + * + * to_upper.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE + +#include "..\CLCLPlugin.h" + +/* Define */ + +/* Global Variables */ + +/* Local Function Prototypes */ + +/* + * item_to_upper - 啶ɕϊ + */ +static int item_to_upper(DATA_INFO *di) +{ + BYTE *mem; + + // ̃bN + if ((mem = GlobalLock(di->data)) == NULL) { + return TOOL_ERROR; + } + + // 啶ɕϊ + CharUpper((TCHAR *)mem); + + GlobalUnlock(di->data); + return TOOL_DATA_MODIFIED; +} + +/* + * to_upper - eLXg啶ɕϊ + */ +__declspec(dllexport) int CALLBACK to_upper(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + DATA_INFO *di; + int ret = TOOL_SUCCEED; + + for (; tdi != NULL; tdi = tdi->next) { +#ifdef UNICODE + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)tdi->di); +#else + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("TEXT"), (LPARAM)tdi->di); +#endif + if (di != NULL && di->data != NULL) { + ret |= item_to_upper(di); + } + } + return ret; +} + +/* + * to_upper_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK to_upper_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + return FALSE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_text/tool_text.c b/CLCLPlugin/tool_text/tool_text.c new file mode 100644 index 0000000..44b19d6 --- /dev/null +++ b/CLCLPlugin/tool_text/tool_text.c @@ -0,0 +1,187 @@ +/* + * tool_text + * + * tool_text.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE + +#include "..\CLCLPlugin.h" + +/* Define */ +#define INI_FILE_NAME TEXT("tool_text.ini") + +/* Global Variables */ +HINSTANCE hInst; +TCHAR ini_path[BUF_SIZE]; + +TCHAR quote_char[BUF_SIZE]; + +int word_break_break_cnt; +int word_break_tab_size; +TCHAR word_break_m_oida[BUF_SIZE]; +TCHAR word_break_m_bura[BUF_SIZE]; +TCHAR word_break_s_oida[BUF_SIZE]; +TCHAR word_break_s_bura[BUF_SIZE]; + +TCHAR put_text_open[BUF_SIZE]; +TCHAR put_text_close[BUF_SIZE]; + +int delete_crlf_delete_space; + +int join_text_add_return; + +/* Local Function Prototypes */ +static BOOL dll_initialize(void); +static BOOL dll_uninitialize(void); + +/* + * DllMain - C + */ +int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved) +{ + switch (fdwReason) { + case DLL_PROCESS_ATTACH: + hInst = hInstance; + dll_initialize(); + break; + + case DLL_PROCESS_DETACH: + dll_uninitialize(); + break; + + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + break; + } + return TRUE; +} + +/* + * dll_initialize - + */ +static BOOL dll_initialize(void) +{ + TCHAR app_path[BUF_SIZE]; + TCHAR *p, *r; + + GetModuleFileName(hInst, app_path, BUF_SIZE - 1); + for (p = r = app_path; *p != TEXT('\0'); p++) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + p++; + continue; + } +#endif // UNICODE + if (*p == TEXT('\\') || *p == TEXT('/')) { + r = p; + } + } + *r = TEXT('\0'); + wsprintf(ini_path, TEXT("%s\\%s"), app_path, INI_FILE_NAME); + + GetPrivateProfileString(TEXT("quote"), TEXT("char"), TEXT(">"), quote_char, BUF_SIZE - 1, ini_path); + + word_break_break_cnt = GetPrivateProfileInt(TEXT("word_break"), TEXT("break_cnt"), 80, ini_path); + word_break_tab_size = GetPrivateProfileInt(TEXT("word_break"), TEXT("tab_size"), 8, ini_path); + GetPrivateProfileString(TEXT("word_break"), TEXT("m_oida"), TEXT(""), word_break_m_oida, BUF_SIZE - 1, ini_path); + GetPrivateProfileString(TEXT("word_break"), TEXT("m_bura"), TEXT(""), word_break_m_bura, BUF_SIZE - 1, ini_path); + GetPrivateProfileString(TEXT("word_break"), TEXT("s_oida"), TEXT("\\$([{"), word_break_s_oida, BUF_SIZE - 1, ini_path); + GetPrivateProfileString(TEXT("word_break"), TEXT("s_bura"), TEXT(",.?!%:;)]}"), word_break_s_bura, BUF_SIZE - 1, ini_path); + + GetPrivateProfileString(TEXT("put_text"), TEXT("open"), TEXT(""), put_text_open, BUF_SIZE - 1, ini_path); + GetPrivateProfileString(TEXT("put_text"), TEXT("close"), TEXT(""), put_text_close, BUF_SIZE - 1, ini_path); + + delete_crlf_delete_space = GetPrivateProfileInt(TEXT("delete_crlf"), TEXT("delete_space"), 1, ini_path); + + join_text_add_return = GetPrivateProfileInt(TEXT("join_text"), TEXT("add_return"), 1, ini_path); + return TRUE; +} + +/* + * dll_uninitialize - I + */ +static BOOL dll_uninitialize(void) +{ + return TRUE; +} + +/* + * get_tool_info_w - c[擾 + */ +__declspec(dllexport) BOOL CALLBACK get_tool_info_w(const HWND hWnd, const int index, TOOL_GET_INFO *tgi) +{ + switch (index) { + case 0: + lstrcpy(tgi->title, TEXT("To &Lower")); + lstrcpy(tgi->func_name, TEXT("to_lower")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; + return TRUE; + + case 1: + lstrcpy(tgi->title, TEXT("To &Upper")); + lstrcpy(tgi->func_name, TEXT("to_upper")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; + return TRUE; + + case 2: + lstrcpy(tgi->title, TEXT("&Quotation")); + lstrcpy(tgi->func_name, TEXT("quote")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; + return TRUE; + + case 3: + lstrcpy(tgi->title, TEXT("U&n Quotation")); + lstrcpy(tgi->func_name, TEXT("unquote")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; + return TRUE; + + case 4: + lstrcpy(tgi->title, TEXT("&Word Wrap")); + lstrcpy(tgi->func_name, TEXT("word_break")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; + return TRUE; + + case 5: + lstrcpy(tgi->title, TEXT("<&TAG>")); + lstrcpy(tgi->func_name, TEXT("put_text")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; + return TRUE; + + case 6: + lstrcpy(tgi->title, TEXT("Delete C&RLF")); + lstrcpy(tgi->func_name, TEXT("delete_crlf")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; + return TRUE; + + case 7: + lstrcpy(tgi->title, TEXT("C&onnection of text")); + lstrcpy(tgi->func_name, TEXT("join_text")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_VIEWER; + return TRUE; + + case 8: + lstrcpy(tgi->title, TEXT("&Edit")); + lstrcpy(tgi->func_name, TEXT("text_edit")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE; + return TRUE; + } + return FALSE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_text/tool_text.def b/CLCLPlugin/tool_text/tool_text.def new file mode 100644 index 0000000..238499e --- /dev/null +++ b/CLCLPlugin/tool_text/tool_text.def @@ -0,0 +1,29 @@ +EXETYPE WINDOWS + +EXPORTS + get_tool_info_w + + to_lower + to_lower_property + to_upper + to_upper_property + + quote + quote_property + unquote + unquote_property + + word_break + word_break_property + + put_text + put_text_property + + delete_crlf + delete_crlf_property + + join_text + join_text_property + + text_edit + text_edit_property diff --git a/CLCLPlugin/tool_text/tool_text.dsp b/CLCLPlugin/tool_text/tool_text.dsp new file mode 100644 index 0000000..ff07271 --- /dev/null +++ b/CLCLPlugin/tool_text/tool_text.dsp @@ -0,0 +1,157 @@ +# Microsoft Developer Studio Project File - Name="tool_text" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** ҏWȂł ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=tool_text - Win32 Debug +!MESSAGE ͗LҲ̧قł͂܂B ۼުĂނ邽߂ɂ NMAKE gpĂB +!MESSAGE [Ҳ̧ق̴߰] ނgpĎsĂ +!MESSAGE +!MESSAGE NMAKE /f "tool_text.mak". +!MESSAGE +!MESSAGE NMAKE ̎sɍ\wł܂ +!MESSAGE ײݏϸۂ̐ݒ`܂B: +!MESSAGE +!MESSAGE NMAKE /f "tool_text.mak" CFG="tool_text - Win32 Debug" +!MESSAGE +!MESSAGE I”\ Ӱ: +!MESSAGE +!MESSAGE "tool_text - Win32 Release" ("Win32 (x86) Dynamic-Link Library" p) +!MESSAGE "tool_text - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" p) +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "tool_text - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEXT_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /Ox /Og /Os /Ob0 /Gf /Gy /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEXT_EXPORTS" /D "UNICODE" /D "_UNICODE" /YX /FD /c +# SUBTRACT CPP /Ow +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x411 /d "NDEBUG" +# ADD RSC /l 0x411 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /opt:nowin98 +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "tool_text - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEXT_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEXT_EXPORTS" /D "UNICODE" /D "_UNICODE" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x411 /d "_DEBUG" +# ADD RSC /l 0x411 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "tool_text - Win32 Release" +# Name "tool_text - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\delete_crlf.c +# End Source File +# Begin Source File + +SOURCE=.\join_text.c +# End Source File +# Begin Source File + +SOURCE=.\put_text.c +# End Source File +# Begin Source File + +SOURCE=.\quote.c +# End Source File +# Begin Source File + +SOURCE=.\text_edit.c +# End Source File +# Begin Source File + +SOURCE=.\to_lower.c +# End Source File +# Begin Source File + +SOURCE=.\to_upper.c +# End Source File +# Begin Source File + +SOURCE=.\tool_text.c +# End Source File +# Begin Source File + +SOURCE=.\tool_text.def +# End Source File +# Begin Source File + +SOURCE=.\tool_text.rc +# End Source File +# Begin Source File + +SOURCE=.\unquote.c +# End Source File +# Begin Source File + +SOURCE=.\word_break.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\CLCLPlugin.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/CLCLPlugin/tool_text/tool_text.dsw b/CLCLPlugin/tool_text/tool_text.dsw new file mode 100644 index 0000000..a33d36b --- /dev/null +++ b/CLCLPlugin/tool_text/tool_text.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# x: ܰ߰ ̧ ҏW܂͍폜Ȃł! + +############################################################################### + +Project: "tool_text"=".\tool_text.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/CLCLPlugin/tool_text/tool_text.rc b/CLCLPlugin/tool_text/tool_text.rc new file mode 100644 index 0000000..5307699 --- /dev/null +++ b/CLCLPlugin/tool_text/tool_text.rc @@ -0,0 +1,233 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// { resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) +#ifdef _WIN32 +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT +#pragma code_page(932) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // { resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// p (ض) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DIALOG_QUOTE DIALOG DISCARDABLE 0, 0, 151, 69 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Quotation" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "&Quotation character:",IDC_STATIC,10,10,90,10 + EDITTEXT IDC_EDIT_QUOTE_CHAR,10,20,130,13,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,20,45,50,14 + PUSHBUTTON "Cancel",IDCANCEL,75,45,50,14 +END + +IDD_DIALOG_JOIN_TEXT DIALOG DISCARDABLE 0, 0, 203, 69 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Connection of text" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,50,45,50,14 + PUSHBUTTON "Cancel",IDCANCEL,105,45,50,14 + CONTROL "A new-line is inserted between the texts to connect.", + IDC_CHECK_ADD_RETURN,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,10,15,180,10 +END + +IDD_DIALOG_TEXT_EDIT DIALOG DISCARDABLE 0, 0, 218, 168 +STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Edit" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_EDIT_TEXT,0,0,215,145,ES_MULTILINE | ES_AUTOVSCROLL | + ES_AUTOHSCROLL | ES_NOHIDESEL | ES_WANTRETURN | + WS_VSCROLL | WS_HSCROLL + DEFPUSHBUTTON "OK",IDOK,110,150,50,14 + PUSHBUTTON "Cancel",IDCANCEL,165,150,50,14 +END + +IDD_DIALOG_DELETE_CRLF DIALOG DISCARDABLE 0, 0, 195, 65 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Delete CRLF" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "The blank of the head of the sentence is removed.", + IDC_CHECK_DELETE_SPACE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,10,10,175,10 + DEFPUSHBUTTON "OK",IDOK,45,40,50,14 + PUSHBUTTON "Cancel",IDCANCEL,100,40,50,14 +END + +IDD_DIALOG_BREAK_CNT DIALOG DISCARDABLE 0, 0, 126, 65 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Word Wrap" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "&Number of word wrap:",IDC_STATIC,10,10,90,10 + EDITTEXT IDC_EDIT_BREAK_CNT,10,20,35,13,ES_RIGHT | ES_AUTOHSCROLL | + ES_NUMBER + LTEXT "bytes",IDC_STATIC,50,22,40,10 + DEFPUSHBUTTON "OK",IDOK,10,40,50,14 + PUSHBUTTON "Cancel",IDCANCEL,65,40,50,14 +END + +IDD_DIALOG_WORD_BREAK DIALOG DISCARDABLE 0, 0, 135, 65 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Word Wrap" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "&TAB size:",IDC_STATIC,10,10,90,10 + EDITTEXT IDC_EDIT_TAB_SIZE,10,20,35,13,ES_RIGHT | ES_AUTOHSCROLL | + ES_NUMBER + DEFPUSHBUTTON "OK",IDOK,15,40,50,14 + PUSHBUTTON "Cancel",IDCANCEL,70,40,50,14 +END + +IDD_DIALOG_PUT_TEXT DIALOG DISCARDABLE 0, 0, 149, 93 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "&Start character:",IDC_STATIC,5,5,60,10 + EDITTEXT IDC_EDIT_OPEN,5,15,135,13,ES_AUTOHSCROLL + LTEXT "&End character:",IDC_STATIC,5,35,60,10 + EDITTEXT IDC_EDIT_CLOSE,5,45,135,13,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,35,70,50,14 + PUSHBUTTON "Cancel",IDCANCEL,90,70,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_DIALOG_QUOTE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 144 + TOPMARGIN, 7 + BOTTOMMARGIN, 62 + END + + IDD_DIALOG_JOIN_TEXT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 196 + TOPMARGIN, 7 + BOTTOMMARGIN, 62 + END + + IDD_DIALOG_TEXT_EDIT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 211 + TOPMARGIN, 7 + BOTTOMMARGIN, 161 + END + + IDD_DIALOG_DELETE_CRLF, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 188 + TOPMARGIN, 7 + BOTTOMMARGIN, 58 + END + + IDD_DIALOG_BREAK_CNT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 119 + TOPMARGIN, 7 + BOTTOMMARGIN, 58 + END + + IDD_DIALOG_WORD_BREAK, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 128 + TOPMARGIN, 7 + BOTTOMMARGIN, 58 + END + + IDD_DIALOG_PUT_TEXT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 142 + TOPMARGIN, 7 + BOTTOMMARGIN, 86 + END +END +#endif // APSTUDIO_INVOKED + +#endif // p (ض) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/CLCLPlugin/tool_text/tool_text.txt b/CLCLPlugin/tool_text/tool_text.txt new file mode 100644 index 0000000..410045a --- /dev/null +++ b/CLCLPlugin/tool_text/tool_text.txt @@ -0,0 +1,4 @@ +tool_text Ver 0.0.3 +-- + +Please add DLL to the tool of an CLCL option. diff --git a/CLCLPlugin/tool_text/unquote.c b/CLCLPlugin/tool_text/unquote.c new file mode 100644 index 0000000..140d96d --- /dev/null +++ b/CLCLPlugin/tool_text/unquote.c @@ -0,0 +1,197 @@ +/* + * tool_text + * + * unquote.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE + +#include "..\CLCLPlugin.h" + +#include "resource.h" + +/* Define */ + +/* Global Variables */ +extern HINSTANCE hInst; +extern TCHAR ini_path[]; + +extern TCHAR quote_char[]; + +/* Local Function Prototypes */ +BOOL CALLBACK set_quote_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + +/* + * GetStrLen - rp̒̕擾 + */ +static int GetStrLen(const TCHAR *buf, int len) +{ + int i; + + if (len < 0) { + return len; + } + + for (i = 0; i < len; i++) { + if (*buf == TEXT('\0')) { + break; + } + buf++; + } + return i; +} + +/* + * lstrcmpn - Q‚̕𕶎rs + */ +int lstrcmpn(const TCHAR *buf1, const TCHAR *buf2, const int len) +{ + int ret; + int len1, len2; + + len1 = GetStrLen(buf1, len); + len2 = GetStrLen(buf2, len); + + ret = CompareString(MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), SORT_DEFAULT), + 0, buf1, len1, buf2, len2); + return ret - 2; +} + +/* + * item_unquote - eLXg̈p폜 + */ +static int item_unquote(DATA_INFO *di, const TCHAR *q_char) +{ + HANDLE ret; + BYTE *from_mem, *to_mem; + TCHAR *p, *r; + int size; + + // Rs[bN + if ((from_mem = GlobalLock(di->data)) == NULL) { + return TOOL_ERROR; + } + + // pTCY擾 + p = (TCHAR *)from_mem; + if (lstrcmpn(p, q_char, lstrlen(q_char)) == 0) { + p += lstrlen(q_char); + } + size = 0; + while (*p != TEXT('\0')) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + p += 2; + size += 2; + continue; + } +#endif + size++; + if (*p == TEXT('\n') && *(p + 1) != TEXT('\0')) { + p++; + if (lstrcmpn(p, q_char, lstrlen(q_char)) == 0) { + p += lstrlen(q_char); + } + } else { + p++; + } + } + size++; + + // Rs[m + if ((ret = GlobalAlloc(GHND, sizeof(TCHAR) * size)) == NULL) { + GlobalUnlock(di->data); + return TOOL_ERROR; + } + // Rs[惍bN + if ((to_mem = GlobalLock(ret)) == NULL) { + GlobalFree(ret); + GlobalUnlock(di->data); + return TOOL_ERROR; + } + + // p̏ + p = (TCHAR *)from_mem; + if (lstrcmpn(p, q_char, lstrlen(q_char)) == 0) { + p += lstrlen(q_char); + } + r = (TCHAR *)to_mem; + while (*p != TEXT('\0')) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + *(r++) = *(p++); + *(r++) = *(p++); + continue; + } +#endif + *(r++) = *p; + if (*p == TEXT('\n') && *(p + 1) != TEXT('\0')) { + p++; + if (lstrcmpn(p, q_char, lstrlen(q_char)) == 0) { + p += lstrlen(q_char); + } + } else { + p++; + } + } + *r = TEXT('\0'); + + GlobalUnlock(ret); + GlobalUnlock(di->data); + + GlobalFree(di->data); + di->data = ret; + di->size = sizeof(TCHAR) * size; + return TOOL_DATA_MODIFIED; +} + +/* + * unquote - eLXg̈p폜 + */ +__declspec(dllexport) int CALLBACK unquote(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + DATA_INFO *di; + TCHAR *q_char = tei->cmd_line; + int ret = TOOL_SUCCEED; + + if ((tei->cmd_line == NULL || *tei->cmd_line == TEXT('\0')) && + ((tei->call_type & CALLTYPE_MENU) || (tei->call_type & CALLTYPE_VIEWER))) { + if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_QUOTE), GetForegroundWindow(), set_quote_proc, 0) == FALSE) { + return TOOL_CANCEL; + } + } + if (q_char == NULL || *q_char == TEXT('\0')) { + q_char = quote_char; + } + for (; tdi != NULL; tdi = tdi->next) { + if (SendMessage(hWnd, WM_ITEM_CHECK, 0, (LPARAM)tdi->di) == -1) { + continue; + } +#ifdef UNICODE + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)tdi->di); +#else + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("TEXT"), (LPARAM)tdi->di); +#endif + if (di != NULL && di->data != NULL) { + ret |= item_unquote(di, q_char); + } + } + return ret; +} + +/* + * unquote_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK unquote_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_QUOTE), hWnd, set_quote_proc, 0); + return TRUE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_text/word_break.c b/CLCLPlugin/tool_text/word_break.c new file mode 100644 index 0000000..fa4061f --- /dev/null +++ b/CLCLPlugin/tool_text/word_break.c @@ -0,0 +1,455 @@ +/* + * tool_text + * + * word_break.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE +#include + +#include "..\CLCLPlugin.h" + +#include "resource.h" + +/* Define */ +#define IsBreakAlNum(c) ((c >= TEXT('a') && c <= TEXT('z')) || \ + (c >= TEXT('A') && c <= TEXT('Z')) || \ + c == TEXT('\'') || \ + (c >= TEXT('0') && c <= TEXT('9'))) + +/* Global Variables */ +extern HINSTANCE hInst; +extern TCHAR ini_path[]; + +extern TCHAR quote_char[]; + +extern int word_break_break_cnt; +extern int word_break_tab_size; +extern TCHAR word_break_m_oida[BUF_SIZE]; +extern TCHAR word_break_m_bura[BUF_SIZE]; +extern TCHAR word_break_s_oida[BUF_SIZE]; +extern TCHAR word_break_s_bura[BUF_SIZE]; + +/* Local Function Prototypes */ + +/* + * multibytes_rule_check - Sp֑̋`FbN + */ +static void multibytes_rule_check(TCHAR *p, BOOL *top_flag, BOOL *end_flag) +{ + TCHAR *t; + + // s֑ + if (word_break_m_oida != NULL) { + for (t = word_break_m_oida; *t != TEXT('\0'); t += 2) { + if (*p == *t && *(p + 1) == *(t + 1)) { + *top_flag = TRUE; + return; + } + } + } + // s֑ + if (word_break_m_bura != NULL) { + for (t = word_break_m_bura; *t != TEXT('\0'); t += 2) { + if (*p == *t && *(p + 1) == *(t + 1)) { + *end_flag = TRUE; + return; + } + } + } +} + +/* + * rule_check - p֑̋`FbN + */ +static void rule_check(TCHAR *p, BOOL *top_flag, BOOL *end_flag) +{ + TCHAR *t; + + // s֑ + if (word_break_s_oida != NULL) { + for (t = word_break_s_oida; *t != TEXT('\0'); t++) { + if (*p == *t) { + *top_flag = TRUE; + return; + } + } + } + // s֑ + if (word_break_s_bura != NULL) { + for (t = word_break_s_bura; *t != TEXT('\0'); t++) { + if (*p == *t) { + *end_flag = TRUE; + return; + } + } + } +} + +/* + * get_word_break_size - w̒Ő܂ԂƂ̃TCY + */ +static int get_word_break_size(TCHAR *buf, const int break_cnt) +{ + TCHAR *p, *s; + int cnt = 0; + int ret = 0; + BOOL top_flag; + BOOL end_flag; + + if (break_cnt <= 0) { + return lstrlen(buf); + } + + p = buf; + + while (*p != TEXT('\0')) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + top_flag = FALSE; + end_flag = FALSE; + if ((cnt + 2) >= break_cnt) { + multibytes_rule_check(p, &top_flag, &end_flag); + } + + if ((((cnt + 2) > break_cnt && end_flag == FALSE) || + ((cnt + 2) == break_cnt && top_flag == TRUE))) { + cnt = 0; + ret += 2; + } + cnt += 2; + p += 2; + ret += 2; + continue; + } +#endif + if (*p == TEXT('\r')) { + cnt = 0; + p += 2; + ret += 2; + + } else if (*p == TEXT('\t')) { + cnt += (word_break_tab_size - (cnt % word_break_tab_size)); + if (cnt > break_cnt) { + cnt = (word_break_tab_size - (cnt % word_break_tab_size)); + ret += 2; + } + p++; + ret++; + + } else if (IsBreakAlNum(*p)) { + for (s = p; IsBreakAlNum(*p); p++) { + cnt++; + } + if (*p == ' ') { + cnt++; + p++; + } + if (cnt > break_cnt) { + if (cnt != p - s) { + ret += 2; + } + cnt = p - s; + } + ret += p - s; + + } else { + top_flag = FALSE; + end_flag = FALSE; + if ((cnt + 1) >= break_cnt) { + rule_check(p, &top_flag, &end_flag); + } + + if ((((cnt + 1) > break_cnt && end_flag == FALSE) || + ((cnt + 1) == break_cnt && top_flag == TRUE))) { + cnt = 0; + ret += 2; + } + cnt++; + p++; + ret++; + } + } + return ret; +} + +/* + * set_word_break - w̒Ő܂Ԃ + */ +static void set_word_break(TCHAR *buf, TCHAR *ret, const int break_cnt) +{ + TCHAR *p, *r, *s; + int cnt = 0; + BOOL TopFlag; + BOOL EndFlag; + + if (break_cnt <= 0) { + lstrcpy(ret, buf); + return; + } + + p = buf; + r = ret; + while (*p != TEXT('\0')) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + // 2oCgR[h + TopFlag = FALSE; + EndFlag = FALSE; + if ((cnt + 2) >= break_cnt) { + multibytes_rule_check(p, &TopFlag, &EndFlag); + } + + if ((((cnt + 2) > break_cnt && EndFlag == FALSE) || + ((cnt + 2) == break_cnt && TopFlag == TRUE))) { + cnt = 0; + *(r++) = '\r'; + *(r++) = '\n'; + } + cnt += 2; + *(r++) = *(p++); + *(r++) = *(p++); + continue; + } +#endif + if (*p == TEXT('\r')) { + // s + cnt = 0; + *(r++) = *(p++); + *(r++) = *(p++); + + } else if (*p == TEXT('\t')) { + // ^u + cnt += (word_break_tab_size - (cnt % word_break_tab_size)); + if (cnt > break_cnt) { + cnt = (word_break_tab_size - (cnt % word_break_tab_size)); + *(r++) = TEXT('\r'); + *(r++) = TEXT('\n'); + } + *(r++) = *(p++); + + } else if (IsBreakAlNum(*p)) { + // p͓rsȂ + for (s = p; IsBreakAlNum(*p); p++) { + cnt++; + } + if (*p == TEXT(' ')) { + cnt++; + p++; + } + if (cnt > break_cnt) { + if (cnt != p - s) { + *(r++) = TEXT('\r'); + *(r++) = TEXT('\n'); + } + cnt = p - s; + } + for (; s != p; s++) { + *(r++) = *s; + } + + } else { + TopFlag = FALSE; + EndFlag = FALSE; + if ((cnt + 1) >= break_cnt) { + rule_check(p, &TopFlag, &EndFlag); + } + + if ((((cnt + 1) > break_cnt && EndFlag == FALSE) || + ((cnt + 1) == break_cnt && TopFlag == TRUE))) { + cnt = 0; + *(r++) = TEXT('\r'); + *(r++) = TEXT('\n'); + } + cnt++; + *(r++) = *(p++); + } + } + *r = TEXT('\0'); +} + +/* + * item_quote - eLXg̐` + */ +static int item_word_break(DATA_INFO *di, const int break_cnt) +{ + HANDLE ret; + BYTE *from_mem, *to_mem; + int size; + + // Rs[bN + if ((from_mem = GlobalLock(di->data)) == NULL) { + return TOOL_ERROR; + } + + // TCY擾 + size = get_word_break_size((TCHAR *)from_mem, break_cnt); + size++; + + // Rs[m + if ((ret = GlobalAlloc(GHND, sizeof(TCHAR) * size)) == NULL) { + GlobalUnlock(di->data); + return TOOL_ERROR; + } + // Rs[惍bN + if ((to_mem = GlobalLock(ret)) == NULL) { + GlobalFree(ret); + GlobalUnlock(di->data); + return TOOL_ERROR; + } + + // ܂Ԃ + set_word_break((TCHAR *)from_mem, (TCHAR *)to_mem, break_cnt); + + GlobalUnlock(ret); + GlobalUnlock(di->data); + + GlobalFree(di->data); + di->data = ret; + di->size = sizeof(TCHAR) * size; + return TOOL_DATA_MODIFIED; +} + +/* + * set_break_cnt_proc - ܂Ԃ̐ݒ + */ +static BOOL CALLBACK set_break_cnt_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + TCHAR buf[BUF_SIZE]; + + switch (uMsg) { + case WM_INITDIALOG: + SetDlgItemInt(hDlg, IDC_EDIT_BREAK_CNT, word_break_break_cnt, FALSE); + break; + + case WM_CLOSE: + EndDialog(hDlg, FALSE); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + word_break_break_cnt = GetDlgItemInt(hDlg, IDC_EDIT_BREAK_CNT, NULL, FALSE); + + wsprintf(buf, TEXT("%d"), word_break_break_cnt); + WritePrivateProfileString(TEXT("word_break"), TEXT("break_cnt"), buf, ini_path); + EndDialog(hDlg, TRUE); + break; + + case IDCANCEL: + EndDialog(hDlg, FALSE); + break; + } + break; + + default: + return FALSE; + } + return TRUE; +} + +/* + * word_break - eLXg̐` + */ +__declspec(dllexport) int CALLBACK word_break(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + DATA_INFO *di; + int cnt; + int ret = TOOL_SUCCEED; + + if (tei->cmd_line != NULL && *tei->cmd_line != TEXT('\0')) { + cnt = _ttol(tei->cmd_line); + + } else { + if ((tei->call_type & CALLTYPE_MENU) || (tei->call_type & CALLTYPE_VIEWER)) { + if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_BREAK_CNT), GetForegroundWindow(), set_break_cnt_proc, 0) == FALSE) { + return TOOL_CANCEL; + } + } + cnt = word_break_break_cnt; + } + for (; tdi != NULL; tdi = tdi->next) { + if (SendMessage(hWnd, WM_ITEM_CHECK, 0, (LPARAM)tdi->di) == -1) { + continue; + } +#ifdef UNICODE + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)tdi->di); +#else + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("TEXT"), (LPARAM)tdi->di); +#endif + if (di != NULL && di->data != NULL) { + ret |= item_word_break(di, cnt); + } + } + return ret; +} + +/* + * set_word_break_proc - pݒ + */ +static BOOL CALLBACK set_word_break_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + TCHAR buf[BUF_SIZE]; + + switch (uMsg) { + case WM_INITDIALOG: + SetDlgItemInt(hDlg, IDC_EDIT_TAB_SIZE, word_break_tab_size, FALSE); + + SendDlgItemMessage(hDlg, IDC_EDIT_M_OIDA, WM_SETTEXT, 0, (LPARAM)word_break_m_oida); + SendDlgItemMessage(hDlg, IDC_EDIT_M_BURA, WM_SETTEXT, 0, (LPARAM)word_break_m_bura); + SendDlgItemMessage(hDlg, IDC_EDIT_S_OIDA, WM_SETTEXT, 0, (LPARAM)word_break_s_oida); + SendDlgItemMessage(hDlg, IDC_EDIT_S_BURA, WM_SETTEXT, 0, (LPARAM)word_break_s_bura); + break; + + case WM_CLOSE: + EndDialog(hDlg, FALSE); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + word_break_tab_size = GetDlgItemInt(hDlg, IDC_EDIT_TAB_SIZE, NULL, FALSE); + + SendDlgItemMessage(hDlg, IDC_EDIT_M_OIDA, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)word_break_m_oida); + SendDlgItemMessage(hDlg, IDC_EDIT_M_BURA, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)word_break_m_bura); + SendDlgItemMessage(hDlg, IDC_EDIT_S_OIDA, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)word_break_s_oida); + SendDlgItemMessage(hDlg, IDC_EDIT_S_BURA, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)word_break_s_bura); + + wsprintf(buf, TEXT("%d"), word_break_tab_size); + WritePrivateProfileString(TEXT("word_break"), TEXT("tab_size"), buf, ini_path); + + WritePrivateProfileString(TEXT("word_break"), TEXT("m_oida"), word_break_m_oida, ini_path); + WritePrivateProfileString(TEXT("word_break"), TEXT("m_bura"), word_break_m_bura, ini_path); + WritePrivateProfileString(TEXT("word_break"), TEXT("s_oida"), word_break_s_oida, ini_path); + WritePrivateProfileString(TEXT("word_break"), TEXT("s_bura"), word_break_s_bura, ini_path); + EndDialog(hDlg, TRUE); + break; + + case IDCANCEL: + EndDialog(hDlg, FALSE); + break; + } + break; + + default: + return FALSE; + } + return TRUE; +} + +/* + * word_break_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK word_break_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_WORD_BREAK), hWnd, set_word_break_proc, 0); + return TRUE; +} +/* End of source */ From 76830aab776c7a5abbd02bd590d0f8c2a36538b4 Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 11:59:25 +0200 Subject: [PATCH 05/22] converted to VS16 solution/project --- CLCLPlugin/tool_text/tool_text.dsp | 157 ----------------- CLCLPlugin/tool_text/tool_text.dsw | 29 ---- CLCLPlugin/tool_text/tool_text.rc | 4 +- CLCLPlugin/tool_text/tool_text.sln | 25 +++ CLCLPlugin/tool_text/tool_text.vcxproj | 161 ++++++++++++++++++ .../tool_text/tool_text.vcxproj.filters | 67 ++++++++ 6 files changed, 255 insertions(+), 188 deletions(-) delete mode 100644 CLCLPlugin/tool_text/tool_text.dsp delete mode 100644 CLCLPlugin/tool_text/tool_text.dsw create mode 100644 CLCLPlugin/tool_text/tool_text.sln create mode 100644 CLCLPlugin/tool_text/tool_text.vcxproj create mode 100644 CLCLPlugin/tool_text/tool_text.vcxproj.filters diff --git a/CLCLPlugin/tool_text/tool_text.dsp b/CLCLPlugin/tool_text/tool_text.dsp deleted file mode 100644 index ff07271..0000000 --- a/CLCLPlugin/tool_text/tool_text.dsp +++ /dev/null @@ -1,157 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tool_text" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** ҏWȂł ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=tool_text - Win32 Debug -!MESSAGE ͗LҲ̧قł͂܂B ۼުĂނ邽߂ɂ NMAKE gpĂB -!MESSAGE [Ҳ̧ق̴߰] ނgpĎsĂ -!MESSAGE -!MESSAGE NMAKE /f "tool_text.mak". -!MESSAGE -!MESSAGE NMAKE ̎sɍ\wł܂ -!MESSAGE ײݏϸۂ̐ݒ`܂B: -!MESSAGE -!MESSAGE NMAKE /f "tool_text.mak" CFG="tool_text - Win32 Debug" -!MESSAGE -!MESSAGE I”\ Ӱ: -!MESSAGE -!MESSAGE "tool_text - Win32 Release" ("Win32 (x86) Dynamic-Link Library" p) -!MESSAGE "tool_text - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" p) -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "tool_text - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEXT_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /Ox /Og /Os /Ob0 /Gf /Gy /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEXT_EXPORTS" /D "UNICODE" /D "_UNICODE" /YX /FD /c -# SUBTRACT CPP /Ow -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x411 /d "NDEBUG" -# ADD RSC /l 0x411 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /opt:nowin98 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "tool_text - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEXT_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEXT_EXPORTS" /D "UNICODE" /D "_UNICODE" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x411 /d "_DEBUG" -# ADD RSC /l 0x411 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "tool_text - Win32 Release" -# Name "tool_text - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\delete_crlf.c -# End Source File -# Begin Source File - -SOURCE=.\join_text.c -# End Source File -# Begin Source File - -SOURCE=.\put_text.c -# End Source File -# Begin Source File - -SOURCE=.\quote.c -# End Source File -# Begin Source File - -SOURCE=.\text_edit.c -# End Source File -# Begin Source File - -SOURCE=.\to_lower.c -# End Source File -# Begin Source File - -SOURCE=.\to_upper.c -# End Source File -# Begin Source File - -SOURCE=.\tool_text.c -# End Source File -# Begin Source File - -SOURCE=.\tool_text.def -# End Source File -# Begin Source File - -SOURCE=.\tool_text.rc -# End Source File -# Begin Source File - -SOURCE=.\unquote.c -# End Source File -# Begin Source File - -SOURCE=.\word_break.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\CLCLPlugin.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/CLCLPlugin/tool_text/tool_text.dsw b/CLCLPlugin/tool_text/tool_text.dsw deleted file mode 100644 index a33d36b..0000000 --- a/CLCLPlugin/tool_text/tool_text.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# x: ܰ߰ ̧ ҏW܂͍폜Ȃł! - -############################################################################### - -Project: "tool_text"=".\tool_text.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/CLCLPlugin/tool_text/tool_text.rc b/CLCLPlugin/tool_text/tool_text.rc index 5307699..f3af780 100644 --- a/CLCLPlugin/tool_text/tool_text.rc +++ b/CLCLPlugin/tool_text/tool_text.rc @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "winres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +34,7 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" + "#include ""winres.h""\r\n" "\0" END diff --git a/CLCLPlugin/tool_text/tool_text.sln b/CLCLPlugin/tool_text/tool_text.sln new file mode 100644 index 0000000..8274f09 --- /dev/null +++ b/CLCLPlugin/tool_text/tool_text.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29418.71 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tool_text", "tool_text.vcxproj", "{D439BB63-3D81-4791-BD68-22B11AE43A16}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D439BB63-3D81-4791-BD68-22B11AE43A16}.Debug|x86.ActiveCfg = Debug|Win32 + {D439BB63-3D81-4791-BD68-22B11AE43A16}.Debug|x86.Build.0 = Debug|Win32 + {D439BB63-3D81-4791-BD68-22B11AE43A16}.Release|x86.ActiveCfg = Release|Win32 + {D439BB63-3D81-4791-BD68-22B11AE43A16}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9F2F27DC-EA62-4F26-A528-69E26E669CCD} + EndGlobalSection +EndGlobal diff --git a/CLCLPlugin/tool_text/tool_text.vcxproj b/CLCLPlugin/tool_text/tool_text.vcxproj new file mode 100644 index 0000000..6a88bbb --- /dev/null +++ b/CLCLPlugin/tool_text/tool_text.vcxproj @@ -0,0 +1,161 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {D439BB63-3D81-4791-BD68-22B11AE43A16} + 10.0 + + + + DynamicLibrary + v141_xp + false + Unicode + + + DynamicLibrary + v141_xp + false + Unicode + + + + + + + + + + + + + + + .\Release\ + .\Release\ + false + + + .\Debug\ + .\Debug\ + true + + + + MultiThreaded + Default + true + MaxSpeed + true + Level3 + Size + true + WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;TOOL_TEXT_EXPORTS;UNICODE;%(PreprocessorDefinitions) + .\Release\ + .\Release\tool_text.pch + .\Release\ + .\Release\ + + + true + NDEBUG;%(PreprocessorDefinitions) + .\Release\tool_text.tlb + true + Win32 + + + 0x0411 + NDEBUG;%(PreprocessorDefinitions) + + + true + .\Release\tool_text.bsc + + + true + true + Console + .\Release\tool_text.dll + .\Release\tool_text.lib + odbc32.lib;odbccp32.lib;Shlwapi.lib;%(AdditionalDependencies) + .\tool_text.def + + + + + MultiThreadedDebug + Default + true + Disabled + true + Level3 + EditAndContinue + WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;TOOL_TEXT_EXPORTS;UNICODE;%(PreprocessorDefinitions) + .\Debug\ + .\Debug\tool_text.pch + .\Debug\ + .\Debug\ + EnableFastChecks + + + true + _DEBUG;%(PreprocessorDefinitions) + .\Debug\tool_text.tlb + true + Win32 + + + 0x0411 + _DEBUG;%(PreprocessorDefinitions) + + + true + .\Debug\tool_text.bsc + + + true + true + true + Console + .\Debug\tool_text.dll + .\Debug\tool_text.lib + odbc32.lib;odbccp32.lib;Shlwapi.lib;%(AdditionalDependencies) + .\tool_text.def + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CLCLPlugin/tool_text/tool_text.vcxproj.filters b/CLCLPlugin/tool_text/tool_text.vcxproj.filters new file mode 100644 index 0000000..654debf --- /dev/null +++ b/CLCLPlugin/tool_text/tool_text.vcxproj.filters @@ -0,0 +1,67 @@ + + + + + {f63cab74-a67f-4e76-8944-0ecdc1e263bb} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {9eb3a6c2-6d1b-4759-81be-ea06c9663668} + h;hpp;hxx;hm;inl + + + {d4885041-4432-4245-ba3a-151835f2570b} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Source Files + + + + + Header Files + + + Header Files + + + + + Source Files + + + \ No newline at end of file From 185ea3fbb6408dbd6b821de261a828cdc414933d Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 12:20:47 +0200 Subject: [PATCH 06/22] plugin tool_text: merge english and japanese rc-files, add string resources --- CLCLPlugin/tool_text/resource.h | 12 +- CLCLPlugin/tool_text/tool_text.rc | 290 +++++++++++++++++++++++++++--- 2 files changed, 272 insertions(+), 30 deletions(-) diff --git a/CLCLPlugin/tool_text/resource.h b/CLCLPlugin/tool_text/resource.h index bb22ca0..638c4b0 100644 --- a/CLCLPlugin/tool_text/resource.h +++ b/CLCLPlugin/tool_text/resource.h @@ -11,6 +11,16 @@ #define IDD_DIALOG_BREAK_CNT 107 #define IDD_DIALOG_WORD_BREAK 108 #define IDD_DIALOG_PUT_TEXT 109 +#define IDS_DATE_TIME_CONVERSION 110 +#define IDS_TO_LOWER 111 +#define IDS_TO_UPPER 112 +#define IDS_QUOTATION 113 +#define IDS_UNQUOTATION 114 +#define IDS_WORDWRAP 115 +#define IDS_TAG 116 +#define IDS_DELETE_CRLF 117 +#define IDS_CONNECT_TEXT 118 +#define IDS_EDIT_CLIPBOARD 119 #define IDC_COMBO_DATE 1002 #define IDC_COMBO_TIME 1003 #define IDC_EDIT_QUOTE_CHAR 1003 @@ -36,7 +46,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 110 +#define _APS_NEXT_RESOURCE_VALUE 120 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1019 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/CLCLPlugin/tool_text/tool_text.rc b/CLCLPlugin/tool_text/tool_text.rc index f3af780..f1e3a07 100644 --- a/CLCLPlugin/tool_text/tool_text.rc +++ b/CLCLPlugin/tool_text/tool_text.rc @@ -46,12 +46,209 @@ END #endif // APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DIALOG_DATE_TIME_FORMAT DIALOG 0, 0, 154, 99 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "`ݒ" +FONT 9, "lr oSVbN" +BEGIN + LTEXT "t`(&D):",IDC_STATIC,11,10,100,10 + LTEXT "Ԍ`(&T):",IDC_STATIC,11,40,100,10 + COMBOBOX IDC_COMBO_DATE,11,20,130,155,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO_TIME,11,50,130,120,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,25,75,50,14 + PUSHBUTTON "LZ",IDCANCEL,80,75,50,14 +END + +IDD_DIALOG_QUOTE DIALOG 0, 0, 151, 69 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "p̐ݒ" +FONT 9, "lr oSVbN" +BEGIN + LTEXT "p(&Q):",IDC_STATIC,10,10,90,10 + EDITTEXT IDC_EDIT_QUOTE_CHAR,10,20,130,13,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,20,45,50,14 + PUSHBUTTON "LZ",IDCANCEL,75,45,50,14 +END + +IDD_DIALOG_JOIN_TEXT DIALOG 0, 0, 179, 79 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "eLXg̘A" +FONT 9, "lr oSVbN" +BEGIN + DEFPUSHBUTTON "OK",IDOK,65,60,50,14 + PUSHBUTTON "LZ",IDCANCEL,120,60,50,14 + CONTROL "AeLXg̊Ԃɉs}(&R)",IDC_CHECK_ADD_RETURN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,15,150,10 +END + +IDD_DIALOG_TEXT_EDIT DIALOG 0, 0, 218, 168 +STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "eLXgҏW" +FONT 9, "lr oSVbN" +BEGIN + EDITTEXT IDC_EDIT_TEXT,0,0,215,145,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_NOHIDESEL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL + DEFPUSHBUTTON "OK",IDOK,110,150,50,14 + PUSHBUTTON "LZ",IDCANCEL,165,150,50,14 +END + +IDD_DIALOG_DELETE_CRLF DIALOG 0, 0, 165, 65 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "s̏" +FONT 9, "lr oSVbN" +BEGIN + CONTROL "s̋󔒂(&S)",IDC_CHECK_DELETE_SPACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,10,150,10 + DEFPUSHBUTTON "OK",IDOK,30,40,50,14 + PUSHBUTTON "LZ",IDCANCEL,85,40,50,14 +END + +IDD_DIALOG_BREAK_CNT DIALOG 0, 0, 126, 65 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "eLXg`" +FONT 9, "lr oSVbN" +BEGIN + LTEXT "܂ԂoCg(&B):",IDC_STATIC,10,10,90,10 + EDITTEXT IDC_EDIT_BREAK_CNT,10,20,35,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER + LTEXT "bytes",IDC_STATIC,50,22,40,10 + DEFPUSHBUTTON "OK",IDOK,10,40,50,14 + PUSHBUTTON "LZ",IDCANCEL,65,40,50,14 +END + +IDD_DIALOG_WORD_BREAK DIALOG 0, 0, 214, 185 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "eLXg`" +FONT 9, "lr oSVbN" +BEGIN + LTEXT "^uTCY(&T):",IDC_STATIC,10,10,90,10 + EDITTEXT IDC_EDIT_TAB_SIZE,10,20,35,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER + LTEXT "s֑(Sp)(&O):",IDC_STATIC,10,45,95,10 + EDITTEXT IDC_EDIT_M_OIDA,10,55,190,14,ES_AUTOHSCROLL + LTEXT "s֑(Sp)(&B):",IDC_STATIC,10,71,95,10 + EDITTEXT IDC_EDIT_M_BURA,10,81,190,14,ES_AUTOHSCROLL + LTEXT "s֑(p)(&I):",IDC_STATIC,10,105,95,10 + EDITTEXT IDC_EDIT_S_OIDA,10,115,190,14,ES_AUTOHSCROLL + LTEXT "s֑(p)(&U):",IDC_STATIC,10,131,95,10 + EDITTEXT IDC_EDIT_S_BURA,10,141,190,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,95,165,50,14 + PUSHBUTTON "LZ",IDCANCEL,150,165,50,14 +END + +IDD_DIALOG_PUT_TEXT DIALOG 0, 0, 149, 93 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "eLXg̋ݍ" +FONT 9, "lr oSVbN" +BEGIN + LTEXT "Jn(&S):",IDC_STATIC,5,5,60,10 + EDITTEXT IDC_EDIT_OPEN,5,15,135,13,ES_AUTOHSCROLL + LTEXT "I(&E):",IDC_STATIC,5,35,60,10 + EDITTEXT IDC_EDIT_CLOSE,5,45,135,13,ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,35,70,50,14 + PUSHBUTTON "ݾ",IDCANCEL,90,70,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_DIALOG_DATE_TIME_FORMAT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 147 + TOPMARGIN, 7 + BOTTOMMARGIN, 92 + END + + IDD_DIALOG_QUOTE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 144 + TOPMARGIN, 7 + BOTTOMMARGIN, 62 + END + + IDD_DIALOG_JOIN_TEXT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 172 + TOPMARGIN, 7 + BOTTOMMARGIN, 72 + END + + IDD_DIALOG_TEXT_EDIT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 211 + TOPMARGIN, 7 + BOTTOMMARGIN, 161 + END + + IDD_DIALOG_DELETE_CRLF, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 158 + TOPMARGIN, 7 + BOTTOMMARGIN, 58 + END + + IDD_DIALOG_BREAK_CNT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 119 + TOPMARGIN, 7 + BOTTOMMARGIN, 58 + END + + IDD_DIALOG_WORD_BREAK, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 207 + TOPMARGIN, 7 + BOTTOMMARGIN, 178 + END + + IDD_DIALOG_PUT_TEXT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 142 + TOPMARGIN, 7 + BOTTOMMARGIN, 86 + END +END +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_DATE_TIME_CONVERSION "ϊ(&D)" + IDS_TO_LOWER "ɕϊ(&L)" + IDS_TO_UPPER "啶ɕϊ(&U)" + IDS_QUOTATION "p(&Q)" + IDS_UNQUOTATION "p(&N)" + IDS_WORDWRAP "eLXg`(&W)" + IDS_TAG "eLXg̋ݍ(&P)" + IDS_DELETE_CRLF "s̏(&R)" + IDS_CONNECT_TEXT "eLXg̘A(&O)" + IDS_EDIT_CLIPBOARD "eLXgҏW(&E)" +END + #endif // { resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// p (ض) resources +// English (United States) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 @@ -64,8 +261,21 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Dialog // -IDD_DIALOG_QUOTE DIALOG DISCARDABLE 0, 0, 151, 69 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_DIALOG_DATE_TIME_FORMAT DIALOG 0, 0, 154, 99 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Date and time formatting" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "&Date Format:",IDC_STATIC,11,10,100,10 + LTEXT "&Time Format:",IDC_STATIC,11,40,100,10 + COMBOBOX IDC_COMBO_DATE,11,20,130,155,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO_TIME,11,50,130,120,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,25,75,50,14 + PUSHBUTTON "Cancel",IDCANCEL,80,75,50,14 +END + +IDD_DIALOG_QUOTE DIALOG 0, 0, 151, 69 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Quotation" FONT 8, "MS Sans Serif" BEGIN @@ -75,69 +285,63 @@ BEGIN PUSHBUTTON "Cancel",IDCANCEL,75,45,50,14 END -IDD_DIALOG_JOIN_TEXT DIALOG DISCARDABLE 0, 0, 203, 69 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_DIALOG_JOIN_TEXT DIALOG 0, 0, 203, 69 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Connection of text" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,50,45,50,14 PUSHBUTTON "Cancel",IDCANCEL,105,45,50,14 - CONTROL "A new-line is inserted between the texts to connect.", - IDC_CHECK_ADD_RETURN,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,10,15,180,10 + CONTROL "A new-line is inserted between the texts to connect.",IDC_CHECK_ADD_RETURN, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,15,180,10 END -IDD_DIALOG_TEXT_EDIT DIALOG DISCARDABLE 0, 0, 218, 168 -STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +IDD_DIALOG_TEXT_EDIT DIALOG 0, 0, 218, 168 +STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME CAPTION "Edit" FONT 8, "MS Sans Serif" BEGIN - EDITTEXT IDC_EDIT_TEXT,0,0,215,145,ES_MULTILINE | ES_AUTOVSCROLL | - ES_AUTOHSCROLL | ES_NOHIDESEL | ES_WANTRETURN | - WS_VSCROLL | WS_HSCROLL + EDITTEXT IDC_EDIT_TEXT,0,0,215,145,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_NOHIDESEL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL DEFPUSHBUTTON "OK",IDOK,110,150,50,14 PUSHBUTTON "Cancel",IDCANCEL,165,150,50,14 END -IDD_DIALOG_DELETE_CRLF DIALOG DISCARDABLE 0, 0, 195, 65 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_DIALOG_DELETE_CRLF DIALOG 0, 0, 195, 65 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Delete CRLF" FONT 8, "MS Sans Serif" BEGIN - CONTROL "The blank of the head of the sentence is removed.", - IDC_CHECK_DELETE_SPACE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,10,10,175,10 + CONTROL "The blank of the head of the sentence is removed.",IDC_CHECK_DELETE_SPACE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,10,175,10 DEFPUSHBUTTON "OK",IDOK,45,40,50,14 PUSHBUTTON "Cancel",IDCANCEL,100,40,50,14 END -IDD_DIALOG_BREAK_CNT DIALOG DISCARDABLE 0, 0, 126, 65 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_DIALOG_BREAK_CNT DIALOG 0, 0, 126, 65 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Word Wrap" FONT 8, "MS Sans Serif" BEGIN LTEXT "&Number of word wrap:",IDC_STATIC,10,10,90,10 - EDITTEXT IDC_EDIT_BREAK_CNT,10,20,35,13,ES_RIGHT | ES_AUTOHSCROLL | - ES_NUMBER + EDITTEXT IDC_EDIT_BREAK_CNT,10,20,35,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER LTEXT "bytes",IDC_STATIC,50,22,40,10 DEFPUSHBUTTON "OK",IDOK,10,40,50,14 PUSHBUTTON "Cancel",IDCANCEL,65,40,50,14 END -IDD_DIALOG_WORD_BREAK DIALOG DISCARDABLE 0, 0, 135, 65 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_DIALOG_WORD_BREAK DIALOG 0, 0, 135, 65 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Word Wrap" FONT 8, "MS Sans Serif" BEGIN LTEXT "&TAB size:",IDC_STATIC,10,10,90,10 - EDITTEXT IDC_EDIT_TAB_SIZE,10,20,35,13,ES_RIGHT | ES_AUTOHSCROLL | - ES_NUMBER + EDITTEXT IDC_EDIT_TAB_SIZE,10,20,35,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER DEFPUSHBUTTON "OK",IDOK,15,40,50,14 PUSHBUTTON "Cancel",IDCANCEL,70,40,50,14 END -IDD_DIALOG_PUT_TEXT DIALOG DISCARDABLE 0, 0, 149, 93 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_DIALOG_PUT_TEXT DIALOG 0, 0, 149, 93 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "" FONT 8, "MS Sans Serif" BEGIN @@ -158,6 +362,14 @@ END #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO DISCARDABLE BEGIN + IDD_DIALOG_DATE_TIME_FORMAT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 147 + TOPMARGIN, 7 + BOTTOMMARGIN, 92 + END + IDD_DIALOG_QUOTE, DIALOG BEGIN LEFTMARGIN, 7 @@ -216,7 +428,27 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // p (ض) resources + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_DATE_TIME_CONVERSION "&Date and Time Conversion" + IDS_TO_LOWER "To &Lower" + IDS_TO_UPPER "To &Upper" + IDS_QUOTATION "&Quotation" + IDS_UNQUOTATION "U&n Quotation" + IDS_WORDWRAP "&Word Wrap" + IDS_TAG "<&TAG>" + IDS_DELETE_CRLF "Delete C&RLF" + IDS_CONNECT_TEXT "C&onnection of text" + IDS_EDIT_CLIPBOARD "&Edit" +END + +#endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// From 1ebbe82f09cb6cfb83ce68519191f7a84147d5eb Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 12:49:23 +0200 Subject: [PATCH 07/22] tool_text: added and included convert_date, use string resources --- CLCLPlugin/tool_text/convert_date.c | 273 ++++++++++++++++++ CLCLPlugin/tool_text/join_text.c | 3 + CLCLPlugin/tool_text/put_text.c | 7 + CLCLPlugin/tool_text/text_edit.c | 8 + CLCLPlugin/tool_text/to_lower.c | 8 + CLCLPlugin/tool_text/tool_text.c | 79 +++-- CLCLPlugin/tool_text/tool_text.def | 3 + CLCLPlugin/tool_text/tool_text.vcxproj | 1 + .../tool_text/tool_text.vcxproj.filters | 3 + 9 files changed, 368 insertions(+), 17 deletions(-) create mode 100644 CLCLPlugin/tool_text/convert_date.c diff --git a/CLCLPlugin/tool_text/convert_date.c b/CLCLPlugin/tool_text/convert_date.c new file mode 100644 index 0000000..f622cdb --- /dev/null +++ b/CLCLPlugin/tool_text/convert_date.c @@ -0,0 +1,273 @@ +/* + * tool_text + * + * convert_date.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE + +#include "..\CLCLPlugin.h" + +#include "resource.h" + +/* Define */ + +/* Global Variables */ +extern HINSTANCE hInst; +extern TCHAR ini_path[]; + +extern TCHAR date_format[]; +extern TCHAR time_format[]; + +/* Local Function Prototypes */ + +/* + * item_convert_date - eLXg̓ϊ + * Text to Datetime Conversion + */ +static int item_convert_date(DATA_INFO *di) +{ + HANDLE ret; + BYTE *from_mem, *to_mem; + TCHAR buf[BUF_SIZE]; + TCHAR *p, *r, *s, *t; + int size; + + // Rs[bN + // lock the source + if ((from_mem = GlobalLock(di->data)) == NULL) { + return TOOL_ERROR; + } + + // ϊTCY擾 + // Get size for conversion + for (p = (TCHAR *)from_mem, size = 0; *p != TEXT('\0'); p++) { + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + p++; + size += 2; + continue; + } + if (*p != TEXT('%')) { + size++; + continue; + } + p++; + switch (*p) { + case TEXT('f'): case TEXT('F'): + // `w + // format specification + break; + + case TEXT('d'): case TEXT('D'): + // t + // date + t = (*date_format == TEXT('\0')) ? NULL : date_format; + GetDateFormat(0, 0, NULL, t, buf, BUF_SIZE - 1); + size += lstrlen(buf); + break; + + case TEXT('t'): case TEXT('T'): + // + // time + t = (*time_format == TEXT('\0')) ? NULL : time_format; + GetTimeFormat(0, 0, NULL, t, buf, BUF_SIZE - 1); + size += lstrlen(buf); + break; + + case TEXT('%'): + // % + size++; + break; + + default: + size += 2; + } + } + size++; + + // Rs[m + // reserve memory for copy target + if ((ret = GlobalAlloc(GHND, sizeof(TCHAR) * size)) == NULL) { + GlobalUnlock(di->data); + return TOOL_ERROR; + } + // Rs[惍bN + // lock copy target + if ((to_mem = GlobalLock(ret)) == NULL) { + GlobalFree(ret); + GlobalUnlock(di->data); + return TOOL_ERROR; + } + + // ϊ + // conversion + for (p = (TCHAR *)from_mem, r = (TCHAR *)to_mem; *p != TEXT('\0'); p++) { + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + *(r++) = *(p++); + *(r++) = *p; + continue; + } + if (*p != TEXT('%')) { + *(r++) = *p; + continue; + } + p++; + switch (*p) { + case TEXT('f'): case TEXT('F'): + // `w + // format specification + if (*(p + 1) != TEXT('"')) { + *(r++) = TEXT('%'); + *(r++) = *p; + break; + } + t = p + 2; + for (s = t; *s != TEXT('\0') && *s != TEXT('"'); s++); + if (*s != TEXT('"')) { + *(r++) = TEXT('%'); + *(r++) = *p; + break; + } + + p = s; + break; + + case TEXT('d'): case TEXT('D'): + // t + // date + t = (*date_format == TEXT('\0')) ? NULL : date_format; + GetDateFormat(0, 0, NULL, t, buf, BUF_SIZE - 1); + lstrcpy(r, buf); + r += lstrlen(r); + break; + + case TEXT('t'): case TEXT('T'): + // + // time + t = (*time_format == TEXT('\0')) ? NULL : time_format; + GetTimeFormat(0, 0, NULL, t, buf, BUF_SIZE - 1); + lstrcpy(r, buf); + r += lstrlen(r); + break; + + case TEXT('%'): + // % + *(r++) = TEXT('%'); + break; + + default: + *(r++) = TEXT('%'); + *(r++) = *p; + break; + } + } + *r = TEXT('\0'); + + GlobalUnlock(ret); + GlobalUnlock(di->data); + + GlobalFree(di->data); + di->data = ret; + di->size = sizeof(TCHAR) * size; + return TOOL_DATA_MODIFIED; +} + +/* + * convert_date - eLXg̓ϊ + * Text to Datetime Conversion + */ +__declspec(dllexport) int CALLBACK convert_date(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + DATA_INFO *di; + int ret = TOOL_SUCCEED; + + // o^ACêݎs + if ((tei->call_type & CALLTYPE_ITEM_TO_CLIPBOARD) && !(tei->call_type & CALLTYPE_REGIST)) { + return TOOL_SUCCEED; + } + for (; tdi != NULL; tdi = tdi->next) { +#ifdef UNICODE + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)tdi->di); +#else + di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("TEXT"), (LPARAM)tdi->di); +#endif + if (di != NULL && di->data != NULL) { + ret |= item_convert_date(di); + } + } + return ret; +} + +/* + * set_format_proc - `ݒ + */ +static BOOL CALLBACK set_format_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) { + case WM_INITDIALOG: + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yyyy/MM/dd")); + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yy/MM/dd")); + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yy/M/d")); + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yyyy/M/d")); + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yy/MM/dd' ('ddd')'")); + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yyyy/MM/dd' ('ddd')'")); + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yyyy/M/d' ('ddd')'")); + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yyyy-MM-dd")); + + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yyyy'N'M''d''")); + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yyyy'N'MM''dd''")); + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yyyy'N'M''d'' dddd")); + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, CB_ADDSTRING, 0, (LPARAM)TEXT("yyyy'N'MM''dd'' dddd")); + + SendDlgItemMessage(hDlg, IDC_COMBO_TIME, CB_ADDSTRING, 0, (LPARAM)TEXT("H:mm:ss")); + SendDlgItemMessage(hDlg, IDC_COMBO_TIME, CB_ADDSTRING, 0, (LPARAM)TEXT("HH:mm:ss")); + SendDlgItemMessage(hDlg, IDC_COMBO_TIME, CB_ADDSTRING, 0, (LPARAM)TEXT("tt h:mm:ss")); + SendDlgItemMessage(hDlg, IDC_COMBO_TIME, CB_ADDSTRING, 0, (LPARAM)TEXT("tt hh:mm:ss")); + + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, WM_SETTEXT, 0, (LPARAM)date_format); + SendDlgItemMessage(hDlg, IDC_COMBO_TIME, WM_SETTEXT, 0, (LPARAM)time_format); + break; + + case WM_CLOSE: + EndDialog(hDlg, FALSE); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + SendDlgItemMessage(hDlg, IDC_COMBO_DATE, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)date_format); + SendDlgItemMessage(hDlg, IDC_COMBO_TIME, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)time_format); + + WritePrivateProfileString(TEXT("convert_date"), TEXT("date_format"), date_format, ini_path); + WritePrivateProfileString(TEXT("convert_date"), TEXT("time_format"), time_format, ini_path); + EndDialog(hDlg, TRUE); + break; + + case IDCANCEL: + EndDialog(hDlg, FALSE); + break; + } + break; + + default: + return FALSE; + } + return TRUE; +} + +/* + * convert_date_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK convert_date_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_DATE_TIME_FORMAT), hWnd, set_format_proc, 0); + return TRUE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_text/join_text.c b/CLCLPlugin/tool_text/join_text.c index 6d3d504..94a764e 100644 --- a/CLCLPlugin/tool_text/join_text.c +++ b/CLCLPlugin/tool_text/join_text.c @@ -78,6 +78,7 @@ __declspec(dllexport) int CALLBACK join_text(const HWND hWnd, TOOL_EXEC_INFO *te } // TCY擾 + // Get size for (wk_tdi = tdi; wk_tdi != NULL; wk_tdi = wk_tdi->next) { #ifdef UNICODE di = (DATA_INFO *)SendMessage(hWnd, WM_ITEM_GET_FORMAT_TO_ITEM, (WPARAM)TEXT("UNICODE TEXT"), (LPARAM)wk_tdi->di); @@ -110,6 +111,7 @@ __declspec(dllexport) int CALLBACK join_text(const HWND hWnd, TOOL_EXEC_INFO *te return TOOL_ERROR; } // eLXg̘A + // Text concatenation p = (TCHAR *)to_mem; for (wk_tdi = tdi; wk_tdi != NULL; wk_tdi = wk_tdi->next) { #ifdef UNICODE @@ -133,6 +135,7 @@ __declspec(dllexport) int CALLBACK join_text(const HWND hWnd, TOOL_EXEC_INFO *te GlobalUnlock(data); // Nbv{[hɑ + // Send to clipboard if (OpenClipboard(hWnd) == FALSE) { GlobalFree(data); return TOOL_ERROR; diff --git a/CLCLPlugin/tool_text/put_text.c b/CLCLPlugin/tool_text/put_text.c index eba719c..7863a1b 100644 --- a/CLCLPlugin/tool_text/put_text.c +++ b/CLCLPlugin/tool_text/put_text.c @@ -30,6 +30,7 @@ extern TCHAR put_text_close[]; /* * set_put_text_proc - ݍޕݒ + * Edit the strings to prepend / append */ static BOOL CALLBACK set_put_text_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -68,6 +69,7 @@ static BOOL CALLBACK set_put_text_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR /* * item_put_text - eLXg̋ݍ + * prepend and append strings to data */ static int item_put_text(DATA_INFO *di, const TCHAR *str_open, const TCHAR *str_close) { @@ -77,19 +79,23 @@ static int item_put_text(DATA_INFO *di, const TCHAR *str_open, const TCHAR *str_ int size; // Rs[bN + // lock copy source if ((from_mem = GlobalLock(di->data)) == NULL) { return TOOL_ERROR; } // TCY擾 + // calculate target size size = lstrlen((TCHAR *)str_open) + lstrlen((TCHAR *)from_mem) + lstrlen(str_close) + 1; // Rs[m + // reserve memory for copy target if ((ret = GlobalAlloc(GHND, sizeof(TCHAR) * size)) == NULL) { GlobalUnlock(di->data); return TOOL_ERROR; } // Rs[惍bN + // lock copy target if ((to_mem = GlobalLock(ret)) == NULL) { GlobalFree(ret); GlobalUnlock(di->data); @@ -97,6 +103,7 @@ static int item_put_text(DATA_INFO *di, const TCHAR *str_open, const TCHAR *str_ } // ݍ + // copying to target r = lstrcpy((TCHAR *)to_mem, str_open) + lstrlen(str_open); r = lstrcpy(r, (TCHAR *)from_mem) + lstrlen((TCHAR *)from_mem); lstrcpy(r, str_close); diff --git a/CLCLPlugin/tool_text/text_edit.c b/CLCLPlugin/tool_text/text_edit.c index 0d79c0e..583d032 100644 --- a/CLCLPlugin/tool_text/text_edit.c +++ b/CLCLPlugin/tool_text/text_edit.c @@ -120,6 +120,14 @@ BOOL CALLBACK set_edit_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) /* * text_edit - eLXgɕϊ + * + * / argument: + * hWnd - ĂяoEBhE / the calling window + * tei - c[s / tool execution information + * tdi - c[pACe / item information for tools + * + * ߂l / Return value: + * TOOL_ */ __declspec(dllexport) int CALLBACK text_edit(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) { diff --git a/CLCLPlugin/tool_text/to_lower.c b/CLCLPlugin/tool_text/to_lower.c index 8b99816..f3429c8 100644 --- a/CLCLPlugin/tool_text/to_lower.c +++ b/CLCLPlugin/tool_text/to_lower.c @@ -42,6 +42,14 @@ static int item_to_lower(DATA_INFO *di) /* * to_lower - eLXgɕϊ + * + * / argument: + * hWnd - ĂяoEBhE / the calling window + * tei - c[s / tool execution information + * tdi - c[pACe / item information for tools + * + * ߂l / Return value: + * TOOL_ */ __declspec(dllexport) int CALLBACK to_lower(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) { diff --git a/CLCLPlugin/tool_text/tool_text.c b/CLCLPlugin/tool_text/tool_text.c index 44b19d6..7306382 100644 --- a/CLCLPlugin/tool_text/tool_text.c +++ b/CLCLPlugin/tool_text/tool_text.c @@ -12,8 +12,10 @@ #define _INC_OLE #include #undef _INC_OLE +#include #include "..\CLCLPlugin.h" +#include "resource.h" /* Define */ #define INI_FILE_NAME TEXT("tool_text.ini") @@ -22,6 +24,9 @@ HINSTANCE hInst; TCHAR ini_path[BUF_SIZE]; +TCHAR date_format[BUF_SIZE]; +TCHAR time_format[BUF_SIZE]; + TCHAR quote_char[BUF_SIZE]; int word_break_break_cnt; @@ -87,6 +92,9 @@ static BOOL dll_initialize(void) *r = TEXT('\0'); wsprintf(ini_path, TEXT("%s\\%s"), app_path, INI_FILE_NAME); + GetPrivateProfileString(TEXT("convert_date"), TEXT("date_format"), TEXT(""), date_format, BUF_SIZE - 1, ini_path); + GetPrivateProfileString(TEXT("convert_date"), TEXT("time_format"), TEXT(""), time_format, BUF_SIZE - 1, ini_path); + GetPrivateProfileString(TEXT("quote"), TEXT("char"), TEXT(">"), quote_char, BUF_SIZE - 1, ini_path); word_break_break_cnt = GetPrivateProfileInt(TEXT("word_break"), TEXT("break_cnt"), 80, ini_path); @@ -115,68 +123,105 @@ static BOOL dll_uninitialize(void) /* * get_tool_info_w - c[擾 + * Get tool information + * + * / argument: + * hWnd - ĂяoEBhE / the calling window + * index - 擾̃CfbNX (0`) / the index of the acquisition (from 0) + * tgi - c[擾 / tool retrieval information + * + * ߂l / Return value: + * TRUE - Ɏ擾c[ / has tools to get next + * FALSE - 擾̏I / end of acquisition */ __declspec(dllexport) BOOL CALLBACK get_tool_info_w(const HWND hWnd, const int index, TOOL_GET_INFO *tgi) { switch (index) { case 0: - lstrcpy(tgi->title, TEXT("To &Lower")); + //lstrcpy(tgi->title, TEXT("ϊ(&D)")); + //lstrcpy(tgi->title, TEXT("&Date and Time Conversion")); + LoadString(hInst, IDS_DATE_TIME_CONVERSION, tgi->title, BUF_SIZE - 1); + lstrcpy(tgi->func_name, TEXT("convert_date")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_ITEM_TO_CLIPBOARD; + return TRUE; + + case 1: + //lstrcpy(tgi->title, TEXT("ɕϊ(&L)")); + //lstrcpy(tgi->title, TEXT("To &Lower")); + LoadString(hInst, IDS_TO_LOWER, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("to_lower")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; return TRUE; - case 1: - lstrcpy(tgi->title, TEXT("To &Upper")); + case 2: + //lstrcpy(tgi->title, TEXT("啶ɕϊ(&U)")); + //lstrcpy(tgi->title, TEXT("To &Upper")); + LoadString(hInst, IDS_TO_UPPER, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("to_upper")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; return TRUE; - case 2: - lstrcpy(tgi->title, TEXT("&Quotation")); + case 3: + //lstrcpy(tgi->title, TEXT("p(&Q)")); + //lstrcpy(tgi->title, TEXT("&Quotation")); + LoadString(hInst, IDS_QUOTATION, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("quote")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; return TRUE; - case 3: - lstrcpy(tgi->title, TEXT("U&n Quotation")); + case 4: + //lstrcpy(tgi->title, TEXT("p(&N)")); + //lstrcpy(tgi->title, TEXT("U&n Quotation")); + LoadString(hInst, IDS_UNQUOTATION, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("unquote")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; return TRUE; - case 4: - lstrcpy(tgi->title, TEXT("&Word Wrap")); + case 5: + //lstrcpy(tgi->title, TEXT("eLXg`(&W)")); + //lstrcpy(tgi->title, TEXT("&Word Wrap")); + LoadString(hInst, IDS_WORDWRAP, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("word_break")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; return TRUE; - case 5: - lstrcpy(tgi->title, TEXT("<&TAG>")); + case 6: + //lstrcpy(tgi->title, TEXT("eLXg̋ݍ(&P)")); + //lstrcpy(tgi->title, TEXT("<&TAG>")); + LoadString(hInst, IDS_TAG, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("put_text")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; return TRUE; - case 6: - lstrcpy(tgi->title, TEXT("Delete C&RLF")); + case 7: + //lstrcpy(tgi->title, TEXT("s̏(&R)")); + //lstrcpy(tgi->title, TEXT("Delete C&RLF")); + LoadString(hInst, IDS_DELETE_CRLF, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("delete_crlf")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE | CALLTYPE_VIEWER; return TRUE; - case 7: - lstrcpy(tgi->title, TEXT("C&onnection of text")); + case 8: + //lstrcpy(tgi->title, TEXT("eLXg̘A(&O)")); + //lstrcpy(tgi->title, TEXT("C&onnection of text")); + LoadString(hInst, IDS_CONNECT_TEXT, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("join_text")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_VIEWER; return TRUE; - case 8: - lstrcpy(tgi->title, TEXT("&Edit")); + case 9: + //lstrcpy(tgi->title, TEXT("eLXgҏW(&E)")); + //lstrcpy(tgi->title, TEXT("&Edit")); + LoadString(hInst, IDS_EDIT_CLIPBOARD, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("text_edit")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_MENU_COPY_PASTE; diff --git a/CLCLPlugin/tool_text/tool_text.def b/CLCLPlugin/tool_text/tool_text.def index 238499e..4e815d6 100644 --- a/CLCLPlugin/tool_text/tool_text.def +++ b/CLCLPlugin/tool_text/tool_text.def @@ -3,6 +3,9 @@ EXETYPE WINDOWS EXPORTS get_tool_info_w + convert_date + convert_date_property + to_lower to_lower_property to_upper diff --git a/CLCLPlugin/tool_text/tool_text.vcxproj b/CLCLPlugin/tool_text/tool_text.vcxproj index 6a88bbb..98275c8 100644 --- a/CLCLPlugin/tool_text/tool_text.vcxproj +++ b/CLCLPlugin/tool_text/tool_text.vcxproj @@ -134,6 +134,7 @@ + diff --git a/CLCLPlugin/tool_text/tool_text.vcxproj.filters b/CLCLPlugin/tool_text/tool_text.vcxproj.filters index 654debf..3231091 100644 --- a/CLCLPlugin/tool_text/tool_text.vcxproj.filters +++ b/CLCLPlugin/tool_text/tool_text.vcxproj.filters @@ -45,6 +45,9 @@ Source Files + + Source Files + From a72df301cb41067652d036f8dcd769dc84ccc5a1 Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 13:13:16 +0200 Subject: [PATCH 08/22] locate tool_text.ini beside clcl.ini in %LOCALAPPDATA%\CLCL (installed application) --- CLCLPlugin/tool_text/tool_text.c | 64 +++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/CLCLPlugin/tool_text/tool_text.c b/CLCLPlugin/tool_text/tool_text.c index 7306382..bed8c22 100644 --- a/CLCLPlugin/tool_text/tool_text.c +++ b/CLCLPlugin/tool_text/tool_text.c @@ -13,6 +13,8 @@ #include #undef _INC_OLE #include +#include +#include #include "..\CLCLPlugin.h" #include "resource.h" @@ -22,7 +24,7 @@ /* Global Variables */ HINSTANCE hInst; -TCHAR ini_path[BUF_SIZE]; +TCHAR ini_path[MAX_PATH]; TCHAR date_format[BUF_SIZE]; TCHAR time_format[BUF_SIZE]; @@ -74,11 +76,15 @@ int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved) */ static BOOL dll_initialize(void) { - TCHAR app_path[BUF_SIZE]; + TCHAR dll_path[MAX_PATH]; + TCHAR exe_path[MAX_PATH]; TCHAR *p, *r; - GetModuleFileName(hInst, app_path, BUF_SIZE - 1); - for (p = r = app_path; *p != TEXT('\0'); p++) { + // First look if it is portable installation. + // Handle NULL instead of hInst indicates to look + // for the path of the exe instead of the current dll. + GetModuleFileName(NULL, exe_path, MAX_PATH - 1); + for (p = r = exe_path; *p != TEXT('\0'); p++) { #ifndef UNICODE if (IsDBCSLeadByte((BYTE)*p) == TRUE) { p++; @@ -90,7 +96,55 @@ static BOOL dll_initialize(void) } } *r = TEXT('\0'); - wsprintf(ini_path, TEXT("%s\\%s"), app_path, INI_FILE_NAME); + + UINT portable = 0; + TCHAR clcl_ini_path[MAX_PATH]; + swprintf_s(clcl_ini_path, MAX_PATH, TEXT("%s\\%s"), exe_path, TEXT("clcl.ini")); + if (PathFileExists(clcl_ini_path)) { + portable = GetPrivateProfileInt(TEXT("GENERAL"), TEXT("GENERAL"), 0, clcl_ini_path); + } + + // get the dll folder + GetModuleFileName(hInst, dll_path, MAX_PATH - 1); + for (p = r = dll_path; *p != TEXT('\0'); p++) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + p++; + continue; + } +#endif // UNICODE + if (*p == TEXT('\\') || *p == TEXT('/')) { + r = p; + } + } + *r = TEXT('\0'); + + if (portable == 1) { // If portable installation + swprintf_s(ini_path, MAX_PATH, TEXT("%s\\%s"), dll_path, INI_FILE_NAME); // locate ini in dll folder + // If ini file does not yet exist in dll folder we locate it + // in the exe folder where clcl.ini also resides. + if (PathFileExists(ini_path) == FALSE) + swprintf_s(ini_path, MAX_PATH, TEXT("%s\\%s"), exe_path, INI_FILE_NAME); // same folder as clcl.exe and clcl.ini + } + else { + // For normal installation (not portable app) set ini_path to the same folder as %LOCALAPPDATA%\CLCL\clcl.ini + // so that we have write access. + // See Clcl\main.c line 2234 ff (get_work_path()) + TCHAR local_app_data[MAX_PATH]; + if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, local_app_data))) { + swprintf_s(ini_path, MAX_PATH, TEXT("%s\\clcl\\%s"), local_app_data, INI_FILE_NAME); + // If ini file not yet exists here, we may read the settings form old location in dll folder + // but I don't consider it necessary. + //if (PathFileExists(ini_path) == FALSE) { + // TCHAR old_ini[MAX_PATH]; + // wsprintf(old_ini, TEXT("%s\\%s"), dll_path, INI_FILE_NAME); + // if (PathFileExists(old_ini)) { + // // TODO: read values from old_ini + // // and return + // } + //} + } + } GetPrivateProfileString(TEXT("convert_date"), TEXT("date_format"), TEXT(""), date_format, BUF_SIZE - 1, ini_path); GetPrivateProfileString(TEXT("convert_date"), TEXT("time_format"), TEXT(""), time_format, BUF_SIZE - 1, ini_path); From 92aa25039d886175ce81f24cbbeffbaba8c83d96 Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 13:55:00 +0200 Subject: [PATCH 09/22] tool_text.txt deleted --- CLCLPlugin/tool_text/tool_text.txt | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 CLCLPlugin/tool_text/tool_text.txt diff --git a/CLCLPlugin/tool_text/tool_text.txt b/CLCLPlugin/tool_text/tool_text.txt deleted file mode 100644 index 410045a..0000000 --- a/CLCLPlugin/tool_text/tool_text.txt +++ /dev/null @@ -1,4 +0,0 @@ -tool_text Ver 0.0.3 --- - -Please add DLL to the tool of an CLCL option. From 49f42815a64bb6c9bbc5e5a3033bd8482d5438e8 Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 14:06:14 +0200 Subject: [PATCH 10/22] tool_text(japanese).txt from https://nakka.com/soft/clcl/plugin/tltxt003.zip --- CLCLPlugin/tool_text/tool_text(japanese).txt | 104 +++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 CLCLPlugin/tool_text/tool_text(japanese).txt diff --git a/CLCLPlugin/tool_text/tool_text(japanese).txt b/CLCLPlugin/tool_text/tool_text(japanese).txt new file mode 100644 index 0000000..56aa9d1 --- /dev/null +++ b/CLCLPlugin/tool_text/tool_text(japanese).txt @@ -0,0 +1,104 @@ +tool_text Ver 0.0.3 +-- + + ͂߂ +CLCL̃eLXggvOCc[łB + + CXg[ +̃c[ CLCL Ver 2.0.0 ȍ~œ삵܂B + +tool_text.dll KȃfBNgɒuāACLCL̃IvVʂJuc[ +v^u\܂BŁAlj{^ tool_text.dll w肷ƒ +c[Ił܂B +IvV́uc[v^uJĂ tool_text.dll hbOhbv +ƕ̃c[܂Ƃ߂ēo^ł܂B + +o[WAbvꍇ́ACLCLI tool_text.dll ㏑ĂB +ACXg[ꍇ́ACLCLc[폜Ă tool_text.dll 폜 +ĂB + +CXg[Ƃ tool_text.dll Ȃꍇ́ADLL \Ȃ +ɂȂÔ\܂BGNXv[̃tH_ IvVŁuׂ +̃t@CƃtH_\vݒɂĂB + + @\ +Eϊ + Cӂ݂̓̕t⎞Ԃɕϊ܂B + + CLCL̃c[ݒŁuf[^Nbv{[hɑ鎞vL̂ƂAo^ + ACẽeLXgf[^Nbv{[hɑƁAIɔCӂ̕ + ɕϊ܂B + ϊ镶́A + %d - t + %t - + ɂȂ܂B + tƎԂ̌`́ACLCL̃c[ݒŃvpeB{^Ɛݒł + ܂B + +Eɕϊ +E啶ɕϊ + p啶Aϊ܂B + +Ep +Ep + w肵sɕt܂B + + p̓c[sxɐݒʂŐݒł܂Ap̃c[ɃR + }hCw肷ƁAR}hCŎw肵pƂĎg + p܂Bp̃c[𕡐o^ăR}hCɈpw肵Ďg + 邱Ƃł܂B + +EeLXg` + w肵oCgŃeLXg܂Ԃ܂B + + ܂ԂoCg̓c[sxɐݒʂŐݒł܂AeLX + g`̃c[ɃR}hCw肷ƁAR}hCŎw肵 + Ő܂Ԃ܂B + +EeLXg̋ݍ + w肵ŃeLXgݍ݂܂B + + ݍޕ̓c[sxɐݒʂŐݒł܂AeLXg + ݍ݃c[ɃR}hCw肷ƁAR}hCŎw肵 + ŋݍ݂܂B + w̎d́A + , + Ƃ "," őOƌ؂܂B񒆂 "," gꍇ́A + "\," Ƃ \ ŃGXP[vĂB + + eLXg̋ݍ݃c[𕡐o^ăR}hCɋݍޕ + w肵Ďg邱Ƃł܂B + +Es̏ + eLXgs(CR,LF)܂B + + CLCL̃c[ݒʂŃvpeB{^čs̋󔒂ݒ + ł܂B + l͍s̋󔒂悤ɂȂĂ܂B + +EeLXg̘A + ̃eLXgf[^AANbv{[hɑ܂B + + ÁACLCL̃r[Aŗo^ACeXg(EyC)ɕ\A + Iăc[ĂяoƑIĂACeAăNbv + {[hɑ܂B + CLCL̃c[ݒŃvpeB{^ƘAeLXg̊Ԃɉs + }ݒ肪ł܂B + +EeLXgҏW + ȈՕҏWʂŃeLXgҏWł܂B + + 상j[̌Ăяo̐ݒɂāACLCLŗj[ENbN + āAc[ꗗ\eLXgҏWc[IƕҏWʂ\ + āAҏW[OK}{^ƕύXef܂B + +-- +̃vOɂċNȂQ҂͐ӔC܂B +؂ȃt@C̓obNAbvƂĂƂE߂܂B + +oOAv]A nakka@nakka.com ܂ł肢܂B + +Copyright (C) 1996-2015 by Ohno Tomoaki. All rights reserved. + http://www.nakka.com/ + +2015/09/05 From 1570c2a6f103e9ae75054cd6260d90acab750ed0 Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 14:07:04 +0200 Subject: [PATCH 11/22] tool_text(english).txt by google translation --- CLCLPlugin/tool_text/tool_text(english).txt | 78 +++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 CLCLPlugin/tool_text/tool_text(english).txt diff --git a/CLCLPlugin/tool_text/tool_text(english).txt b/CLCLPlugin/tool_text/tool_text(english).txt new file mode 100644 index 0000000..bf7fc3b --- /dev/null +++ b/CLCLPlugin/tool_text/tool_text(english).txt @@ -0,0 +1,78 @@ +tool_text Ver 0.0.3 +-- + +■ Introduction +This is a plug-in tool that extends the text processing of CLCL. + +■ Installation +This tool works with CLCL Ver 2.0.0 and later. + +Put tool_text.dll in a suitable directory, open the CLCL options screen and display the "Tools" tab. Press the Add button and specify tool_text.dll to select the tool to add. +Open the "Tools" tab in the options and drag and drop tool_text.dll there to register multiple tools at once. + +If you are upgrading, close CLCL and overwrite tool_text.dll. +If you are uninstalling, delete the tool from CLCL and then delete tool_text.dll. + +If you cannot find tool_text.dll when installing, it may be set not to display DLLs. Set the Explorer folder options to "Show all files and folders". + +■ Functions + +・ Date and time conversion + Converts any string to the current date or time. + When "When sending data to clipboard" is enabled in the CLCL tool settings, any string will be automatically converted to date and time when text data in a registered item is sent to the clipboard. + The converted string will be: + %d - date + %t - time + You can set the date and time format by pressing the properties button in the CLCL tool settings. + +・ Convert to lowercase + +・ Convert to uppercase + Converts English characters to uppercase or lowercase. + +・ Quote +・ Unquote + + Adds the specified string to the beginning of the line. + Quotation marks can be set in the settings screen each time the tool is executed, but if a command line is specified for the quote tool, the character specified on the command line will be used as the quote mark. You can register multiple quote tools and use them separately by specifying quote marks on the command line. + +・ Text formatting + Wraps text at the specified number of bytes. + The number of bytes to wrap can be set in the settings screen each time the tool is run, but if you specify a command line for the text formatting tool, it will wrap at the number specified on the command line. + +・ Text sandwiching + Sandwiches text with a specified string. + The characters to sandwich can be set in the settings screen each time the tool is run, but if you specify a command line for the text sandwiching tool, it will sandwich with the string specified on the command line. + The way to specify is as follows: + , + separate the beginning and end with ",". If you want to use "," in the string, escape it with \, like this: + "\,". + You can register multiple text sandwiching tools and specify the string to sandwich on the command line to use different ones. + +・ Remove newline + Remove newline characters (CR,LF) from text. + You can set the tool to remove spaces at the beginning of lines by pressing the Properties button on the CLCL tool settings screen. + The default setting is to remove spaces at the beginning of lines. + +・ Text concatenation + Concatenates multiple text data and sends it to the clipboard. + Concatenation displays history and registered items in a list (right pane) in the CLCL viewer, and when you select multiple items and call the tool, it concatenates the selected items and sends them to the clipboard. + You can set the tool to insert a line break between the concatenated text by pressing the Properties button in the CLCL tool settings. + +・ Text editing + You can edit text on the simple editing screen. + Set the tool to call from the action menu, right-click the history menu in CLCL,display the list of tools, and select the text editing tool to display the editing screen. + After editing, press the [OK] button to reflect the changes. + +-- + +The author is not responsible for any damage caused by this program. + +We strongly recommend that you back up important files. + +Please report any bugs, requests or questions to nakka@nakka.com. + +Copyright (C) 1996-2015 by Ohno Tomoaki. All rights reserved. + http://www.nakka.com/ + +2015/09/05 From 93e8461e1a5662b50148d9425ef0b8d2d25d3cdf Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 18:48:58 +0200 Subject: [PATCH 12/22] tool_util added from https://nakka.com/soft/clcl/plugin/tlutl002_eng.zip --- CLCLPlugin/tool_utl/multi_save.c | 190 +++++++++++++++++++++ CLCLPlugin/tool_utl/resource.h | 29 ++++ CLCLPlugin/tool_utl/tool_utl.c | 279 +++++++++++++++++++++++++++++++ CLCLPlugin/tool_utl/tool_utl.def | 21 +++ CLCLPlugin/tool_utl/tool_utl.dsp | 124 ++++++++++++++ CLCLPlugin/tool_utl/tool_utl.dsw | 29 ++++ CLCLPlugin/tool_utl/tool_utl.rc | 119 +++++++++++++ CLCLPlugin/tool_utl/tool_utl.txt | 4 + 8 files changed, 795 insertions(+) create mode 100644 CLCLPlugin/tool_utl/multi_save.c create mode 100644 CLCLPlugin/tool_utl/resource.h create mode 100644 CLCLPlugin/tool_utl/tool_utl.c create mode 100644 CLCLPlugin/tool_utl/tool_utl.def create mode 100644 CLCLPlugin/tool_utl/tool_utl.dsp create mode 100644 CLCLPlugin/tool_utl/tool_utl.dsw create mode 100644 CLCLPlugin/tool_utl/tool_utl.rc create mode 100644 CLCLPlugin/tool_utl/tool_utl.txt diff --git a/CLCLPlugin/tool_utl/multi_save.c b/CLCLPlugin/tool_utl/multi_save.c new file mode 100644 index 0000000..453fd65 --- /dev/null +++ b/CLCLPlugin/tool_utl/multi_save.c @@ -0,0 +1,190 @@ +/* + * tool_utl + * + * multi_save.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE +#include + +#include "..\CLCLPlugin.h" + +#include "resource.h" + +/* Define */ + +/* Global Variables */ +static TCHAR save_path[MAX_PATH]; + +extern HINSTANCE hInst; +extern TCHAR ini_path[]; + +extern TCHAR multi_save_format[]; +extern TCHAR multi_save_file_name[]; + +/* Local Function Prototypes */ + +/* + * folder_select - tH_I + */ +static BOOL folder_select(const HWND hWnd, TCHAR *ret) +{ + BROWSEINFO bi; + LPITEMIDLIST itemid_list; + TCHAR buf[BUF_SIZE]; + + bi.hwndOwner = hWnd; + bi.pidlRoot = (const struct _ITEMIDLIST *)CSIDL_DESKTOP; + *buf = TEXT('\0'); + bi.pszDisplayName = buf; + bi.lpszTitle = TEXT("Please select a folder to output."); + bi.ulFlags = BIF_RETURNONLYFSDIRS; + bi.lpfn = NULL; + bi.lParam = 0; + bi.iImage = 0; + + // tH_Iʂ\ + itemid_list = SHBrowseForFolder(&bi); + if (itemid_list == NULL) { + return FALSE; + } + // IĂtH_̃tpX擾 + SHGetPathFromIDList(itemid_list, ret); + return TRUE; +} + +/* + * format_to_combo - R{{bNXɌ`ݒ + */ +static void format_to_combo(const HWND hCombo, TOOL_DATA_INFO *tdi) +{ + for (; tdi != NULL; tdi = tdi->next) { + if (tdi->di->type == TYPE_ITEM) { + format_to_combo(hCombo, tdi->child); + } + if (tdi->di->type != TYPE_DATA) { + continue; + } + if (SendMessage(hCombo, CB_FINDSTRING, -1, (LPARAM)tdi->di->format_name) >= 0) { + continue; + } + SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)tdi->di->format_name); + } +} + +/* + * set_multi_save_proc - ۑݒ + */ +BOOL CALLBACK set_multi_save_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + TCHAR path[MAX_PATH]; + + switch (uMsg) { + case WM_INITDIALOG: + format_to_combo(GetDlgItem(hDlg, IDC_COMBO_FORMAT), (TOOL_DATA_INFO *)lParam); + + SendDlgItemMessage(hDlg, IDC_COMBO_FORMAT, WM_SETTEXT, 0, (LPARAM)multi_save_format); + SendDlgItemMessage(hDlg, IDC_EDIT_PATH, WM_SETTEXT, 0, (LPARAM)save_path); + SendDlgItemMessage(hDlg, IDC_EDIT_FILE_NAME, WM_SETTEXT, 0, (LPARAM)multi_save_file_name); + break; + + case WM_CLOSE: + EndDialog(hDlg, FALSE); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDC_BUTTON_SELECT_PATH: + if (folder_select(hDlg, path) == FALSE) { + break; + } + SendDlgItemMessage(hDlg, IDC_EDIT_PATH, WM_SETTEXT, 0, (LPARAM)path); + break; + + case IDOK: + SendDlgItemMessage(hDlg, IDC_COMBO_FORMAT, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)multi_save_format); + SendDlgItemMessage(hDlg, IDC_EDIT_PATH, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)save_path); + SendDlgItemMessage(hDlg, IDC_EDIT_FILE_NAME, WM_GETTEXT, BUF_SIZE - 1, (LPARAM)multi_save_file_name); + + WritePrivateProfileString(TEXT("multi_save"), TEXT("format"), multi_save_format, ini_path); + WritePrivateProfileString(TEXT("multi_save"), TEXT("file_name"), multi_save_file_name, ini_path); + EndDialog(hDlg, TRUE); + break; + + case IDCANCEL: + EndDialog(hDlg, FALSE); + break; + } + break; + + default: + return FALSE; + } + return TRUE; +} + +/* + * multi_save - ACet@Cɕۑ + */ +__declspec(dllexport) int CALLBACK multi_save(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + TOOL_DATA_INFO *wk_tdi; + TCHAR file_name[MAX_PATH]; + TCHAR path[MAX_PATH]; + int i; + + if (tdi == NULL) { + return TOOL_SUCCEED; + } + + // o͐̑I + if (folder_select(hWnd, save_path) == FALSE) { + return TOOL_CANCEL; + } + // ۑݒ + if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_MULTI_SAVE), hWnd, set_multi_save_proc, (LPARAM)tdi) == FALSE) { + return TOOL_CANCEL; + } + + for (i = 0; tdi != NULL; tdi = tdi->next, i++) { + if (tdi->di->type == TYPE_FOLDER) { + continue; + } else if (tdi->di->type == TYPE_ITEM) { + for (wk_tdi = tdi->child; wk_tdi != NULL && lstrcmpi(multi_save_format, wk_tdi->di->format_name) != 0; wk_tdi = wk_tdi->next) + ; + if (wk_tdi == NULL) { + continue; + } + } else if (tdi->di->type == TYPE_DATA) { + if (lstrcmpi(multi_save_format, tdi->di->format_name) != 0) { + continue; + } + wk_tdi = tdi; + } else { + continue; + } + wsprintf(file_name, multi_save_file_name, i); + wsprintf(path, TEXT("%s\\%s"), save_path, file_name); + if (SendMessage(hWnd, WM_ITEM_TO_FILE, (WPARAM)path, (LPARAM)wk_tdi->di) == FALSE) { + MessageBox(hWnd, TEXT("Failed in save."), TEXT("Output"), MB_ICONERROR); + return TOOL_CANCEL; + } + } + return TOOL_SUCCEED; +} + +/* + * multi_save_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK multi_save_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + return FALSE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_utl/resource.h b/CLCLPlugin/tool_utl/resource.h new file mode 100644 index 0000000..a6814f1 --- /dev/null +++ b/CLCLPlugin/tool_utl/resource.h @@ -0,0 +1,29 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by tool_utl.rc +// +#define IDD_DIALOG_DATE_TIME_FORMAT 101 +#define IDD_DIALOG_QUOTE 102 +#define IDD_DIALOG_JOIN_TEXT 103 +#define IDD_DIALOG_MULTI_SAVE 104 +#define IDC_COMBO_DATE 1002 +#define IDC_COMBO_TIME 1003 +#define IDC_EDIT_QUOTE_CHAR 1003 +#define IDC_CHECK_SHOW 1004 +#define IDC_BUTTON1 1005 +#define IDC_BUTTON_SELECT_PATH 1005 +#define IDC_CHECK_ADD_RETURN 1006 +#define IDC_EDIT_PATH 1007 +#define IDC_COMBO_FORMAT 1008 +#define IDC_EDIT_FILE_NAME 1009 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 105 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1010 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/CLCLPlugin/tool_utl/tool_utl.c b/CLCLPlugin/tool_utl/tool_utl.c new file mode 100644 index 0000000..113edb2 --- /dev/null +++ b/CLCLPlugin/tool_utl/tool_utl.c @@ -0,0 +1,279 @@ +/* + * tool_utl + * + * tool_utl.c + * + * Copyright (C) 1996-2003 by Nakashima Tomoaki. All rights reserved. + * http://www.nakka.com/ + * nakka@nakka.com + */ + +/* Include Files */ +#define _INC_OLE +#include +#undef _INC_OLE + +#include "..\CLCLPlugin.h" + +/* Define */ +#define INI_FILE_NAME TEXT("tool_utl.ini") + +/* Global Variables */ +HINSTANCE hInst; +TCHAR ini_path[BUF_SIZE]; + +static TCHAR wave_file[BUF_SIZE]; + +TCHAR multi_save_format[BUF_SIZE]; +TCHAR multi_save_file_name[BUF_SIZE]; + +/* Local Function Prototypes */ +static BOOL dll_initialize(void); +static BOOL dll_uninitialize(void); + +/* + * DllMain - C + */ +int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved) +{ + switch (fdwReason) { + case DLL_PROCESS_ATTACH: + hInst = hInstance; + dll_initialize(); + break; + + case DLL_PROCESS_DETACH: + dll_uninitialize(); + break; + + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + break; + } + return TRUE; +} + +/* + * dll_initialize - + */ +static BOOL dll_initialize(void) +{ + TCHAR app_path[BUF_SIZE]; + TCHAR *p, *r; + + GetModuleFileName(hInst, app_path, BUF_SIZE - 1); + for (p = r = app_path; *p != TEXT('\0'); p++) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + p++; + continue; + } +#endif // UNICODE + if (*p == TEXT('\\') || *p == TEXT('/')) { + r = p; + } + } + *r = TEXT('\0'); + wsprintf(ini_path, TEXT("%s\\%s"), app_path, INI_FILE_NAME); + + GetPrivateProfileString(TEXT("play_sound"), TEXT("wave_file"), TEXT(""), wave_file, BUF_SIZE - 1, ini_path); + + GetPrivateProfileString(TEXT("multi_save"), TEXT("format"), TEXT("TEXT"), multi_save_format, BUF_SIZE - 1, ini_path); + GetPrivateProfileString(TEXT("multi_save"), TEXT("file_name"), TEXT("%04d.txt"), multi_save_file_name, BUF_SIZE - 1, ini_path); + return TRUE; +} + +/* + * dll_uninitialize - I + */ +static BOOL dll_uninitialize(void) +{ + return TRUE; +} + +/* + * get_tool_info_w - c[擾 + */ +__declspec(dllexport) BOOL CALLBACK get_tool_info_w(const HWND hWnd, const int index, TOOL_GET_INFO *tgi) +{ + switch (index) { + case 0: + lstrcpy(tgi->title, TEXT("Clear &History")); + lstrcpy(tgi->func_name, TEXT("clear_history")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_MENU | CALLTYPE_VIEWER; + return TRUE; + + case 1: + lstrcpy(tgi->title, TEXT("Clear &Clipboard")); + lstrcpy(tgi->func_name, TEXT("clear_clipboard")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_MENU | CALLTYPE_VIEWER; + return TRUE; + + case 2: + lstrcpy(tgi->title, TEXT("&Play Sound")); + lstrcpy(tgi->func_name, TEXT("play_sound")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_ADD_HISTORY; + return TRUE; + + case 3: + lstrcpy(tgi->title, TEXT("Always on &Top")); + lstrcpy(tgi->func_name, TEXT("ztop")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_VIEWER; + return TRUE; + + case 4: + lstrcpy(tgi->title, TEXT("&Un Top")); + lstrcpy(tgi->func_name, TEXT("unztop")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_VIEWER; + return TRUE; + + case 5: + lstrcpy(tgi->title, TEXT("Save of &more items")); + lstrcpy(tgi->func_name, TEXT("multi_save")); + lstrcpy(tgi->cmd_line, TEXT("")); + tgi->call_type = CALLTYPE_VIEWER; + return TRUE; + } + return FALSE; +} + +/* + * clear_history - ̃NA + */ +__declspec(dllexport) int CALLBACK clear_history(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + DATA_INFO *di; + + if (MessageBox(hWnd, TEXT("Are you sure you want to delete all items?"), TEXT("CLCL - Clear History"), + MB_ICONQUESTION | MB_YESNO | MB_TOPMOST) == IDNO) { + return TOOL_SUCCEED; + } + // ̎擾 + di = (DATA_INFO *)SendMessage(hWnd, WM_HISTORY_GET_ROOT, 0, 0); + if (di != NULL) { + // ̉ + SendMessage(hWnd, WM_ITEM_FREE, 0, (LPARAM)di->child); + di->child = NULL; + // ̕ωʒm + SendMessage(hWnd, WM_HISTORY_CHANGED, 0, 0); + } + return TOOL_SUCCEED; +} + +/* + * clear_history_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK clear_history_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + return FALSE; +} + +/* + * clear_clipboard - Nbv{[h̃NA + */ +__declspec(dllexport) int CALLBACK clear_clipboard(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + if (OpenClipboard(hWnd) == TRUE) { + EmptyClipboard(); + CloseClipboard(); + } + return TOOL_SUCCEED; +} + +/* + * clear_clipboard_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK clear_clipboard_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + return FALSE; +} + +/* + * play_sound - WAVEt@C‚炷 + */ +__declspec(dllexport) int CALLBACK play_sound(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + if (*wave_file == TEXT('\0') || sndPlaySound(wave_file, SND_ASYNC | SND_NODEFAULT) == FALSE) { + MessageBeep(MB_ICONASTERISK); + } + return TOOL_SUCCEED; +} + +/* + * play_sound_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK play_sound_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + OPENFILENAME of; + TCHAR buf[MAX_PATH]; + + // t@C̑I + ZeroMemory(&of, sizeof(OPENFILENAME)); + of.lStructSize = sizeof(OPENFILENAME); + of.hInstance = hInst; + of.hwndOwner = hWnd; + of.lpstrTitle = TEXT("WAVE file"); + of.lpstrFilter = TEXT("*.wav\0*.wav\0*.*\0*.*\0\0"); + of.nFilterIndex = 1; + lstrcpy(buf, wave_file); + of.lpstrFile = buf; + of.nMaxFile = MAX_PATH - 1; + of.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; + if (GetOpenFileName(&of) == TRUE) { + lstrcpy(wave_file, buf); + WritePrivateProfileString(TEXT("play_sound"), TEXT("wave_file"), wave_file, ini_path); + } + return TRUE; +} + +/* + * ztop - őOʂɕ\ + */ +__declspec(dllexport) int CALLBACK ztop(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + HWND hViewerWnd; + + hViewerWnd = (HWND)SendMessage(hWnd, WM_VIEWER_GET_HWND, 0, 0); + if (hViewerWnd != NULL) { + // őOʂɕ\ + SetWindowPos(hViewerWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); + } + return TOOL_SUCCEED; +} + +/* + * ztop_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK ztop_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + return FALSE; +} + +/* + * unztop - őOʂɕ\̉ + */ +__declspec(dllexport) int CALLBACK unztop(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) +{ + HWND hViewerWnd; + + hViewerWnd = (HWND)SendMessage(hWnd, WM_VIEWER_GET_HWND, 0, 0); + if (hViewerWnd != NULL) { + // őOʂɕ\ + SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); + } + return TOOL_SUCCEED; +} + +/* + * unztop_property - vpeB\ + */ +__declspec(dllexport) BOOL CALLBACK unztop_property(const HWND hWnd, TOOL_EXEC_INFO *tei) +{ + return FALSE; +} +/* End of source */ diff --git a/CLCLPlugin/tool_utl/tool_utl.def b/CLCLPlugin/tool_utl/tool_utl.def new file mode 100644 index 0000000..5720615 --- /dev/null +++ b/CLCLPlugin/tool_utl/tool_utl.def @@ -0,0 +1,21 @@ +EXETYPE WINDOWS + +EXPORTS + get_tool_info_w + + clear_history + clear_history_property + + clear_clipboard + clear_clipboard_property + + play_sound + play_sound_property + + ztop + ztop_property + unztop + unztop_property + + multi_save + multi_save_property diff --git a/CLCLPlugin/tool_utl/tool_utl.dsp b/CLCLPlugin/tool_utl/tool_utl.dsp new file mode 100644 index 0000000..2f42135 --- /dev/null +++ b/CLCLPlugin/tool_utl/tool_utl.dsp @@ -0,0 +1,124 @@ +# Microsoft Developer Studio Project File - Name="tool_utl" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** ҏWȂł ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=tool_utl - Win32 Debug +!MESSAGE ͗LҲ̧قł͂܂B ۼުĂނ邽߂ɂ NMAKE gpĂB +!MESSAGE [Ҳ̧ق̴߰] ނgpĎsĂ +!MESSAGE +!MESSAGE NMAKE /f "tool_utl.mak". +!MESSAGE +!MESSAGE NMAKE ̎sɍ\wł܂ +!MESSAGE ײݏϸۂ̐ݒ`܂B: +!MESSAGE +!MESSAGE NMAKE /f "tool_utl.mak" CFG="tool_utl - Win32 Debug" +!MESSAGE +!MESSAGE I”\ Ӱ: +!MESSAGE +!MESSAGE "tool_utl - Win32 Release" ("Win32 (x86) Dynamic-Link Library" p) +!MESSAGE "tool_utl - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" p) +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "tool_utl - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_UTL_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /Ox /Og /Os /Ob0 /Gf /Gy /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_UTL_EXPORTS" /D "UNICODE" /D "_UNICODE" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x411 /d "NDEBUG" +# ADD RSC /l 0x411 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /opt:nowin98 +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "tool_utl - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_UTL_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_UTL_EXPORTS" /D "UNICODE" /D "_UNICODE" /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x411 /d "_DEBUG" +# ADD RSC /l 0x411 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "tool_utl - Win32 Release" +# Name "tool_utl - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\multi_save.c +# End Source File +# Begin Source File + +SOURCE=.\tool_utl.c +# End Source File +# Begin Source File + +SOURCE=.\tool_utl.def +# End Source File +# Begin Source File + +SOURCE=.\tool_utl.rc +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\CLCLPlugin.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/CLCLPlugin/tool_utl/tool_utl.dsw b/CLCLPlugin/tool_utl/tool_utl.dsw new file mode 100644 index 0000000..1bb1647 --- /dev/null +++ b/CLCLPlugin/tool_utl/tool_utl.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# x: ܰ߰ ̧ ҏW܂͍폜Ȃł! + +############################################################################### + +Project: "tool_utl"=".\tool_utl.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/CLCLPlugin/tool_utl/tool_utl.rc b/CLCLPlugin/tool_utl/tool_utl.rc new file mode 100644 index 0000000..dbb6f5b --- /dev/null +++ b/CLCLPlugin/tool_utl/tool_utl.rc @@ -0,0 +1,119 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// { resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) +#ifdef _WIN32 +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT +#pragma code_page(932) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // { resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// p (ض) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DIALOG_MULTI_SAVE DIALOG DISCARDABLE 0, 0, 187, 149 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Save Information" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "&Format:",IDC_STATIC,10,10,165,8 + COMBOBOX IDC_COMBO_FORMAT,10,20,165,170,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "&Output directory:",IDC_STATIC,10,45,165,8 + EDITTEXT IDC_EDIT_PATH,10,55,150,13,ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "...",IDC_BUTTON_SELECT_PATH,162,55,13,13 + LTEXT "File &Name:",IDC_STATIC,10,75,165,8 + EDITTEXT IDC_EDIT_FILE_NAME,10,85,165,13,ES_AUTOHSCROLL + LTEXT "%d - 1, 2, 3, 4...\n%04d - 0001, 0002, 0003, 0004...", + IDC_STATIC,10,103,165,20 + DEFPUSHBUTTON "OK",IDOK,70,130,50,14 + PUSHBUTTON "Cancel",IDCANCEL,126,130,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_DIALOG_MULTI_SAVE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 180 + TOPMARGIN, 7 + BOTTOMMARGIN, 142 + END +END +#endif // APSTUDIO_INVOKED + +#endif // p (ض) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/CLCLPlugin/tool_utl/tool_utl.txt b/CLCLPlugin/tool_utl/tool_utl.txt new file mode 100644 index 0000000..bd9f7db --- /dev/null +++ b/CLCLPlugin/tool_utl/tool_utl.txt @@ -0,0 +1,4 @@ +tool_utl Ver 0.0.3 +-- + +Please add DLL to the tool of an CLCL option. From 3024bc21474c7c60c6cccbbddc94ec52a23b1d2f Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 18:57:07 +0200 Subject: [PATCH 13/22] tool_util project converted to VS16 --- CLCLPlugin/tool_utl/tool_utl.dsp | 124 -------------- CLCLPlugin/tool_utl/tool_utl.dsw | 29 ---- CLCLPlugin/tool_utl/tool_utl.rc | 4 +- CLCLPlugin/tool_utl/tool_utl.vcxproj | 160 +++++++++++++++++++ CLCLPlugin/tool_utl/tool_utl.vcxproj.filters | 40 +++++ 5 files changed, 202 insertions(+), 155 deletions(-) delete mode 100644 CLCLPlugin/tool_utl/tool_utl.dsp delete mode 100644 CLCLPlugin/tool_utl/tool_utl.dsw create mode 100644 CLCLPlugin/tool_utl/tool_utl.vcxproj create mode 100644 CLCLPlugin/tool_utl/tool_utl.vcxproj.filters diff --git a/CLCLPlugin/tool_utl/tool_utl.dsp b/CLCLPlugin/tool_utl/tool_utl.dsp deleted file mode 100644 index 2f42135..0000000 --- a/CLCLPlugin/tool_utl/tool_utl.dsp +++ /dev/null @@ -1,124 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tool_utl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** ҏWȂł ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=tool_utl - Win32 Debug -!MESSAGE ͗LҲ̧قł͂܂B ۼުĂނ邽߂ɂ NMAKE gpĂB -!MESSAGE [Ҳ̧ق̴߰] ނgpĎsĂ -!MESSAGE -!MESSAGE NMAKE /f "tool_utl.mak". -!MESSAGE -!MESSAGE NMAKE ̎sɍ\wł܂ -!MESSAGE ײݏϸۂ̐ݒ`܂B: -!MESSAGE -!MESSAGE NMAKE /f "tool_utl.mak" CFG="tool_utl - Win32 Debug" -!MESSAGE -!MESSAGE I”\ Ӱ: -!MESSAGE -!MESSAGE "tool_utl - Win32 Release" ("Win32 (x86) Dynamic-Link Library" p) -!MESSAGE "tool_utl - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" p) -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "tool_utl - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_UTL_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /Ox /Og /Os /Ob0 /Gf /Gy /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_UTL_EXPORTS" /D "UNICODE" /D "_UNICODE" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x411 /d "NDEBUG" -# ADD RSC /l 0x411 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /opt:nowin98 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "tool_utl - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_UTL_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_UTL_EXPORTS" /D "UNICODE" /D "_UNICODE" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x411 /d "_DEBUG" -# ADD RSC /l 0x411 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "tool_utl - Win32 Release" -# Name "tool_utl - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\multi_save.c -# End Source File -# Begin Source File - -SOURCE=.\tool_utl.c -# End Source File -# Begin Source File - -SOURCE=.\tool_utl.def -# End Source File -# Begin Source File - -SOURCE=.\tool_utl.rc -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\CLCLPlugin.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/CLCLPlugin/tool_utl/tool_utl.dsw b/CLCLPlugin/tool_utl/tool_utl.dsw deleted file mode 100644 index 1bb1647..0000000 --- a/CLCLPlugin/tool_utl/tool_utl.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# x: ܰ߰ ̧ ҏW܂͍폜Ȃł! - -############################################################################### - -Project: "tool_utl"=".\tool_utl.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/CLCLPlugin/tool_utl/tool_utl.rc b/CLCLPlugin/tool_utl/tool_utl.rc index dbb6f5b..eade4c6 100644 --- a/CLCLPlugin/tool_utl/tool_utl.rc +++ b/CLCLPlugin/tool_utl/tool_utl.rc @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "winres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +34,7 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" + "#include ""winres.h""\r\n" "\0" END diff --git a/CLCLPlugin/tool_utl/tool_utl.vcxproj b/CLCLPlugin/tool_utl/tool_utl.vcxproj new file mode 100644 index 0000000..1102348 --- /dev/null +++ b/CLCLPlugin/tool_utl/tool_utl.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + {E624A3AA-D8A8-4137-9A09-D53035A83B11} + + + + DynamicLibrary + v141_xp + false + Unicode + + + DynamicLibrary + v141_xp + false + Unicode + + + + + + + + + + + + + + + .\Debug\ + .\Debug\ + true + MinimumRecommendedRules.ruleset + + + + + .\Release\ + .\Release\ + false + MinimumRecommendedRules.ruleset + + + + + + MultiThreadedDebug + Default + Disabled + true + Level3 + EditAndContinue + WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;TOOL_UTL_EXPORTS;UNICODE;%(PreprocessorDefinitions) + .\Debug\ + .\Debug\tool_utl.pch + .\Debug\ + .\Debug\ + EnableFastChecks + Sync + + + true + _DEBUG;%(PreprocessorDefinitions) + .\Debug\tool_utl.tlb + true + Win32 + + + 0x0411 + _DEBUG;%(PreprocessorDefinitions) + + + true + .\Debug\tool_utl.bsc + + + true + true + true + Console + .\Debug\tool_utl.dll + .\Debug\tool_utl.lib + winmm.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + .\tool_utl.def + + + + + + MultiThreaded + Default + true + MaxSpeed + true + Level3 + Size + true + WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;TOOL_UTL_EXPORTS;UNICODE;%(PreprocessorDefinitions) + .\Release\ + .\Release\tool_utl.pch + .\Release\ + .\Release\ + None + + + true + NDEBUG;%(PreprocessorDefinitions) + .\Release\tool_utl.tlb + true + Win32 + + + 0x0411 + NDEBUG;%(PreprocessorDefinitions) + + + true + .\Release\tool_utl.bsc + + + true + true + Console + .\Release\tool_utl.dll + .\Release\tool_utl.lib + winmm.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + .\tool_utl.def + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CLCLPlugin/tool_utl/tool_utl.vcxproj.filters b/CLCLPlugin/tool_utl/tool_utl.vcxproj.filters new file mode 100644 index 0000000..7d944a8 --- /dev/null +++ b/CLCLPlugin/tool_utl/tool_utl.vcxproj.filters @@ -0,0 +1,40 @@ + + + + + {e5ac6171-bad7-4324-8c96-965fd54a3bbe} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {3d938524-cd7c-4ad9-bcea-5c2e78c3292f} + h;hpp;hxx;hm;inl + + + {689d8383-5162-4565-a6e0-22e1902ee15a} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + + + Source Files + + + + + Header Files + + + + + Source Files + + + \ No newline at end of file From 7ff0c317907f14661461791d81b9ca5216a1f6b2 Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 19:05:35 +0200 Subject: [PATCH 14/22] tool_util: merged english and japanese rc file --- CLCLPlugin/tool_utl/tool_utl.rc | 47 ++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/CLCLPlugin/tool_utl/tool_utl.rc b/CLCLPlugin/tool_utl/tool_utl.rc index eade4c6..4d3ea71 100644 --- a/CLCLPlugin/tool_utl/tool_utl.rc +++ b/CLCLPlugin/tool_utl/tool_utl.rc @@ -46,12 +46,57 @@ END #endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DIALOG_MULTI_SAVE DIALOG DISCARDABLE 0, 0, 187, 149 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ۑݒ" +FONT 9, "lr oSVbN" +BEGIN + LTEXT "ۑ`(&F):",IDC_STATIC,10,10,165,8 + COMBOBOX IDC_COMBO_FORMAT,10,20,165,170,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "o͐(&O):",IDC_STATIC,10,45,165,8 + EDITTEXT IDC_EDIT_PATH,10,55,150,13,ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "...",IDC_BUTTON_SELECT_PATH,162,55,13,13 + LTEXT "t@C(&F):",IDC_STATIC,10,75,165,8 + EDITTEXT IDC_EDIT_FILE_NAME,10,85,165,13,ES_AUTOHSCROLL + LTEXT "%d ŎIɃJEgAbv鐔ɂȂ܂B\n%04d Ǝw肷4̐ɂȂ܂B", + IDC_STATIC,10,103,165,20 + DEFPUSHBUTTON "OK",IDOK,70,130,50,14 + PUSHBUTTON "LZ",IDCANCEL,126,130,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_DIALOG_MULTI_SAVE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 180 + TOPMARGIN, 7 + BOTTOMMARGIN, 142 + END +END +#endif // APSTUDIO_INVOKED + #endif // { resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // p (ض) resources +// English (US) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 @@ -102,7 +147,7 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // p (ض) resources +#endif // English (US) resources ///////////////////////////////////////////////////////////////////////////// From 5cf1e58df8ba032d3728635873e8b52ea37f6cce Mon Sep 17 00:00:00 2001 From: wilfz Date: Sun, 4 May 2025 23:56:23 +0200 Subject: [PATCH 15/22] added tool_utl(japanese).txt, tool_utl(english).txt, string resources --- CLCLPlugin/tool_utl/resource.h | 16 +++- CLCLPlugin/tool_utl/tool_utl(english).txt | 66 +++++++++++++ CLCLPlugin/tool_utl/tool_utl(japanese).txt | 67 +++++++++++++ CLCLPlugin/tool_utl/tool_utl.rc | 99 ++++++++++++++------ CLCLPlugin/tool_utl/tool_utl.txt | 4 - CLCLPlugin/tool_utl/tool_utl.vcxproj | 1 + CLCLPlugin/tool_utl/tool_utl.vcxproj.filters | 3 + 7 files changed, 223 insertions(+), 33 deletions(-) create mode 100644 CLCLPlugin/tool_utl/tool_utl(english).txt create mode 100644 CLCLPlugin/tool_utl/tool_utl(japanese).txt delete mode 100644 CLCLPlugin/tool_utl/tool_utl.txt diff --git a/CLCLPlugin/tool_utl/resource.h b/CLCLPlugin/tool_utl/resource.h index a6814f1..2587846 100644 --- a/CLCLPlugin/tool_utl/resource.h +++ b/CLCLPlugin/tool_utl/resource.h @@ -1,11 +1,23 @@ //{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. +// Microsoft Visual C++ generated include file. // Used by tool_utl.rc // #define IDD_DIALOG_DATE_TIME_FORMAT 101 #define IDD_DIALOG_QUOTE 102 #define IDD_DIALOG_JOIN_TEXT 103 #define IDD_DIALOG_MULTI_SAVE 104 +#define IDS_CLEAR_HISTORY 105 +#define IDS_CLEAR_CLIPBOARD 106 +#define IDS_PLAY_SOUND 107 +#define IDS_ALWAYS_ON_TOP 108 +#define IDS_UN_TOP 109 +#define IDS_SAVE_SEVERAL 110 +#define IDS_CLR_HIST_CAPTION 111 +#define IDS_CLR_HIST_QUESTION 112 +#define IDS_WAVE_FILE 113 +#define IDS_SEL_OUTPUT_FOLDER 114 +#define IDS_CAPTION_OUTPUT 115 +#define IDS_SAVE_FAILED 116 #define IDC_COMBO_DATE 1002 #define IDC_COMBO_TIME 1003 #define IDC_EDIT_QUOTE_CHAR 1003 @@ -21,7 +33,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 105 +#define _APS_NEXT_RESOURCE_VALUE 117 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1010 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/CLCLPlugin/tool_utl/tool_utl(english).txt b/CLCLPlugin/tool_utl/tool_utl(english).txt new file mode 100644 index 0000000..9dc116e --- /dev/null +++ b/CLCLPlugin/tool_utl/tool_utl(english).txt @@ -0,0 +1,66 @@ +tool_utl Ver 0.0.3 +-- + +■ Introduction +This is a plug-in tool that extends the functionality of CLCL. + +■ Install +This tool works with CLCL Ver 2.0.0 or later. + +Place tool_utl.dll in an appropriate directory, open the CLCL options screen, and select "Tools". +tab. So, press the add button and specify tool_utl.dll to add it. +You can choose which tools to use. +Open the "Tools" tab in the options and drag and drop tool_utl.dll there. +You can register multiple tools at once. + +If you want to upgrade, please close CLCL and overwrite tool_utl.dll. +If you want to uninstall, remove the tool from CLCL and then remove tool_utl.dll. + +If tool_utl.dll is not found when installing, it may be DLLs is set to not be displayed. +In Explorer's folder options, select "All +Set it to "Show files and folders." + +■ Functions +・Clear history + Delete all history items. + +・Clear clipboard + Clears the contents of the clipboard. + +・Make a sound + Play a sound when an item is added to the history. + + If the "When data is added to history" option is enabled in the CLCL tool settings, + a sound will be played when data is added to the history. + You can select the sound to play by pressing the property button in CLCL's tool settings. + +・Display on top +・Cancel display on top + Sets or removes the viewer from the front. + + When "Viewer menu" is enabled in CLCL's tool settings, the CLCL viewer menu + Set or cancel the viewer on top from the Tools menu. + When the "When viewer opens" option is enabled in CLCL's tool settings, CLCL + Sets the viewer to the front when you open it. + +・Save multiple items + Save multiple items to a file with a name. + + Use the CLCL viewer to display history and registered items in a list (right pane), and view multiple accounts. + Select the item to select this tool. + When you run the tool, select the output destination and set the save information. + In the save information, set the format and file name. The format combo box does not contain + It contains all formats of items to be saved, so select the format to save from among them. + Select. + File names can be numbered by specifying %d. + +-- +The author is not responsible for any problems caused by this program. +We strongly recommend that you back up important files. + +Please send any bugs, requests, or questions to nakka@nakka.com. + +Copyright (C) 1996-2015 by Ohno Tomoaki. All rights reserved. + http://www.nakka.com/ + +2015/09/05 diff --git a/CLCLPlugin/tool_utl/tool_utl(japanese).txt b/CLCLPlugin/tool_utl/tool_utl(japanese).txt new file mode 100644 index 0000000..1a9be4d --- /dev/null +++ b/CLCLPlugin/tool_utl/tool_utl(japanese).txt @@ -0,0 +1,67 @@ +tool_utl Ver 0.0.3 +-- + + ͂߂ +CLCL̋@\gvOCc[łB + + CXg[ +̃c[ CLCL Ver 2.0.0 ȍ~œ삵܂B + +tool_utl.dll KȃfBNgɒuāACLCL̃IvVʂJuc[ +v^u\܂BŁAlj{^ tool_utl.dll w肷ƒlj +c[Ił܂B +IvV́uc[v^uJĂ tool_utl.dll hbOhbv +ƕ̃c[܂Ƃ߂ēo^ł܂B + +o[WAbvꍇ́ACLCLI tool_utl.dll ㏑ĂB +ACXg[ꍇ́ACLCLc[폜Ă tool_utl.dll 폜 +ĂB + +CXg[Ƃ tool_utl.dll Ȃꍇ́ADLL \Ȃݒ +ɂȂÔ\܂BGNXv[̃tH_ IvVŁuׂĂ +t@CƃtH_\vݒɂĂB + + @\ +ẼNA + ACeׂč폜܂B + +ENbv{[h̃NA + Nbv{[h̓eNA܂B + +E‚炷 + ɃACeljꂽƂɉ‚炵܂B + + CLCL̃c[ݒŁuɃf[^ljꂽṽIvVL̂ + AɃf[^ljƉ‚܂B + CLCL̃c[ݒŃvpeB{^Ɩ‚炷Ił܂B + +EőOʂɕ\ +EőOʂɕ\̉ + r[AőOʂɐݒA܂B + + CLCL̃c[ݒŁur[Ãj[vL̂ƂCLCL̃r[Aɂ + c[j[r[AőOʂɐݒA܂B + CLCL̃c[ݒŁur[AJṽIvVL̂ƂACLCL + ̃r[AJƂɃr[AőOʂɐݒ肵܂B + +EACe̕ۑ + ̃ACe𖼑Otăt@Cɕۑ܂B + + CLCL̃r[Aŗo^ACeXg(EyC)ɕ\ÃA + CeIẴc[I܂B + c[sƏo͐IAۑݒ肵܂B + ۑł́A`ƃt@Cݒ肵܂B`̃R{{bNXɂ͕ + Ώۂ̃ACě`ׂēĂ̂ŁA̒ۑ` + I܂B + t@C %d w肵Ĕԍt邱Ƃł܂B + +-- +̃vOɂċNȂQ҂͐ӔC܂B +؂ȃt@C̓obNAbvƂĂƂE߂܂B + +oOAv]A nakka@nakka.com ܂ł肢܂B + +Copyright (C) 1996-2015 by Ohno Tomoaki. All rights reserved. + http://www.nakka.com/ + +2015/09/05 diff --git a/CLCLPlugin/tool_utl/tool_utl.rc b/CLCLPlugin/tool_utl/tool_utl.rc index 4d3ea71..0a91e9b 100644 --- a/CLCLPlugin/tool_utl/tool_utl.rc +++ b/CLCLPlugin/tool_utl/tool_utl.rc @@ -1,4 +1,4 @@ -//Microsoft Developer Studio generated resource script. +// Microsoft Visual C++ generated resource script. // #include "resource.h" @@ -13,13 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// { resources +// Japanese (Japan) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) -#ifdef _WIN32 LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT #pragma code_page(932) -#endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@ -27,18 +25,18 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE BEGIN "#include ""winres.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -52,21 +50,19 @@ END // Dialog // -IDD_DIALOG_MULTI_SAVE DIALOG DISCARDABLE 0, 0, 187, 149 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_DIALOG_MULTI_SAVE DIALOG 0, 0, 187, 149 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "ۑݒ" FONT 9, "lr oSVbN" BEGIN LTEXT "ۑ`(&F):",IDC_STATIC,10,10,165,8 - COMBOBOX IDC_COMBO_FORMAT,10,20,165,170,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO_FORMAT,10,20,165,170,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "o͐(&O):",IDC_STATIC,10,45,165,8 EDITTEXT IDC_EDIT_PATH,10,55,150,13,ES_AUTOHSCROLL | ES_READONLY PUSHBUTTON "...",IDC_BUTTON_SELECT_PATH,162,55,13,13 LTEXT "t@C(&F):",IDC_STATIC,10,75,165,8 EDITTEXT IDC_EDIT_FILE_NAME,10,85,165,13,ES_AUTOHSCROLL - LTEXT "%d ŎIɃJEgAbv鐔ɂȂ܂B\n%04d Ǝw肷4̐ɂȂ܂B", - IDC_STATIC,10,103,165,20 + LTEXT "%d ŎIɃJEgAbv鐔ɂȂ܂B\n%04d Ǝw肷4̐ɂȂ܂B",IDC_STATIC,10,103,165,20 DEFPUSHBUTTON "OK",IDOK,70,130,50,14 PUSHBUTTON "LZ",IDCANCEL,126,130,50,14 END @@ -78,7 +74,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO BEGIN IDD_DIALOG_MULTI_SAVE, DIALOG BEGIN @@ -90,40 +86,62 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // { resources + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_CLEAR_HISTORY "̃NA(&H)" + IDS_CLEAR_CLIPBOARD "Nbv{[h̃NA(&E)" + IDS_PLAY_SOUND "‚炷(&P)" + IDS_ALWAYS_ON_TOP "őOʂɕ\(&T)" + IDS_UN_TOP "őOʂɕ\̉(&Z)" + IDS_SAVE_SEVERAL "ACe̕ۑ(&M)" + IDS_CLR_HIST_CAPTION "CLCL - ̃NA" +END + +STRINGTABLE +BEGIN + IDS_CLR_HIST_QUESTION "ׂĂ̗폜Ă낵łH" + IDS_WAVE_FILE "WAVEt@CI" + IDS_SEL_OUTPUT_FOLDER "o͐IĂ" + IDS_CAPTION_OUTPUT "ACe̕ۑ" + IDS_SAVE_FAILED "ۑɎs܂B" +END + + +#endif // Japanese (Japan) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// p (ض) resources -// English (US) resources +// English (United States) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) -#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Dialog // -IDD_DIALOG_MULTI_SAVE DIALOG DISCARDABLE 0, 0, 187, 149 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_DIALOG_MULTI_SAVE DIALOG 0, 0, 187, 149 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Save Information" FONT 8, "MS Sans Serif" BEGIN LTEXT "&Format:",IDC_STATIC,10,10,165,8 - COMBOBOX IDC_COMBO_FORMAT,10,20,165,170,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO_FORMAT,10,20,165,170,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "&Output directory:",IDC_STATIC,10,45,165,8 EDITTEXT IDC_EDIT_PATH,10,55,150,13,ES_AUTOHSCROLL | ES_READONLY PUSHBUTTON "...",IDC_BUTTON_SELECT_PATH,162,55,13,13 LTEXT "File &Name:",IDC_STATIC,10,75,165,8 EDITTEXT IDC_EDIT_FILE_NAME,10,85,165,13,ES_AUTOHSCROLL - LTEXT "%d - 1, 2, 3, 4...\n%04d - 0001, 0002, 0003, 0004...", - IDC_STATIC,10,103,165,20 + LTEXT "%d - 1, 2, 3, 4...\n%04d - 0001, 0002, 0003, 0004...",IDC_STATIC,10,103,165,20 DEFPUSHBUTTON "OK",IDOK,70,130,50,14 PUSHBUTTON "Cancel",IDCANCEL,126,130,50,14 END @@ -135,7 +153,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO BEGIN IDD_DIALOG_MULTI_SAVE, DIALOG BEGIN @@ -147,7 +165,34 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // English (US) resources + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_CLEAR_HISTORY "Clear &History" + IDS_CLEAR_CLIPBOARD "Clear &Clipboard" + IDS_PLAY_SOUND "&Play Sound" + IDS_ALWAYS_ON_TOP "Always on &Top" + IDS_UN_TOP "&Un Top" + IDS_SAVE_SEVERAL "Save of &more items" + IDS_CLR_HIST_CAPTION "CLCL - Clear History" +END + +STRINGTABLE +BEGIN + IDS_CLR_HIST_QUESTION "Are you sure you want to delete all items?" + IDS_WAVE_FILE "WAVE file" + IDS_SEL_OUTPUT_FOLDER "Please select a folder to output." + IDS_CAPTION_OUTPUT "Output" + IDS_SAVE_FAILED "Failed in save." +END + + +#endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/CLCLPlugin/tool_utl/tool_utl.txt b/CLCLPlugin/tool_utl/tool_utl.txt deleted file mode 100644 index bd9f7db..0000000 --- a/CLCLPlugin/tool_utl/tool_utl.txt +++ /dev/null @@ -1,4 +0,0 @@ -tool_utl Ver 0.0.3 --- - -Please add DLL to the tool of an CLCL option. diff --git a/CLCLPlugin/tool_utl/tool_utl.vcxproj b/CLCLPlugin/tool_utl/tool_utl.vcxproj index 1102348..5f35330 100644 --- a/CLCLPlugin/tool_utl/tool_utl.vcxproj +++ b/CLCLPlugin/tool_utl/tool_utl.vcxproj @@ -153,6 +153,7 @@ + diff --git a/CLCLPlugin/tool_utl/tool_utl.vcxproj.filters b/CLCLPlugin/tool_utl/tool_utl.vcxproj.filters index 7d944a8..aafdcbc 100644 --- a/CLCLPlugin/tool_utl/tool_utl.vcxproj.filters +++ b/CLCLPlugin/tool_utl/tool_utl.vcxproj.filters @@ -31,6 +31,9 @@ Header Files + + Header Files + From 46d18a577fe9a35b2883cffe22bd4f2af571fde5 Mon Sep 17 00:00:00 2001 From: wilfz Date: Mon, 5 May 2025 23:13:17 +0200 Subject: [PATCH 16/22] remove odbc32.lib, odbccp32.lib from linker --- CLCLPlugin/tool_utl/tool_utl.vcxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CLCLPlugin/tool_utl/tool_utl.vcxproj b/CLCLPlugin/tool_utl/tool_utl.vcxproj index 5f35330..85fdf2d 100644 --- a/CLCLPlugin/tool_utl/tool_utl.vcxproj +++ b/CLCLPlugin/tool_utl/tool_utl.vcxproj @@ -94,7 +94,7 @@ Console .\Debug\tool_utl.dll .\Debug\tool_utl.lib - winmm.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + winmm.lib;Shlwapi.lib;%(AdditionalDependencies) .\tool_utl.def @@ -137,7 +137,7 @@ Console .\Release\tool_utl.dll .\Release\tool_utl.lib - winmm.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + winmm.lib;Shlwapi.lib;%(AdditionalDependencies) .\tool_utl.def From 9485f35a95e81c40fd8a2540cffff7170e9719bf Mon Sep 17 00:00:00 2001 From: wilfz Date: Mon, 5 May 2025 23:17:06 +0200 Subject: [PATCH 17/22] replace hardcoded strings by strings from rc file; locate tool_utl.ini beside clcl.in --- CLCLPlugin/tool_utl/multi_save.c | 10 +++- CLCLPlugin/tool_utl/tool_utl.c | 91 +++++++++++++++++++++++++++----- 2 files changed, 85 insertions(+), 16 deletions(-) diff --git a/CLCLPlugin/tool_utl/multi_save.c b/CLCLPlugin/tool_utl/multi_save.c index 453fd65..6d26546 100644 --- a/CLCLPlugin/tool_utl/multi_save.c +++ b/CLCLPlugin/tool_utl/multi_save.c @@ -39,12 +39,14 @@ static BOOL folder_select(const HWND hWnd, TCHAR *ret) BROWSEINFO bi; LPITEMIDLIST itemid_list; TCHAR buf[BUF_SIZE]; + TCHAR title[BUF_SIZE]; + LoadString(hInst, IDS_SEL_OUTPUT_FOLDER, title, BUF_SIZE - 1); bi.hwndOwner = hWnd; bi.pidlRoot = (const struct _ITEMIDLIST *)CSIDL_DESKTOP; *buf = TEXT('\0'); bi.pszDisplayName = buf; - bi.lpszTitle = TEXT("Please select a folder to output."); + bi.lpszTitle = title; bi.ulFlags = BIF_RETURNONLYFSDIRS; bi.lpfn = NULL; bi.lParam = 0; @@ -173,7 +175,11 @@ __declspec(dllexport) int CALLBACK multi_save(const HWND hWnd, TOOL_EXEC_INFO *t wsprintf(file_name, multi_save_file_name, i); wsprintf(path, TEXT("%s\\%s"), save_path, file_name); if (SendMessage(hWnd, WM_ITEM_TO_FILE, (WPARAM)path, (LPARAM)wk_tdi->di) == FALSE) { - MessageBox(hWnd, TEXT("Failed in save."), TEXT("Output"), MB_ICONERROR); + TCHAR failed[BUF_SIZE]; + LoadString(hInst, IDS_SAVE_FAILED, failed, BUF_SIZE - 1); + TCHAR caption[BUF_SIZE]; + LoadString(hInst, IDS_CAPTION_OUTPUT, caption, BUF_SIZE - 1); + MessageBox(hWnd, failed, caption, MB_ICONERROR); return TOOL_CANCEL; } } diff --git a/CLCLPlugin/tool_utl/tool_utl.c b/CLCLPlugin/tool_utl/tool_utl.c index 113edb2..f619e1a 100644 --- a/CLCLPlugin/tool_utl/tool_utl.c +++ b/CLCLPlugin/tool_utl/tool_utl.c @@ -12,15 +12,19 @@ #define _INC_OLE #include #undef _INC_OLE +#include +#include +#include #include "..\CLCLPlugin.h" +#include "resource.h" /* Define */ #define INI_FILE_NAME TEXT("tool_utl.ini") /* Global Variables */ HINSTANCE hInst; -TCHAR ini_path[BUF_SIZE]; +TCHAR ini_path[MAX_PATH]; static TCHAR wave_file[BUF_SIZE]; @@ -58,11 +62,15 @@ int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved) */ static BOOL dll_initialize(void) { - TCHAR app_path[BUF_SIZE]; + TCHAR dll_path[MAX_PATH]; + TCHAR exe_path[MAX_PATH]; TCHAR *p, *r; - GetModuleFileName(hInst, app_path, BUF_SIZE - 1); - for (p = r = app_path; *p != TEXT('\0'); p++) { + // First look if it is portable installation. + // Handle NULL instead of hInst indicates to look + // for the path of the exe instead of the current dll. + GetModuleFileName(NULL, exe_path, MAX_PATH - 1); + for (p = r = exe_path; *p != TEXT('\0'); p++) { #ifndef UNICODE if (IsDBCSLeadByte((BYTE)*p) == TRUE) { p++; @@ -74,7 +82,55 @@ static BOOL dll_initialize(void) } } *r = TEXT('\0'); - wsprintf(ini_path, TEXT("%s\\%s"), app_path, INI_FILE_NAME); + + UINT portable = 0; + TCHAR clcl_ini_path[MAX_PATH]; + swprintf_s(clcl_ini_path, MAX_PATH, TEXT("%s\\%s"), exe_path, TEXT("clcl.ini")); + if (PathFileExists(clcl_ini_path)) { + portable = GetPrivateProfileInt(TEXT("GENERAL"), TEXT("GENERAL"), 0, clcl_ini_path); + } + + // get the dll folder + GetModuleFileName(hInst, dll_path, MAX_PATH - 1); + for (p = r = dll_path; *p != TEXT('\0'); p++) { +#ifndef UNICODE + if (IsDBCSLeadByte((BYTE)*p) == TRUE) { + p++; + continue; + } +#endif // UNICODE + if (*p == TEXT('\\') || *p == TEXT('/')) { + r = p; + } + } + *r = TEXT('\0'); + + if (portable == 1) { // If portable installation + swprintf_s(ini_path, MAX_PATH, TEXT("%s\\%s"), dll_path, INI_FILE_NAME); // locate ini in dll folder + // If ini file does not yet exist in dll folder we locate it + // in the exe folder where clcl.ini also resides. + if (PathFileExists(ini_path) == FALSE) + swprintf_s(ini_path, MAX_PATH, TEXT("%s\\%s"), exe_path, INI_FILE_NAME); // same folder as clcl.exe and clcl.ini + } + else { + // For normal installation (not portable app) set ini_path to the same folder as %LOCALAPPDATA%\CLCL\clcl.ini + // so that we have write access. + // See Clcl\main.c line 2234 ff (get_work_path()) + TCHAR local_app_data[MAX_PATH]; + if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, local_app_data))) { + swprintf_s(ini_path, MAX_PATH, TEXT("%s\\clcl\\%s"), local_app_data, INI_FILE_NAME); + // If ini file not yet exists here, we may read the settings form old location in dll folder + // but I don't consider it necessary. + //if (PathFileExists(ini_path) == FALSE) { + // TCHAR old_ini[MAX_PATH]; + // wsprintf(old_ini, TEXT("%s\\%s"), dll_path, INI_FILE_NAME); + // if (PathFileExists(old_ini)) { + // // TODO: read values from old_ini + // // and return + // } + //} + } + } GetPrivateProfileString(TEXT("play_sound"), TEXT("wave_file"), TEXT(""), wave_file, BUF_SIZE - 1, ini_path); @@ -98,42 +154,42 @@ __declspec(dllexport) BOOL CALLBACK get_tool_info_w(const HWND hWnd, const int i { switch (index) { case 0: - lstrcpy(tgi->title, TEXT("Clear &History")); + LoadString(hInst, IDS_CLEAR_HISTORY, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("clear_history")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_VIEWER; return TRUE; case 1: - lstrcpy(tgi->title, TEXT("Clear &Clipboard")); + LoadString(hInst, IDS_CLEAR_CLIPBOARD, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("clear_clipboard")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_VIEWER; return TRUE; case 2: - lstrcpy(tgi->title, TEXT("&Play Sound")); + LoadString(hInst, IDS_PLAY_SOUND, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("play_sound")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_ADD_HISTORY; return TRUE; case 3: - lstrcpy(tgi->title, TEXT("Always on &Top")); + LoadString(hInst, IDS_ALWAYS_ON_TOP, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("ztop")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_VIEWER; return TRUE; case 4: - lstrcpy(tgi->title, TEXT("&Un Top")); + LoadString(hInst, IDS_UN_TOP, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("unztop")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_VIEWER; return TRUE; case 5: - lstrcpy(tgi->title, TEXT("Save of &more items")); + LoadString(hInst, IDS_SAVE_SEVERAL, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("multi_save")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_VIEWER; @@ -148,8 +204,13 @@ __declspec(dllexport) BOOL CALLBACK get_tool_info_w(const HWND hWnd, const int i __declspec(dllexport) int CALLBACK clear_history(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) { DATA_INFO *di; - - if (MessageBox(hWnd, TEXT("Are you sure you want to delete all items?"), TEXT("CLCL - Clear History"), + + TCHAR clr_hist_question[BUF_SIZE]; + LoadString(hInst, IDS_CLR_HIST_QUESTION, clr_hist_question, BUF_SIZE - 1); + TCHAR clr_hist_caption[BUF_SIZE]; + LoadString(hInst, IDS_CLR_HIST_CAPTION, clr_hist_caption, BUF_SIZE - 1); + + if (MessageBox(hWnd, clr_hist_question, clr_hist_caption, MB_ICONQUESTION | MB_YESNO | MB_TOPMOST) == IDNO) { return TOOL_SUCCEED; } @@ -211,13 +272,15 @@ __declspec(dllexport) BOOL CALLBACK play_sound_property(const HWND hWnd, TOOL_EX { OPENFILENAME of; TCHAR buf[MAX_PATH]; + TCHAR title[BUF_SIZE]; + LoadString(hInst, IDS_WAVE_FILE, title, BUF_SIZE - 1); // t@C̑I ZeroMemory(&of, sizeof(OPENFILENAME)); of.lStructSize = sizeof(OPENFILENAME); of.hInstance = hInst; of.hwndOwner = hWnd; - of.lpstrTitle = TEXT("WAVE file"); + of.lpstrTitle = title; of.lpstrFilter = TEXT("*.wav\0*.wav\0*.*\0*.*\0\0"); of.nFilterIndex = 1; lstrcpy(buf, wave_file); From fca77261cab32033731bb57fc860f59709022da1 Mon Sep 17 00:00:00 2001 From: wilfz Date: Mon, 19 May 2025 22:31:46 +0200 Subject: [PATCH 18/22] added tool_test.rc; moved menu titles into string resources --- CLCLPlugin/tool_test/resource.h | 22 ++++ CLCLPlugin/tool_test/tool_test.c | 41 +++++-- CLCLPlugin/tool_test/tool_test.dsp | 113 ------------------ CLCLPlugin/tool_test/tool_test.dsw | 29 ----- CLCLPlugin/tool_test/tool_test.rc | 103 ++++++++++++++++ CLCLPlugin/tool_test/tool_test.vcxproj | 4 + .../tool_test/tool_test.vcxproj.filters | 8 ++ 7 files changed, 170 insertions(+), 150 deletions(-) create mode 100644 CLCLPlugin/tool_test/resource.h delete mode 100644 CLCLPlugin/tool_test/tool_test.dsp delete mode 100644 CLCLPlugin/tool_test/tool_test.dsw create mode 100644 CLCLPlugin/tool_test/tool_test.rc diff --git a/CLCLPlugin/tool_test/resource.h b/CLCLPlugin/tool_test/resource.h new file mode 100644 index 0000000..d67832d --- /dev/null +++ b/CLCLPlugin/tool_test/resource.h @@ -0,0 +1,22 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by tool_test.rc +// +#define IDS_TEST1 101 +#define IDS_TEST2 102 +#define IDS_TEST3 103 +#define IDS_TEST4 104 +#define IDS_TEST5 105 +#define IDS_TEST6 106 +#define IDS_TEST7 107 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 108 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/CLCLPlugin/tool_test/tool_test.c b/CLCLPlugin/tool_test/tool_test.c index 239b837..4f2efd2 100644 --- a/CLCLPlugin/tool_test/tool_test.c +++ b/CLCLPlugin/tool_test/tool_test.c @@ -14,6 +14,7 @@ #undef _INC_OLE #include "..\CLCLPlugin.h" +#include "resource.h" /* Define */ @@ -42,55 +43,71 @@ int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved) /* * get_tool_info_w - c[擾 - * Get tool information + * Get tool information + * + * / argument: + * hWnd - ĂяoEBhE / the calling window + * index - 擾̃CfbNX (0`) / the index of the acquisition (from 0) + * tgi - c[擾 / tool retrieval information + * + * ߂l / Return value: + * TRUE - Ɏ擾c[ / has tools to get next + * FALSE - 擾̏I / end of acquisition */ __declspec(dllexport) BOOL CALLBACK get_tool_info_w(const HWND hWnd, const int index, TOOL_GET_INFO *tgi) { switch (index) { case 0: - lstrcpy(tgi->title, TEXT("eXg1")); + // Remove specific format in item + LoadString(hInst, IDS_TEST1, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("test1")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_VIEWER; return TRUE; case 1: - lstrcpy(tgi->title, TEXT("eXg2")); + // Delete item + LoadString(hInst, IDS_TEST2, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("test2")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_VIEWER; return TRUE; case 2: - lstrcpy(tgi->title, TEXT("eXg3")); + // Save item + LoadString(hInst, IDS_TEST3, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("test3")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_VIEWER; return TRUE; case 3: - lstrcpy(tgi->title, TEXT("eXg4")); + // Create a text item from a file + LoadString(hInst, IDS_TEST4, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("test4")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_VIEWER; return TRUE; case 4: - lstrcpy(tgi->title, TEXT("eXg5")); + // Show item title + LoadString(hInst, IDS_TEST5, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("test5")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_VIEWER; return TRUE; case 5: - lstrcpy(tgi->title, TEXT("eXg6")); + // Save the data in a separate file + LoadString(hInst, IDS_TEST6, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("test6")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_START | CALLTYPE_END; return TRUE; case 6: - lstrcpy(tgi->title, TEXT("eXg7")); + // Test7 + LoadString(hInst, IDS_TEST7, tgi->title, BUF_SIZE - 1); lstrcpy(tgi->func_name, TEXT("test7")); lstrcpy(tgi->cmd_line, TEXT("")); tgi->call_type = CALLTYPE_MENU | CALLTYPE_VIEWER; @@ -102,6 +119,14 @@ __declspec(dllexport) BOOL CALLBACK get_tool_info_w(const HWND hWnd, const int i /* * test1 - ACe̓`폜 * test1 - Remove specific format in item + * + * / argument: + * hWnd - ĂяoEBhE / the calling window + * tei - c[s / tool execution information + * tdi - c[pACe / item information for tools + * + * ߂l / Return value: + * TOOL_ */ __declspec(dllexport) int CALLBACK test1(const HWND hWnd, TOOL_EXEC_INFO *tei, TOOL_DATA_INFO *tdi) { diff --git a/CLCLPlugin/tool_test/tool_test.dsp b/CLCLPlugin/tool_test/tool_test.dsp deleted file mode 100644 index 50960d6..0000000 --- a/CLCLPlugin/tool_test/tool_test.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tool_test" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** ҏWȂł ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=tool_test - Win32 Debug -!MESSAGE ͗LҲ̧قł͂܂B ۼުĂނ邽߂ɂ NMAKE gpĂB -!MESSAGE [Ҳ̧ق̴߰] ނgpĎsĂ -!MESSAGE -!MESSAGE NMAKE /f "tool_test.mak". -!MESSAGE -!MESSAGE NMAKE ̎sɍ\wł܂ -!MESSAGE ײݏϸۂ̐ݒ`܂B: -!MESSAGE -!MESSAGE NMAKE /f "tool_test.mak" CFG="tool_test - Win32 Debug" -!MESSAGE -!MESSAGE I”\ Ӱ: -!MESSAGE -!MESSAGE "tool_test - Win32 Release" ("Win32 (x86) Dynamic-Link Library" p) -!MESSAGE "tool_test - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" p) -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "tool_test - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEST_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEST_EXPORTS" /D "UNICODE" /D "_UNICODE" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x411 /d "NDEBUG" -# ADD RSC /l 0x411 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 - -!ELSEIF "$(CFG)" == "tool_test - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEST_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOOL_TEST_EXPORTS" /D "UNICODE" /D "_UNICODE" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x411 /d "_DEBUG" -# ADD RSC /l 0x411 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "tool_test - Win32 Release" -# Name "tool_test - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\tool_test.c -# End Source File -# Begin Source File - -SOURCE=.\tool_test.def -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\CLCLPlugin.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/CLCLPlugin/tool_test/tool_test.dsw b/CLCLPlugin/tool_test/tool_test.dsw deleted file mode 100644 index 4a7cf31..0000000 --- a/CLCLPlugin/tool_test/tool_test.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# x: ܰ߰ ̧ ҏW܂͍폜Ȃł! - -############################################################################### - -Project: "tool_test"=".\tool_test.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/CLCLPlugin/tool_test/tool_test.rc b/CLCLPlugin/tool_test/tool_test.rc new file mode 100644 index 0000000..fbca910 --- /dev/null +++ b/CLCLPlugin/tool_test/tool_test.rc @@ -0,0 +1,103 @@ +// 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 + +///////////////////////////////////////////////////////////////////////////// +// Japanese (Japan) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT +#pragma code_page(932) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_TEST1 "ACe̓`폜" + IDS_TEST2 "ACe̍폜" + IDS_TEST3 "ACe̕ۑ" + IDS_TEST4 "t@CeLXg`̃ACe쐬" + IDS_TEST5 "ACẽ^Cg\" + IDS_TEST6 "f[^ʃt@Cɕۑ" + IDS_TEST7 "eXg7" +END + +#endif // Japanese (Japan) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +// String Table +// + +STRINGTABLE +BEGIN + IDS_TEST1 "Remove specific format in item" + IDS_TEST2 "Delete Item" + IDS_TEST3 "Save Item" + IDS_TEST4 "Create a text item from a file" + IDS_TEST5 "Show item title" + IDS_TEST6 "Save the data in a separate file" + IDS_TEST7 "Test7" +END + + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/CLCLPlugin/tool_test/tool_test.vcxproj b/CLCLPlugin/tool_test/tool_test.vcxproj index 1102799..15c18bd 100644 --- a/CLCLPlugin/tool_test/tool_test.vcxproj +++ b/CLCLPlugin/tool_test/tool_test.vcxproj @@ -141,6 +141,10 @@ + + + + diff --git a/CLCLPlugin/tool_test/tool_test.vcxproj.filters b/CLCLPlugin/tool_test/tool_test.vcxproj.filters index 421b723..fff0885 100644 --- a/CLCLPlugin/tool_test/tool_test.vcxproj.filters +++ b/CLCLPlugin/tool_test/tool_test.vcxproj.filters @@ -23,10 +23,18 @@ Header Files + + Header Files + Source Files + + + Source Files + + \ No newline at end of file From 1ea38cf46d138d6f693c9ce25f99c90caf88edb9 Mon Sep 17 00:00:00 2001 From: wilfz Date: Mon, 19 May 2025 23:40:51 +0200 Subject: [PATCH 19/22] included plugin projects in solution --- CLCL.sln | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CLCL.sln b/CLCL.sln index 6570678..2cc9d5b 100644 --- a/CLCL.sln +++ b/CLCL.sln @@ -9,6 +9,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CLCLHook", "CLCLHook\CLCLHo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CLCLSet", "CLCLSet\CLCLSet.vcxproj", "{F701700D-6556-4BB3-BA90-5709B614FD40}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tool_text", "CLCLPlugin\tool_text\tool_text.vcxproj", "{D439BB63-3D81-4791-BD68-22B11AE43A16}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tool_test", "CLCLPlugin\tool_test\tool_test.vcxproj", "{D4837AC4-2903-4344-A248-4EC2321875A3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tool_utl", "CLCLPlugin\tool_utl\tool_utl.vcxproj", "{E624A3AA-D8A8-4137-9A09-D53035A83B11}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 @@ -34,6 +40,24 @@ Global {F701700D-6556-4BB3-BA90-5709B614FD40}.Release|x86.Build.0 = Release|Win32 {F701700D-6556-4BB3-BA90-5709B614FD40}.Template|x86.ActiveCfg = Release|Win32 {F701700D-6556-4BB3-BA90-5709B614FD40}.Template|x86.Build.0 = Release|Win32 + {D439BB63-3D81-4791-BD68-22B11AE43A16}.Debug|x86.ActiveCfg = Debug|Win32 + {D439BB63-3D81-4791-BD68-22B11AE43A16}.Debug|x86.Build.0 = Debug|Win32 + {D439BB63-3D81-4791-BD68-22B11AE43A16}.Release|x86.ActiveCfg = Release|Win32 + {D439BB63-3D81-4791-BD68-22B11AE43A16}.Release|x86.Build.0 = Release|Win32 + {D439BB63-3D81-4791-BD68-22B11AE43A16}.Template|x86.ActiveCfg = Debug|Win32 + {D439BB63-3D81-4791-BD68-22B11AE43A16}.Template|x86.Build.0 = Debug|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Debug|x86.ActiveCfg = Debug|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Debug|x86.Build.0 = Debug|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Release|x86.ActiveCfg = Release|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Release|x86.Build.0 = Release|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Template|x86.ActiveCfg = Release|Win32 + {D4837AC4-2903-4344-A248-4EC2321875A3}.Template|x86.Build.0 = Release|Win32 + {E624A3AA-D8A8-4137-9A09-D53035A83B11}.Debug|x86.ActiveCfg = Debug|Win32 + {E624A3AA-D8A8-4137-9A09-D53035A83B11}.Debug|x86.Build.0 = Debug|Win32 + {E624A3AA-D8A8-4137-9A09-D53035A83B11}.Release|x86.ActiveCfg = Release|Win32 + {E624A3AA-D8A8-4137-9A09-D53035A83B11}.Release|x86.Build.0 = Release|Win32 + {E624A3AA-D8A8-4137-9A09-D53035A83B11}.Template|x86.ActiveCfg = Debug|Win32 + {E624A3AA-D8A8-4137-9A09-D53035A83B11}.Template|x86.Build.0 = Debug|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 533a39c7ddb06f2da7bb4398af1aa9937f64196f Mon Sep 17 00:00:00 2001 From: wilfz Date: Tue, 20 May 2025 09:00:10 +0200 Subject: [PATCH 20/22] removed odbc32.lib;odbccp32.lib; from project --- CLCLPlugin/tool_text/tool_text.vcxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CLCLPlugin/tool_text/tool_text.vcxproj b/CLCLPlugin/tool_text/tool_text.vcxproj index 98275c8..a5ba6c7 100644 --- a/CLCLPlugin/tool_text/tool_text.vcxproj +++ b/CLCLPlugin/tool_text/tool_text.vcxproj @@ -86,7 +86,7 @@ Console .\Release\tool_text.dll .\Release\tool_text.lib - odbc32.lib;odbccp32.lib;Shlwapi.lib;%(AdditionalDependencies) + Shlwapi.lib;%(AdditionalDependencies) .\tool_text.def @@ -128,7 +128,7 @@ Console .\Debug\tool_text.dll .\Debug\tool_text.lib - odbc32.lib;odbccp32.lib;Shlwapi.lib;%(AdditionalDependencies) + Shlwapi.lib;%(AdditionalDependencies) .\tool_text.def From 83d15f31efd51efa1aa55f808a31b912fa238560 Mon Sep 17 00:00:00 2001 From: wilfzim <48259856+wilfz@users.noreply.github.com> Date: Wed, 11 Jun 2025 22:40:37 +0200 Subject: [PATCH 21/22] added version info --- CLCLPlugin/tool_test/tool_test.rc | 38 ++++++++++++++++++++++++++++++ CLCLPlugin/tool_text/tool_text.rc | 39 +++++++++++++++++++++++++++++++ CLCLPlugin/tool_utl/tool_utl.rc | 38 ++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+) diff --git a/CLCLPlugin/tool_test/tool_test.rc b/CLCLPlugin/tool_test/tool_test.rc index fbca910..bb9b419 100644 --- a/CLCLPlugin/tool_test/tool_test.rc +++ b/CLCLPlugin/tool_test/tool_test.rc @@ -45,6 +45,44 @@ END #endif // APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,1,3,0 + PRODUCTVERSION 2,1,3,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040704b0" + BEGIN + VALUE "FileDescription", "tool_test plugin for CLCL" + VALUE "FileVersion", "2.1.3.0" + VALUE "InternalName", "tool_test.dll" + VALUE "LegalCopyright", "Copyright (C) 1996-2025 by Ohno Tomoaki. " + VALUE "OriginalFilename", "tool_test.dll" + VALUE "ProductName", "CLCL" + VALUE "ProductVersion", "2.1.3.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x411, 1200 + END +END + + ///////////////////////////////////////////////////////////////////////////// // // String Table diff --git a/CLCLPlugin/tool_text/tool_text.rc b/CLCLPlugin/tool_text/tool_text.rc index f1e3a07..6fc02ef 100644 --- a/CLCLPlugin/tool_text/tool_text.rc +++ b/CLCLPlugin/tool_text/tool_text.rc @@ -224,6 +224,45 @@ BEGIN END #endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,1,3,0 + PRODUCTVERSION 2,1,3,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040704b0" + BEGIN + VALUE "FileDescription", "tool_text plugin for CLCL" + VALUE "FileVersion", "2.1.3.0" + VALUE "InternalName", "tool_text.dll" + VALUE "LegalCopyright", "Copyright (C) 1996-2025 by Ohno Tomoaki. " + VALUE "OriginalFilename", "tool_text.dll" + VALUE "ProductName", "CLCL" + VALUE "ProductVersion", "2.1.3.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x411, 1200 + END +END + + ///////////////////////////////////////////////////////////////////////////// // // String Table diff --git a/CLCLPlugin/tool_utl/tool_utl.rc b/CLCLPlugin/tool_utl/tool_utl.rc index 0a91e9b..c7c13c9 100644 --- a/CLCLPlugin/tool_utl/tool_utl.rc +++ b/CLCLPlugin/tool_utl/tool_utl.rc @@ -87,6 +87,44 @@ END #endif // APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,1,3,0 + PRODUCTVERSION 2,1,3,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040704b0" + BEGIN + VALUE "FileDescription", "tool_utl plugin for CLCL" + VALUE "FileVersion", "2.1.3.0" + VALUE "InternalName", "tool_utl.dll" + VALUE "LegalCopyright", "Copyright (C) 1996-2025 by Ohno Tomoaki. " + VALUE "OriginalFilename", "tool_utl.dll" + VALUE "ProductName", "CLCL" + VALUE "ProductVersion", "2.1.3.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x411, 1200 + END +END + + ///////////////////////////////////////////////////////////////////////////// // // String Table From 25b7abf6c0dd18f5e5dfe6446bf54e494e4d334d Mon Sep 17 00:00:00 2001 From: wilfzim <48259856+wilfz@users.noreply.github.com> Date: Wed, 11 Jun 2025 23:19:55 +0200 Subject: [PATCH 22/22] spelling --- CLCLSet/CLCLSet.rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CLCLSet/CLCLSet.rc b/CLCLSet/CLCLSet.rc index c3b2c7d..4db2da8 100644 --- a/CLCLSet/CLCLSet.rc +++ b/CLCLSet/CLCLSet.rc @@ -910,8 +910,8 @@ BEGIN CONTROL "&No check",IDC_RADIO_CHECK_NO,"Button",BS_AUTORADIOBUTTON | WS_GROUP,16,115,218,10 CONTROL "&Only last History will be checked",IDC_RADIO_CHECK_ONE, "Button",BS_AUTORADIOBUTTON,16,128,218,10 - CONTROL "&All History will be cheked",IDC_RADIO_CHECK_ALL,"Button",BS_AUTORADIOBUTTON,16,141,218,10 - CONTROL "All History will be cheked and &deleted duplicate History",IDC_RADIO_CHECK_ALL_DELETE, + CONTROL "&All History will be checked",IDC_RADIO_CHECK_ALL,"Button",BS_AUTORADIOBUTTON,16,141,218,10 + CONTROL "All History will be checked and duplicates &deleted",IDC_RADIO_CHECK_ALL_DELETE, "Button",BS_AUTORADIOBUTTON,16,154,218,10 END