Skip to content

Commit

Permalink
1.8.7
Browse files Browse the repository at this point in the history
・SKK辞書のダウンロード機能を追加しました。
 ・設定ダイアログの「辞書」タブに「URL追加」ボタンを追加しました。
 ・プロトコルは、FTP, HTTP, HTTPS に対応しています。
 ・プロキシはOSに設定されたものが使用されます。
 ・ディレクトリ %TMP%\CorvusSKK または %TEMP%\CorvusSKK に一時ファイルが保存されます。

・BOMなしUTF-8のSKK辞書の読み込みに対応しました。
 ・対応するSKK辞書の文字コードは、EUC-JIS-2004、UTF-8 (BOMなし/あり)、UTF-16 (LE, BOMあり)となります。

・プログラム実行変換で、リスト全体を一旦Luaのテーブルに変換してから処理するようにしました。

・インストーラーのファイル名にバージョン番号を付加するようにしました。
  • Loading branch information
nathancorvussolis committed May 24, 2015
1 parent 88bf5d2 commit 226e71f
Show file tree
Hide file tree
Showing 31 changed files with 979 additions and 785 deletions.
548 changes: 534 additions & 14 deletions README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions common/common.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

#include "common.h"

#define CCSUNICODE L",ccs=UNICODE"
#define CCSUTF16 L",ccs=UTF-16LE"
#define CCSUTF8 L",ccs=UTF-8"
LPCWSTR RccsUNICODE = L"r" CCSUNICODE;
LPCWSTR WccsUNICODE = L"w" CCSUNICODE;
LPCWSTR RccsUTF16 = L"r" CCSUTF16;
LPCWSTR WccsUTF16 = L"w" CCSUTF16;
LPCWSTR RccsUTF8 = L"r" CCSUTF8;
LPCWSTR WccsUTF8 = L"w" CCSUTF8;
LPCWSTR RB = L"rb";
Expand Down
4 changes: 2 additions & 2 deletions common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ typedef struct {
BYTE digest[16];
} MD5_DIGEST;

extern LPCWSTR RccsUNICODE;
extern LPCWSTR WccsUNICODE;
extern LPCWSTR RccsUTF16;
extern LPCWSTR WccsUTF16;
extern LPCWSTR RccsUTF8;
extern LPCWSTR WccsUTF8;
extern LPCWSTR RB;
Expand Down
6 changes: 3 additions & 3 deletions common/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define VERSION_H

#define TEXTSERVICE_NAME L"CorvusSKK"
#define TEXTSERVICE_VER L"1.8.6"
#define TEXTSERVICE_VER L"1.8.7"

#ifndef _DEBUG
#define TEXTSERVICE_DESC TEXTSERVICE_NAME
Expand All @@ -14,7 +14,7 @@
//for resource
#define RC_AUTHOR "nathancorvussolis"
#define RC_PRODUCT "CorvusSKK"
#define RC_VERSION "1.8.6"
#define RC_VERSION_D 1,8,6,0
#define RC_VERSION "1.8.7"
#define RC_VERSION_D 1,8,7,0

#endif
83 changes: 82 additions & 1 deletion imcrvcnf/DlgProcDictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ static LPCWSTR defaultHost = L"localhost";
static LPCWSTR defaultPort = L"1178";
static LPCWSTR defaultTimeOut = L"1000";

static WCHAR urlskkdic[INTERNET_MAX_URL_LENGTH];

INT_PTR CALLBACK DlgProcSKKDicAddUrl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);

INT_PTR CALLBACK DlgProcDictionary(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND hWndListView;
Expand Down Expand Up @@ -95,12 +99,13 @@ INT_PTR CALLBACK DlgProcDictionary(HWND hDlg, UINT message, WPARAM wParam, LPARA
}
return TRUE;

case IDC_BUTTON_SKK_DIC_ADD:
case IDC_BUTTON_SKK_DIC_ADD_FILE:
path[0] = L'\0';
ZeroMemory(&ofn, sizeof(OPENFILENAMEW));
ofn.lStructSize = sizeof(OPENFILENAMEW);
ofn.hwndOwner = hDlg;
ofn.lpstrFile = path;
ofn.lpstrTitle = L"ファイル追加";
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_FILEMUSTEXIST;
if(GetOpenFileNameW(&ofn) != 0)
Expand Down Expand Up @@ -128,6 +133,38 @@ INT_PTR CALLBACK DlgProcDictionary(HWND hDlg, UINT message, WPARAM wParam, LPARA
}
return TRUE;

case IDC_BUTTON_SKK_DIC_ADD_URL:
urlskkdic[0] = L'\0';
if(IDOK == DialogBoxW(hInst, MAKEINTRESOURCE(IDD_DIALOG_SKK_DIC_ADD_URL), hDlg, DlgProcSKKDicAddUrl))
{
if(urlskkdic[0] == L'\0')
{
return TRUE;
}

PropSheet_Changed(GetParent(hDlg), hDlg);

index = ListView_GetNextItem(hWndListView, -1, LVNI_SELECTED);
count = ListView_GetItemCount(hWndListView);
if(index == -1)
{
index = count;
}
else
{
++index;
}
item.mask = LVIF_TEXT;
item.pszText = urlskkdic;
item.iItem = index;
item.iSubItem = 0;
ListView_InsertItem(hWndListView, &item);
ListView_SetItemState(hWndListView, index, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
ListView_SetColumnWidth(hWndListView, 0, LVSCW_AUTOSIZE);
ListView_EnsureVisible(hWndListView, index, FALSE);
}
return TRUE;

case IDC_BUTTON_SKK_DIC_DEL:
index = ListView_GetNextItem(hWndListView, -1, LVNI_SELECTED);
if(index != -1)
Expand Down Expand Up @@ -225,3 +262,47 @@ INT_PTR CALLBACK DlgProcDictionary(HWND hDlg, UINT message, WPARAM wParam, LPARA

return FALSE;
}

INT_PTR CALLBACK DlgProcSKKDicAddUrl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
return TRUE;
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
case WM_CTLCOLORBTN:
SetBkMode((HDC)wParam, TRANSPARENT);
SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
return (INT_PTR)GetSysColorBrush(COLOR_WINDOW);
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
GetDlgItemTextW(hDlg, IDC_EDIT_SKK_DIC_URL, urlskkdic, _countof(urlskkdic));
{
// trim
std::wstring strurl = std::regex_replace(std::wstring(urlskkdic),
std::wregex(L"^\\s+|\\s+$"), std::wstring(L""));
_snwprintf_s(urlskkdic, _TRUNCATE, L"%s", strurl.c_str());

if(urlskkdic[0] == L'\0')
{
EndDialog(hDlg, IDCANCEL);
}
}
EndDialog(hDlg, IDOK);
break;
case IDCANCEL:
urlskkdic[0] = L'\0';
EndDialog(hDlg, IDCANCEL);
break;
default:
break;
}
break;
default:
break;
}
return FALSE;
}
Loading

0 comments on commit 226e71f

Please sign in to comment.