New import
@@ -0,0 +1,25 @@ | ||
1 | +// stdafx.h : 標準のシステム インクルード ファイルのインクルード ファイル、または | |
2 | +// 参照回数が多く、かつあまり変更されない、プロジェクト専用のインクルード ファイル | |
3 | +// を記述します。 | |
4 | +// | |
5 | + | |
6 | +#pragma once | |
7 | + | |
8 | +#include "targetver.h" | |
9 | + | |
10 | +#define WIN32_LEAN_AND_MEAN // Windows ヘッダーから使用されていない部分を除外します。 | |
11 | +// Windows ヘッダー ファイル: | |
12 | +#include <windows.h> | |
13 | + | |
14 | +// C ランタイム ヘッダー ファイル | |
15 | +#include <stdlib.h> | |
16 | +#include <malloc.h> | |
17 | +#include <memory.h> | |
18 | +#include <tchar.h> | |
19 | + | |
20 | + | |
21 | +// TODO: プログラムに必要な追加ヘッダーをここで参照してください。 | |
22 | +#include "./ClassLib/Conv.h" | |
23 | + | |
24 | +#include "Notepad.h" | |
25 | + |
@@ -0,0 +1,12 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#include <windows.h> | |
4 | +#include <windows.h> | |
5 | +#include <stdio.h> | |
6 | +#include <tchar.h> | |
7 | +#include <iostream> | |
8 | +using namespace std; | |
9 | + | |
10 | +BOOL CALLBACK FindWindowProc(HWND hWnd, LPARAM lParam); | |
11 | +VOID Notepad(std::wstring FileName); | |
12 | + |
@@ -0,0 +1,238 @@ | ||
1 | +// TenjiTexter.cpp : アプリケーションのエントリ ポイントを定義します。 | |
2 | +// | |
3 | + | |
4 | +#include "stdafx.h" | |
5 | +#include "TenjiTexter.h" | |
6 | + | |
7 | +#define MAX_LOADSTRING 100 | |
8 | + | |
9 | +// グローバル変数: | |
10 | +HINSTANCE hInst; // 現在のインターフェイス | |
11 | +TCHAR szTitle[MAX_LOADSTRING]; // タイトル バーのテキスト | |
12 | +TCHAR szWindowClass[MAX_LOADSTRING]; // メイン ウィンドウ クラス名 | |
13 | + | |
14 | +// このコード モジュールに含まれる関数の宣言を転送します: | |
15 | +ATOM MyRegisterClass(HINSTANCE hInstance); | |
16 | +BOOL InitInstance(HINSTANCE, int); | |
17 | +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); | |
18 | +INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); | |
19 | + | |
20 | +int APIENTRY _tWinMain(HINSTANCE hInstance, | |
21 | + HINSTANCE hPrevInstance, | |
22 | + LPTSTR lpCmdLine, | |
23 | + int nCmdShow) | |
24 | +{ | |
25 | + UNREFERENCED_PARAMETER(hPrevInstance); | |
26 | + UNREFERENCED_PARAMETER(lpCmdLine); | |
27 | + | |
28 | + // TODO: ここにコードを挿入してください。 | |
29 | + MSG msg; | |
30 | + HACCEL hAccelTable; | |
31 | + | |
32 | + nCmdShow = SW_HIDE; //* | |
33 | + msg.wParam = NULL; //* | |
34 | + | |
35 | + | |
36 | + // グローバル文字列を初期化しています。 | |
37 | + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); | |
38 | + LoadString(hInstance, IDC_TENJITEXTER, szWindowClass, MAX_LOADSTRING); | |
39 | + MyRegisterClass(hInstance); | |
40 | + | |
41 | + // アプリケーションの初期化を実行します: | |
42 | + if (!InitInstance (hInstance, nCmdShow)) | |
43 | + { | |
44 | + return FALSE; | |
45 | + } | |
46 | + | |
47 | + hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_TENJITEXTER)); | |
48 | + | |
49 | + /* | |
50 | + // メイン メッセージ ループ: | |
51 | + while (GetMessage(&msg, NULL, 0, 0)) | |
52 | + { | |
53 | + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) | |
54 | + { | |
55 | + TranslateMessage(&msg); | |
56 | + DispatchMessage(&msg); | |
57 | + } | |
58 | + } | |
59 | + */ | |
60 | + | |
61 | + ////////////////////////////////////////////////////////////////////////////// | |
62 | + // ここから | |
63 | + ////////////////////////////////////////////////////////////////////////////// | |
64 | + | |
65 | + //2重起動の防止 | |
66 | + HANDLE hMutex = CreateMutex(FALSE, 0, szTitle); | |
67 | + if(GetLastError() == ERROR_ALREADY_EXISTS) { | |
68 | + CloseHandle(hMutex); | |
69 | + return 1; | |
70 | + } | |
71 | + | |
72 | + | |
73 | + // ファイル名取得 | |
74 | + std::wstring szOpenFile = lpCmdLine; | |
75 | + | |
76 | + // ダブルコーテーションを除く | |
77 | + while(szOpenFile.find(L'"',0)!=-1) | |
78 | + szOpenFile.replace(szOpenFile.find(L'"',0),1,L""); | |
79 | + | |
80 | + // テキストファイル名の作成 | |
81 | + _TCHAR szPathFile[_MAX_PATH]; | |
82 | + _TCHAR szDrive[_MAX_DRIVE]; | |
83 | + _TCHAR szDir[_MAX_DIR]; | |
84 | + _TCHAR szFile[_MAX_FNAME]; | |
85 | + _TCHAR szFileExt[_MAX_FNAME]; | |
86 | + _TCHAR szExt[_MAX_EXT]; | |
87 | + _tsplitpath_s(szOpenFile.c_str(), szDrive, _MAX_DRIVE, szDir, _MAX_DIR, szFile, _MAX_FNAME, szExt, _MAX_EXT); | |
88 | + _tcscpy_s(szFileExt,_MAX_FNAME,szFile); | |
89 | + | |
90 | + locale::global(locale("japanese")); | |
91 | + string Buff; | |
92 | + | |
93 | + if((_tcsicmp(szExt,L".bes")!=0)&&(_tcsicmp(szExt,L".bet")!=0)) | |
94 | + { | |
95 | + MessageBox(NULL,L"拡張子または引き数が違います。",L"ファイル読み込みエラー",NULL); | |
96 | + return 1; | |
97 | + } | |
98 | + else | |
99 | + { | |
100 | + _tmakepath_s( szPathFile, _MAX_PATH, szDrive, szDir, szFileExt, L".txt" ); | |
101 | + Buff = TenjiTexter(szOpenFile,szPathFile); | |
102 | + Notepad(szPathFile); | |
103 | + } | |
104 | + | |
105 | + return (int) msg.wParam; | |
106 | +} | |
107 | + | |
108 | +// | |
109 | +// 関数: MyRegisterClass() | |
110 | +// | |
111 | +// 目的: ウィンドウ クラスを登録します。 | |
112 | +// | |
113 | +// コメント: | |
114 | +// | |
115 | +// この関数および使い方は、'RegisterClassEx' 関数が追加された | |
116 | +// Windows 95 より前の Win32 システムと互換させる場合にのみ必要です。 | |
117 | +// アプリケーションが、関連付けられた | |
118 | +// 正しい形式の小さいアイコンを取得できるようにするには、 | |
119 | +// この関数を呼び出してください。 | |
120 | +// | |
121 | +ATOM MyRegisterClass(HINSTANCE hInstance) | |
122 | +{ | |
123 | + WNDCLASSEX wcex; | |
124 | + | |
125 | + wcex.cbSize = sizeof(WNDCLASSEX); | |
126 | + | |
127 | + wcex.style = CS_HREDRAW | CS_VREDRAW; | |
128 | + wcex.lpfnWndProc = WndProc; | |
129 | + wcex.cbClsExtra = 0; | |
130 | + wcex.cbWndExtra = 0; | |
131 | + wcex.hInstance = hInstance; | |
132 | + wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TENJITEXTER)); | |
133 | + wcex.hCursor = LoadCursor(NULL, IDC_ARROW); | |
134 | + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); | |
135 | + wcex.lpszMenuName = MAKEINTRESOURCE(IDC_TENJITEXTER); | |
136 | + wcex.lpszClassName = szWindowClass; | |
137 | + wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); | |
138 | + | |
139 | + return RegisterClassEx(&wcex); | |
140 | +} | |
141 | + | |
142 | +// | |
143 | +// 関数: InitInstance(HINSTANCE, int) | |
144 | +// | |
145 | +// 目的: インスタンス ハンドルを保存して、メイン ウィンドウを作成します。 | |
146 | +// | |
147 | +// コメント: | |
148 | +// | |
149 | +// この関数で、グローバル変数でインスタンス ハンドルを保存し、 | |
150 | +// メイン プログラム ウィンドウを作成および表示します。 | |
151 | +// | |
152 | +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) | |
153 | +{ | |
154 | + HWND hWnd; | |
155 | + | |
156 | + hInst = hInstance; // グローバル変数にインスタンス処理を格納します。 | |
157 | + | |
158 | + hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, | |
159 | + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); | |
160 | + | |
161 | + if (!hWnd) | |
162 | + { | |
163 | + return FALSE; | |
164 | + } | |
165 | + | |
166 | + ShowWindow(hWnd, nCmdShow); | |
167 | + UpdateWindow(hWnd); | |
168 | + | |
169 | + return TRUE; | |
170 | +} | |
171 | + | |
172 | +// | |
173 | +// 関数: WndProc(HWND, UINT, WPARAM, LPARAM) | |
174 | +// | |
175 | +// 目的: メイン ウィンドウのメッセージを処理します。 | |
176 | +// | |
177 | +// WM_COMMAND - アプリケーション メニューの処理 | |
178 | +// WM_PAINT - メイン ウィンドウの描画 | |
179 | +// WM_DESTROY - 中止メッセージを表示して戻る | |
180 | +// | |
181 | +// | |
182 | +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) | |
183 | +{ | |
184 | + int wmId, wmEvent; | |
185 | + PAINTSTRUCT ps; | |
186 | + HDC hdc; | |
187 | + | |
188 | + switch (message) | |
189 | + { | |
190 | + case WM_COMMAND: | |
191 | + wmId = LOWORD(wParam); | |
192 | + wmEvent = HIWORD(wParam); | |
193 | + // 選択されたメニューの解析: | |
194 | + switch (wmId) | |
195 | + { | |
196 | + case IDM_ABOUT: | |
197 | + DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); | |
198 | + break; | |
199 | + case IDM_EXIT: | |
200 | + DestroyWindow(hWnd); | |
201 | + break; | |
202 | + default: | |
203 | + return DefWindowProc(hWnd, message, wParam, lParam); | |
204 | + } | |
205 | + break; | |
206 | + case WM_PAINT: | |
207 | + hdc = BeginPaint(hWnd, &ps); | |
208 | + // TODO: 描画コードをここに追加してください... | |
209 | + EndPaint(hWnd, &ps); | |
210 | + break; | |
211 | + case WM_DESTROY: | |
212 | + PostQuitMessage(0); | |
213 | + break; | |
214 | + default: | |
215 | + return DefWindowProc(hWnd, message, wParam, lParam); | |
216 | + } | |
217 | + return 0; | |
218 | +} | |
219 | + | |
220 | +// バージョン情報ボックスのメッセージ ハンドラです。 | |
221 | +INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) | |
222 | +{ | |
223 | + UNREFERENCED_PARAMETER(lParam); | |
224 | + switch (message) | |
225 | + { | |
226 | + case WM_INITDIALOG: | |
227 | + return (INT_PTR)TRUE; | |
228 | + | |
229 | + case WM_COMMAND: | |
230 | + if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) | |
231 | + { | |
232 | + EndDialog(hDlg, LOWORD(wParam)); | |
233 | + return (INT_PTR)TRUE; | |
234 | + } | |
235 | + break; | |
236 | + } | |
237 | + return (INT_PTR)FALSE; | |
238 | +} |
@@ -0,0 +1,24 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +// 以下のマクロは、最低限必要なプラットフォームを定義します。最低限必要なプラットフォームとは、 | |
4 | +// アプリケーションを実行するために必要な機能を備えた最も古いバージョンの Windows や Internet Explorer など | |
5 | +// をいいます。これらのマクロは、指定したバージョンと、それ以前のバージョンのプラットフォーム上で利用できるすべての機能を有効にすることによって | |
6 | +// 動作します。 | |
7 | + | |
8 | +// 下で指定された定義の前に対象プラットフォームを指定しなければならない場合、以下の定義を変更してください。 | |
9 | +// 異なるプラットフォームに対応する値に関する最新情報については、MSDN を参照してください。 | |
10 | +#ifndef WINVER // 最低限必要なプラットフォームが Windows Vista であることを指定します。 | |
11 | +#define WINVER 0x0600 // これを Windows の他のバージョン向けに適切な値に変更してください。 | |
12 | +#endif | |
13 | + | |
14 | +#ifndef _WIN32_WINNT // 最低限必要なプラットフォームが Windows Vista であることを指定します。 | |
15 | +#define _WIN32_WINNT 0x0600 // これを Windows の他のバージョン向けに適切な値に変更してください。 | |
16 | +#endif | |
17 | + | |
18 | +#ifndef _WIN32_WINDOWS // 最低限必要なプラットフォームが Windows 98 であることを指定します。 | |
19 | +#define _WIN32_WINDOWS 0x0410 // これを Windows Me またはそれ以降のバージョン向けに適切な値に変更してください。 | |
20 | +#endif | |
21 | + | |
22 | +#ifndef _WIN32_IE // 最低限必要なプラットフォームが Internet Explorer 7.0 であることを指定します。 | |
23 | +#define _WIN32_IE 0x0700 // これを IE の他のバージョン向けに適切な値に変更してください。 | |
24 | +#endif |
@@ -0,0 +1,3 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#include "resource.h" |
@@ -0,0 +1,153 @@ | ||
1 | +/////////////////////////////////////////////////////////////////////////////// | |
2 | +// インクルード宣言 | |
3 | +#include <iostream> // 入出力ストリーム | |
4 | +#include <fstream> // ファイルストリーム | |
5 | +#include <string> // 文字列 | |
6 | +#include <locale> // ロケール | |
7 | +#include <vector> // 動的配列 | |
8 | +#include <functional> // | |
9 | +#include <algorithm> // | |
10 | +#include <sstream> // 文字列ストリーム | |
11 | + | |
12 | +using namespace std; | |
13 | + | |
14 | +#include "English_Table.h" // 英文変換テーブル | |
15 | +#include "Info_Table.h" // 情報変換テーブル | |
16 | +#include "Japanese_Table.h" // 日本語変換テーブル | |
17 | + | |
18 | +/////////////////////////////////////////////////////////////////////////////// | |
19 | +// 点字変換クラスライブラリ | |
20 | +class CBraille | |
21 | +{ | |
22 | +public: | |
23 | + | |
24 | + // コンストラクタ | |
25 | + CBraille(wstring m_FileName); | |
26 | + | |
27 | + // デストラクタ | |
28 | + virtual ~CBraille(void); | |
29 | + | |
30 | + // メンバー関数 | |
31 | + wstring braille_code(void); // | |
32 | + wstring braille_code_r(void); // | |
33 | + | |
34 | + wstring winbes_code(void); // | |
35 | + wstring winbes_code_r(void); // | |
36 | + | |
37 | + wstring katakana_code(void); // | |
38 | + wstring katakana_to_hiragana(wstring katakana); | |
39 | + wstring hiragana_to_katakana(wstring hiragana); | |
40 | + wstring a_to_A(wstring al); | |
41 | + wstring A_to_a(wstring Al); | |
42 | + | |
43 | + string narrow(const wstring &src); // | |
44 | + wstring widen(const string &src); // | |
45 | + | |
46 | + | |
47 | + wstring ReadFile(wstring p_LoadFileName); // | |
48 | + void SaveFile(wstring p_SaveFileName); // | |
49 | + | |
50 | + wstring katakana_conv(void); // | |
51 | + wstring numeric_conv(unsigned &pos); // | |
52 | + wstring numeric2_conv(unsigned &pos); // | |
53 | + wstring roma_conv(unsigned &pos); // | |
54 | + wstring info_conv(unsigned &pos); // | |
55 | + wstring eng_conv(unsigned &pos,wstring s_c); // | |
56 | + wstring eng_conv2(unsigned &pos,wstring s_c); // | |
57 | + | |
58 | + wstring Cxx(wstring cbuff); // | |
59 | + wstring Cxx2(wstring cbuff); | |
60 | + wstring Cxx3(wstring cbuff); | |
61 | + | |
62 | + | |
63 | + | |
64 | + static bool is_eqals(const wstring& left,const wstring& right); | |
65 | + static bool is_sizes(const wstring& left,const wstring& right); | |
66 | + | |
67 | + // メンバー変数 | |
68 | + vector<wstring> m_Buff; | |
69 | + | |
70 | + wstring m_Data; | |
71 | + wstring m_Separator; | |
72 | + wstring m_Katakana; | |
73 | + | |
74 | + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
75 | + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
76 | + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
77 | + | |
78 | + | |
79 | + /////////////////////////////////////////////////////////////////////////// | |
80 | + // 配列サイズを取得する | |
81 | + // 引き数:配列 | |
82 | + // 戻り値:配列要素数を戻す | |
83 | + /////////////////////////////////////////////////////////////////////////// | |
84 | + template<size_t N> unsigned size( | |
85 | + const wstring (&m_a)[N] | |
86 | + ) | |
87 | + { | |
88 | + return (unsigned) N; | |
89 | + }; | |
90 | + | |
91 | + /////////////////////////////////////////////////////////////////////////// | |
92 | + // 点字コードに一致するレコードを取り出す | |
93 | + // 引き数1:検索対象配列 | |
94 | + // 引き数2:点字コード | |
95 | + // 引き数3:点字コードの検索桁 | |
96 | + // | |
97 | + // 戻り値:抽出結果 | |
98 | + /////////////////////////////////////////////////////////////////////////// | |
99 | + template<size_t N> wstring fined( | |
100 | + const wstring (&m_a)[N], | |
101 | + wchar_t m_b, | |
102 | + unsigned pos | |
103 | + ) | |
104 | + { | |
105 | + wstring m_Ret =L"─"; | |
106 | + for(unsigned k=0;k<N;k+=2) | |
107 | + { | |
108 | + if(m_b==m_a[k+1].at(m_a[k+1].length()-1)) | |
109 | + { | |
110 | + if(pos==m_a[k+1].length()) | |
111 | + { | |
112 | + m_Ret=m_a[k]; | |
113 | + break; | |
114 | + } | |
115 | + } | |
116 | + } | |
117 | + return m_Ret; | |
118 | + }; | |
119 | + | |
120 | + /////////////////////////////////////////////////////////////////////////// | |
121 | + // 点字コードに一致するレコードを取り出す | |
122 | + // 引き数1: 検索対象配列 | |
123 | + // 引き数2: 点字文字列 | |
124 | + // 戻り値: 抽出結果 | |
125 | + /////////////////////////////////////////////////////////////////////////// | |
126 | + template<size_t N> wstring finedS( | |
127 | + const wstring (&m_a)[N], | |
128 | + wstring m_b | |
129 | + ) | |
130 | + { | |
131 | + wstring m_Ret =L"─"; | |
132 | + for(unsigned k=0;k<N;k+=2) | |
133 | + { | |
134 | + if(m_b.compare(m_a[k+1])==0) | |
135 | + { | |
136 | + if(m_b.length()==m_a[k+1].length()) | |
137 | + { | |
138 | + m_Ret=m_a[k]; | |
139 | + break; | |
140 | + } | |
141 | + } | |
142 | + } | |
143 | + return m_Ret; | |
144 | + }; | |
145 | + | |
146 | + | |
147 | + | |
148 | + | |
149 | + | |
150 | + | |
151 | + | |
152 | +}; | |
153 | + |
@@ -0,0 +1,385 @@ | ||
1 | +/////////////////////////////////////////////////////////////////////////////// | |
2 | +// ノーマルモード | |
3 | +static std::wstring j01[] = { | |
4 | + L"ア", L"⠁", // ! | |
5 | + L"イ", L"⠃", // # | |
6 | + L"ウ", L"⠉", // ) | |
7 | + L"エ", L"⠋", // + | |
8 | + L"オ", L"⠊", // * | |
9 | + L"カ", L"⠡", // A | |
10 | + L"キ", L"⠣", // C | |
11 | + L"ク", L"⠩", // I | |
12 | + L"ケ", L"⠫", // K | |
13 | + L"コ", L"⠪", // J | |
14 | + L"サ", L"⠱", // Q | |
15 | + L"シ", L"⠳", // S | |
16 | + L"ス", L"⠹", // Y | |
17 | + L"セ", L"⠻", // [ | |
18 | + L"ソ", L"⠺", // Z | |
19 | + L"タ", L"⠕", // 5 | |
20 | + L"チ", L"⠗", // 7 | |
21 | + L"ツ", L"⠝", // = | |
22 | + L"テ", L"⠟", // ? | |
23 | + L"ト", L"⠞", // > | |
24 | + L"ナ", L"⠅", // % | |
25 | + L"ニ", L"⠇", // ' | |
26 | + L"ヌ", L"⠍", // - | |
27 | + L"ネ", L"⠏", // / | |
28 | + L"ノ", L"⠎", // . | |
29 | + L"ハ", L"⠥", // E | |
30 | + L"ヒ", L"⠧", // G | |
31 | + L"フ", L"⠭", // M | |
32 | + L"ヘ", L"⠯", // O | |
33 | + L"ホ", L"⠮", // N | |
34 | + L"マ", L"⠵", // U | |
35 | + L"ミ", L"⠷", // W | |
36 | + L"ム", L"⠽", // ] | |
37 | + L"メ", L"⠿", // _ | |
38 | + L"モ", L"⠾", // ^ | |
39 | + L"ヤ", L"⠌", // , | |
40 | + L"ユ", L"⠬", // L | |
41 | + L"ヨ", L"⠜", // < | |
42 | + L"ラ", L"⠑", // 1 | |
43 | + L"リ", L"⠓", // 3 | |
44 | + L"ル", L"⠙", // 9 | |
45 | + L"レ", L"⠛", // ; | |
46 | + L"ロ", L"⠚", // : | |
47 | + L"ワ", L"⠄", // $ | |
48 | + L"", L"⠆", // & //@@@@@@@@???? | |
49 | +// L"ヰ", L"⠆", // & | |
50 | + L"!", L"⠖", // 6 L"ヱ"? | |
51 | + L"ヲ", L"⠔", // 4 | |
52 | + L"ン", L"⠴", // T | |
53 | + L"ー", L"⠒", // 2 | |
54 | + L"、", L"⠰", // P | |
55 | + L"。", L"⠲", // R | |
56 | + L"|", L"⠶", // V | |
57 | + L"ッ", L"⠂", // " | |
58 | + L"_", L"⠤", // D | |
59 | + L"!", L"⠢", // B ? ! | |
60 | + L" ", L"⠀", // <SPACE> | |
61 | + | |
62 | + L"\r", L"\r", // \r | |
63 | + L"\n", L"\n" // \n | |
64 | + | |
65 | +}; | |
66 | + | |
67 | +/////////////////////////////////////////////////////////////////////////////// | |
68 | +// 濁点モード(ッを前置) | |
69 | +static std::wstring j02[]={ | |
70 | + L"ヴ", L"⠐⠉", // ) | |
71 | + L"ガ", L"⠐⠡", // A | |
72 | + L"ギ", L"⠐⠣", // C | |
73 | + L"グ", L"⠐⠩", // I | |
74 | + L"ゲ", L"⠐⠫", // K | |
75 | + L"ゴ", L"⠐⠪", // J | |
76 | + L"ザ", L"⠐⠱", // Q | |
77 | + L"ジ", L"⠐⠳", // S | |
78 | + L"ズ", L"⠐⠹", // Y | |
79 | + L"ゼ", L"⠐⠻", // [ | |
80 | + L"ゾ", L"⠐⠺", // Z | |
81 | + L"ダ", L"⠐⠕", // 5 | |
82 | + L"ヂ", L"⠐⠗", // 7 | |
83 | + L"ヅ", L"⠐⠝", // = | |
84 | + L"デ", L"⠐⠟", // ? | |
85 | + L"ド", L"⠐⠞", // > | |
86 | + L"バ", L"⠐⠥", // E | |
87 | + L"ビ", L"⠐⠧", // G | |
88 | + L"ブ", L"⠐⠭", // M | |
89 | + L"ベ", L"⠐⠯", // O | |
90 | + L"ボ", L"⠐⠮", // N | |
91 | + L"○", L"⠐⠵", // U | |
92 | + L"×", L"⠐⠿", // _ | |
93 | + L"【", L"⠐⠤", // D ?[.] | |
94 | + L"・", L"⠐⠀" // <SPCAE> ?[.] | |
95 | + | |
96 | + /* | |
97 | + L"\r", L"⠐\r", // \r | |
98 | + L"\n", L"⠐\n" // \n | |
99 | + */ | |
100 | +}; | |
101 | +/////////////////////////////////////////////////////////////////////////////// | |
102 | +// 半濁点モード | |
103 | +static std::wstring j03[]={ | |
104 | + L"パ", L"⠠⠥", // E | |
105 | + L"ピ", L"⠠⠧", // G | |
106 | + L"プ", L"⠠⠭", // M | |
107 | + L"ペ", L"⠠⠯", // O | |
108 | + L"ポ", L"⠠⠮" // N | |
109 | + | |
110 | +// L" ", L"⠠⠀", // <SPCAE> | |
111 | + /* | |
112 | + L"\r", L"⠠\r", // \r | |
113 | + L"\n", L"⠠\n" // \n | |
114 | + */ | |
115 | +}; | |
116 | +/////////////////////////////////////////////////////////////////////////////// | |
117 | +// 拗音モード | |
118 | +static std::wstring j04[]={ | |
119 | + L"イェ", L"⠈⠋", // + | |
120 | + L"キャ", L"⠈⠡", // A | |
121 | + L"キュ", L"⠈⠩", // I | |
122 | + L"キェ", L"⠈⠫", // K | |
123 | + L"キョ", L"⠈⠪", // J | |
124 | + L"シャ", L"⠈⠱", // Q | |
125 | + L"スィ", L"⠈⠳", // S | |
126 | + L"シュ", L"⠈⠹", // Y | |
127 | + L"シェ", L"⠈⠻", // [ | |
128 | + L"ショ", L"⠈⠺", // Z | |
129 | + L"チャ", L"⠈⠕", // 5 | |
130 | + L"ティ", L"⠈⠗", // 7 | |
131 | + L"チュ", L"⠈⠝", // = | |
132 | + L"チェ", L"⠈⠟", // ? | |
133 | + L"チョ", L"⠈⠞", // > | |
134 | + L"ニャ", L"⠈⠅", // % | |
135 | + L"ニュ", L"⠈⠍", // - | |
136 | + L"ニェ", L"⠈⠏", // / | |
137 | + L"ニョ", L"⠈⠎", // . | |
138 | + L"ヒャ", L"⠈⠥", // E | |
139 | + L"ヒュ", L"⠈⠭", // M | |
140 | + L"ヒェ", L"⠈⠯", // O | |
141 | + L"ヒョ", L"⠈⠮", // N | |
142 | + L"ミャ", L"⠈⠵", // U | |
143 | + L"ミュ", L"⠈⠽", // ] | |
144 | + L"ミェ", L"⠈⠿", // _ | |
145 | + L"ミョ", L"⠈⠾", // ^ | |
146 | + L"リャ", L"⠈⠑", // 1 | |
147 | + L"リュ", L"⠈⠙", // 9 | |
148 | + L"リェ", L"⠈⠛", // ; | |
149 | + L"リョ", L"⠈⠚" // : | |
150 | + | |
151 | +// L" ", L"⠈⠀", // <SPACE> | |
152 | + | |
153 | + /* | |
154 | + L"\r", L"⠈\r", // \r | |
155 | + L"\n", L"⠈\n" // \n | |
156 | + */ | |
157 | +}; | |
158 | +/////////////////////////////////////////////////////////////////////////////// | |
159 | +// 濁拗音モード | |
160 | +static std::wstring j05[]={ | |
161 | + L"ギャ", L"⠘⠡", // A | |
162 | + L"ギュ", L"⠘⠩", // I | |
163 | + L"ギェ", L"⠘⠫", // K | |
164 | + L"ギョ", L"⠘⠪", // J | |
165 | + L"ジャ", L"⠘⠱", // Q | |
166 | + L"ズィ", L"⠘⠳", // S | |
167 | + L"ジュ", L"⠘⠹", // Y | |
168 | + L"ジェ", L"⠘⠻", // [ | |
169 | + L"ジョ", L"⠘⠺", // Z | |
170 | + L"ヂャ", L"⠘⠕", // 5 | |
171 | + L"ディ", L"⠘⠗", // 7 | |
172 | + L"ヂュ", L"⠘⠝", // = | |
173 | + L"ヂェ", L"⠘⠟", // ? | |
174 | + L"ヂョ", L"⠘⠞", // > | |
175 | + L"ビャ", L"⠘⠥", // E | |
176 | + L"ビュ", L"⠘⠭", // M | |
177 | + L"ビェ", L"⠘⠯", // O | |
178 | + L"ビョ", L"⠘⠮" // N | |
179 | + /* | |
180 | + L"\r", L"⠘\r", // \r | |
181 | + L"\n", L"⠘\n" // \n | |
182 | + */ | |
183 | +}; | |
184 | +/////////////////////////////////////////////////////////////////////////////// | |
185 | +// 半濁拗音モード | |
186 | +static std::wstring j06[]={ | |
187 | + L"テュ", L"⠨⠝", // = | |
188 | + L"ピャ", L"⠨⠥", // E | |
189 | + L"ピュ", L"⠨⠭", // M | |
190 | + L"ピョ", L"⠨⠮", // N | |
191 | + L"フュ", L"⠨⠬", // L | |
192 | + L"フョ", L"⠨⠜" // < | |
193 | + | |
194 | + /* | |
195 | + L"\r", L"⠨\r", // \r | |
196 | + L"\n", L"⠨\n" // \n | |
197 | + */ | |
198 | +}; | |
199 | +/////////////////////////////////////////////////////////////////////////////// | |
200 | +// その他1 | |
201 | +static std::wstring j07[]={ | |
202 | + L"デュ", L"⠸⠝", // = | |
203 | + L"ヴュ", L"⠸⠬", // L | |
204 | + L"ヴョ", L"⠸⠜" // < | |
205 | + | |
206 | +// L" ", L"⠸⠀", // < | |
207 | + | |
208 | + /* | |
209 | + L"\r", L"⠸\r", // \r | |
210 | + L"\n", L"⠸\n" // \n | |
211 | + */ | |
212 | +}; | |
213 | +/////////////////////////////////////////////////////////////////////////////// | |
214 | +// 合拗音(疑問符を前置) | |
215 | +static std::wstring j08[]={ | |
216 | + L"ウァ", L"⠢⠁", // ! | |
217 | + L"ウィ", L"⠢⠃", // # | |
218 | + L"ウェ", L"⠢⠋", // + | |
219 | + L"ウォ", L"⠢⠊", // * | |
220 | + L"クァ", L"⠢⠡", // A | |
221 | + L"クィ", L"⠢⠣", // C | |
222 | + L"クェ", L"⠢⠫", // K | |
223 | + L"クォ", L"⠢⠪", // J | |
224 | + L"ツァ", L"⠢⠕", // 5 | |
225 | + L"ツィ", L"⠢⠗", // 7 | |
226 | + L"トゥ", L"⠢⠝", // = | |
227 | + L"ツェ", L"⠢⠟", // ? | |
228 | + L"ツォ", L"⠢⠞", // > | |
229 | + L"ファ", L"⠢⠥", // E | |
230 | + L"フィ", L"⠢⠧", // G | |
231 | + L"フェ", L"⠢⠯", // O | |
232 | + L"フォ", L"⠢⠮" // N | |
233 | + | |
234 | + /* | |
235 | + L"?|", L"⠢⠆", // D // 注意 | |
236 | + L"?_", L"⠢⠤", // D // 注意 | |
237 | + L"? ", L"⠢⠀", // <SPCAE> | |
238 | + L"?\r", L"⠢\r",// \r | |
239 | + L"?\n", L"⠢\n" // \n | |
240 | + */ | |
241 | + | |
242 | +}; | |
243 | +/////////////////////////////////////////////////////////////////////////////// | |
244 | +// 合濁拗音(句読点を前置) | |
245 | +static std::wstring j09[]={ | |
246 | + L"グァ", L"⠲⠡", // A | |
247 | + L"グィ", L"⠲⠣", // C | |
248 | + L"グェ", L"⠲⠫", // K | |
249 | + L"グォ", L"⠲⠪", // J | |
250 | + L"ヅァ", L"⠲⠕", // 5 | |
251 | + L"ヅィ", L"⠲⠗", // 7 | |
252 | + L"ドゥ", L"⠲⠝", // = | |
253 | + L"ヅェ", L"⠲⠟", // ? | |
254 | + L"ヅォ", L"⠲⠞", // > | |
255 | + L"ヴァ", L"⠲⠥", // E | |
256 | + L"ヴィ", L"⠲⠧", // G | |
257 | + L"ヴェ", L"⠲⠯", // O | |
258 | + L"ヴォ", L"⠲⠮" // N | |
259 | + /* | |
260 | + L"。_", L"⠲⠤", // D | |
261 | + | |
262 | + L"。", L"⠲⠀", // <SPACE> | |
263 | + L"。\r", L"⠲\r", // \r | |
264 | + L"。\n", L"⠲\n" // \n | |
265 | + */ | |
266 | + | |
267 | +}; | |
268 | +/////////////////////////////////////////////////////////////////////////////// | |
269 | +// 数字(数符により遷移する) | |
270 | +static std::wstring j10[]={ | |
271 | + L"1", L"⠁", // ! | |
272 | + L"2", L"⠃", // # | |
273 | + L"3", L"⠉", // ) | |
274 | + L"6", L"⠋", // + | |
275 | + L"9", L"⠊", // * | |
276 | + L"5", L"⠑", // 1 | |
277 | + L"8", L"⠓", // 3 | |
278 | + L"4", L"⠙", // 9 | |
279 | + L"7", L"⠛", // ; | |
280 | + L"0", L"⠚", // : | |
281 | +// L"二", L"⠆", // & | |
282 | +// L"三", L"⠒", // 2 | |
283 | +// L"四", L"⠲", // R | |
284 | + L".", L"⠂", // " | |
285 | + | |
286 | +// L"\r", L"\r", // \r | |
287 | +// L"\n", L"\n", // \n | |
288 | + L"、", L"⠼", // | |
289 | + L" ", L"⠀" // <SPACE> | |
290 | + | |
291 | +}; | |
292 | +/////////////////////////////////////////////////////////////////////////////// | |
293 | +// ローマ字大(外字符により遷移する) | |
294 | +static std::wstring j11[]={ | |
295 | + L"A", L"⠁", // | |
296 | + L"B", L"⠃", // | |
297 | + L"C", L"⠉", // | |
298 | + L"D", L"⠙", // | |
299 | + L"E", L"⠑", // | |
300 | + L"F", L"⠋", // | |
301 | + L"G", L"⠛", // | |
302 | + L"H", L"⠓", // | |
303 | + L"I", L"⠊", // | |
304 | + L"J", L"⠚", // | |
305 | + L"K", L"⠅", // | |
306 | + L"L", L"⠇", // | |
307 | + L"M", L"⠍", // | |
308 | + L"N", L"⠝", // | |
309 | + L"O", L"⠕", // | |
310 | + L"P", L"⠏", // | |
311 | + L"Q", L"⠟", // | |
312 | + L"R", L"⠗", // | |
313 | + L"S", L"⠎", // | |
314 | + L"T", L"⠞", // | |
315 | + L"U", L"⠥", // | |
316 | + L"V", L"⠧", // | |
317 | + L"W", L"⠺", // | |
318 | + L"X", L"⠭", // | |
319 | + L"Y", L"⠽", // | |
320 | + L"Z", L"⠵", // | |
321 | + | |
322 | + L"\r", L"\r", // \r | |
323 | + L"\n", L"\n", // \n | |
324 | + L"", L"⠰" // 外字符 | |
325 | + | |
326 | +}; | |
327 | +/////////////////////////////////////////////////////////////////////////////// | |
328 | +// ローマ字小(外字符により遷移する) | |
329 | +static std::wstring j12[]={ | |
330 | + L"a", L"⠁", // | |
331 | + L"b", L"⠃", // | |
332 | + L"c", L"⠉", // | |
333 | + L"d", L"⠙", // | |
334 | + L"e", L"⠑", // | |
335 | + L"f", L"⠋", // | |
336 | + L"g", L"⠛", // | |
337 | + L"h", L"⠓", // | |
338 | + L"i", L"⠊", // | |
339 | + L"j", L"⠚", // | |
340 | + L"k", L"⠅", // | |
341 | + L"l", L"⠇", // | |
342 | + L"m", L"⠍", // | |
343 | + L"n", L"⠝", // | |
344 | + L"o", L"⠕", // | |
345 | + L"p", L"⠏", // | |
346 | + L"q", L"⠟", // | |
347 | + L"r", L"⠗", // | |
348 | + L"s", L"⠎", // | |
349 | + L"t", L"⠞", // | |
350 | + L"u", L"⠥", // | |
351 | + L"v", L"⠧", // | |
352 | + L"w", L"⠺", // | |
353 | + L"x", L"⠭", // | |
354 | + L"y", L"⠽", // | |
355 | + L"z", L"⠵", // | |
356 | + | |
357 | + L"\r", L"\r", // \r | |
358 | + L"\n", L"\n", // \n | |
359 | + L"", L"⠰" // 外字符 | |
360 | + | |
361 | +}; | |
362 | + | |
363 | + | |
364 | + | |
365 | + | |
366 | +/* | |
367 | +⠀ ⠐ ⠠ ⠰ | |
368 | +⠁ ⠑ ⠡ ⠱ | |
369 | +⠂ ⠒ ⠢ ⠲ | |
370 | +⠃ ⠓ ⠣ ⠳ | |
371 | +⠄ ⠔ ⠤ ⠴ | |
372 | +⠅ ⠕ ⠥ ⠵ | |
373 | +⠆ ⠖ ⠦ ⠶ | |
374 | +⠇ ⠗ ⠧ ⠷ | |
375 | +⠈ ⠘ ⠨ ⠸ | |
376 | +⠉ ⠙ ⠩ ⠹ | |
377 | +⠊ ⠚ ⠪ ⠺ | |
378 | +⠋ ⠛ ⠫ ⠻ | |
379 | +⠌ ⠜ ⠬ ⠼ | |
380 | +⠍ ⠝ ⠭ ⠽ | |
381 | +⠎ ⠞ ⠮ ⠾ | |
382 | +⠏ ⠟ ⠯ ⠿ | |
383 | + | |
384 | +*/ | |
385 | + |
@@ -0,0 +1,35 @@ | ||
1 | +#include "stdafx.h" | |
2 | +#include "Conv.h" | |
3 | +#include "Braille.h" | |
4 | + | |
5 | +// 点字からテキスト形式に変換 | |
6 | +string TenjiTexter( | |
7 | + wstring p_LoadFileName, | |
8 | + wstring p_SaveFileName | |
9 | +) | |
10 | +{ | |
11 | + // バッファー確保 | |
12 | + string p_Ret; | |
13 | + | |
14 | + // 変換ライブラリインスタンス生成 | |
15 | + CBraille * p_t = new CBraille(p_LoadFileName); | |
16 | + | |
17 | + // 点字データを戻り値に渡す。 | |
18 | + | |
19 | + p_Ret = p_t->narrow(p_t->m_Katakana); | |
20 | + | |
21 | + // テキストデータをファイルに保存する。 | |
22 | + std::fstream file_stream(p_SaveFileName.c_str(),std::ios::out); // ファイルストリームオープン | |
23 | + file_stream.imbue( std::locale( "japanese" ) ); // ファイルストリームのロケール設定 | |
24 | + file_stream << p_Ret; | |
25 | + file_stream.close(); | |
26 | + | |
27 | + // UNICODE点字データをファイルに保存する。 | |
28 | +// p_t->SaveFile(p_SaveFileName); | |
29 | + | |
30 | + // 変換ライブラリインスタンス消滅 | |
31 | + delete p_t ; | |
32 | + | |
33 | + // 戻る | |
34 | + return p_Ret; | |
35 | +} | |
\ No newline at end of file |
@@ -0,0 +1,218 @@ | ||
1 | +#pragma once | |
2 | +/////////////////////////////////////////////////////////////////////////////// | |
3 | +// アルファベット(大文字) | |
4 | +static std::wstring e01[] = { | |
5 | + L"A", L"⠁", // ! | |
6 | + L"B", L"⠃", // # | |
7 | + L"C", L"⠉", // ) | |
8 | + L"D", L"⠙", // 9 | |
9 | + L"E", L"⠑", // 1 | |
10 | + L"F", L"⠋", // + | |
11 | + L"G", L"⠛", // ; | |
12 | + L"H", L"⠓", // 3 | |
13 | + L"I", L"⠊", // * | |
14 | + L"J", L"⠚", // : | |
15 | + L"K", L"⠅", // % | |
16 | + L"L", L"⠇", // ' | |
17 | + L"M", L"⠍", // - | |
18 | + L"N", L"⠝", // = | |
19 | + L"O", L"⠕", // 5 | |
20 | + L"P", L"⠏", // / | |
21 | + L"Q", L"⠟", // ? | |
22 | + L"R", L"⠗", // 7 | |
23 | + L"S", L"⠎", // . | |
24 | + L"T", L"⠞", // > | |
25 | + L"U", L"⠥", // E | |
26 | + L"V", L"⠧", // G | |
27 | + L"W", L"⠺", // Z | |
28 | + L"X", L"⠭", // M | |
29 | + L"Y", L"⠽", // J | |
30 | + L"Z", L"⠵" // U | |
31 | +, L"\r", L"\r", // \r | |
32 | + L"\n", L"\n" // \n | |
33 | + | |
34 | +}; | |
35 | +/////////////////////////////////////////////////////////////////////////////// | |
36 | +// アルファベット(小文字) | |
37 | +static std::wstring e02[] = { | |
38 | + L"a", L"⠁", // ! | |
39 | + L"b", L"⠃", // # | |
40 | + L"c", L"⠉", // ) | |
41 | + L"d", L"⠙", // 9 | |
42 | + L"e", L"⠑", // 1 | |
43 | + L"f", L"⠋", // + | |
44 | + L"g", L"⠛", // ; | |
45 | + L"h", L"⠓", // 3 | |
46 | + L"i", L"⠊", // * | |
47 | + L"j", L"⠚", // : | |
48 | + L"k", L"⠅", // % | |
49 | + L"l", L"⠇", // ' | |
50 | + L"m", L"⠍", // - | |
51 | + L"n", L"⠝", // = | |
52 | + L"o", L"⠕", // 5 | |
53 | + L"p", L"⠏", // / | |
54 | + L"q", L"⠟", // ? | |
55 | + L"r", L"⠗", // 7 | |
56 | + L"s", L"⠎", // . | |
57 | + L"t", L"⠞", // > | |
58 | + L"u", L"⠥", // E | |
59 | + L"v", L"⠧", // G | |
60 | + L"w", L"⠺", // Z | |
61 | + L"x", L"⠭", // M | |
62 | + L"y", L"⠽", // ] | |
63 | + L"z", L"⠵" // U | |
64 | +, L"\r", L"\r", // \r | |
65 | + L"\n", L"\n" // \n | |
66 | +}; | |
67 | +/////////////////////////////////////////////////////////////////////////////// | |
68 | +// 記号 | |
69 | +static std::wstring e03[] = { | |
70 | + L" ", L"⠀" , // <SPACE> | |
71 | + L",", L"⠂", // " | |
72 | + L";", L"⠆", // & | |
73 | + L":", L"⠒", // 2 | |
74 | + L".", L"⠲", // R | |
75 | + L"!", L"⠖", // 6 | |
76 | + L"|", L"⠶", // V //() | |
77 | + L"?", L"⠦", // F | |
78 | + L"*", L"⠔", // 4 | |
79 | +// L"”", L"⠴", // T | |
80 | + L"\'", L"⠄", // $ | |
81 | + L"-", L"⠤" // D | |
82 | +}; | |
83 | +/////////////////////////////////////////////////////////////////////////////// | |
84 | +// アクセント記号 | |
85 | +static std::wstring e04[] = { | |
86 | + L"à", L"⠷", // W | |
87 | + L"â", L"⠡", // A | |
88 | + L"ä/æ", L"⠜", // < | |
89 | + L"ç", L"⠯", // O | |
90 | + L"è", L"⠮", // N | |
91 | + L"é", L"⠿", // _ | |
92 | + L"ê", L"⠣", // C | |
93 | + L"ë", L"⠫", // K | |
94 | + L"ì", L"⠌", // , | |
95 | + L"î", L"⠩", // I | |
96 | + L"ï", L"⠻", // [ | |
97 | + L"ò", L"⠬", // L | |
98 | + L"ô", L"⠹", // Y | |
99 | + L"ö/œ", L"⠪", // J | |
100 | + L"ù", L"⠾", // ^ | |
101 | + L"û", L"⠱", // Q | |
102 | + L"ü", L"⠳" // S | |
103 | +}; | |
104 | +/////////////////////////////////////////////////////////////////////////////// | |
105 | +// 符号 | |
106 | +/////////////////////////////////////////////////////////////////////////////// | |
107 | +static std::wstring e05[] = { | |
108 | + L"文字", L"⠰", // P | |
109 | + L"大文字", L"⠠", // @ | |
110 | + L"数", L"⠼", // ( | |
111 | + L"数見出", L"⠈", // "\" | |
112 | + L"文見", L"⠘", // 8 | |
113 | + L"斜体", L"⠨" // H | |
114 | +}; | |
115 | +/////////////////////////////////////////////////////////////////////////////// | |
116 | +// 縮約形 | |
117 | +/////////////////////////////////////////////////////////////////////////////// | |
118 | +static std::wstring e06[] = { | |
119 | + L"but", L"⠃", // # | |
120 | + L"can", L"⠉", // ) | |
121 | + L"do", L"⠙", // 9 | |
122 | + L"every", L"⠑", // 1 | |
123 | + L"from", L"⠋", // + | |
124 | + L"go", L"⠛", // ; | |
125 | + L"have", L"⠓", // 3 | |
126 | + L"just", L"⠚", // : | |
127 | + L"knowledge", L"⠅", // % | |
128 | + L"like", L"⠇", // ' | |
129 | + L"more", L"⠍", // - | |
130 | + L"not", L"⠝", // = | |
131 | + L"people", L"⠏", // / | |
132 | + L"quite", L"⠟", // ? | |
133 | + L"rather", L"⠗", // 7 | |
134 | + L"so", L"⠎", // . | |
135 | + L"that", L"⠞", // > | |
136 | + L"us", L"⠥", // E | |
137 | + L"very", L"⠧", // G | |
138 | + L"will", L"⠺", // Z | |
139 | + L"it", L"⠭", // M | |
140 | + L"you", L"⠽", // ] | |
141 | + L"as", L"⠵", // U | |
142 | + L"and", L"⠯", // O | |
143 | + L"for", L"⠿", // _ | |
144 | + L"of", L"⠷", // W | |
145 | + L"the", L"⠮", // N | |
146 | + L"with", L"⠾", // ^ | |
147 | + L"child/ch", L"⠡", // A | |
148 | + L"gh", L"⠣", // C | |
149 | + L"shall/sh", L"⠩", // I | |
150 | + L"this/th", L"⠹", // Y | |
151 | + L"which/wh", L"⠱", // Q | |
152 | + L"ed", L"⠫", // K | |
153 | + L"er", L"⠻", // [ | |
154 | + L"out/ou", L"⠳", // S | |
155 | + L"ow", L"⠪", // J | |
156 | + L"bb", L"⠆", // & | |
157 | + L"cc", L"⠒", // 2 | |
158 | + L"dd", L"⠲", // R | |
159 | + L"gg/were", L"⠶", // V | |
160 | + L"en", L"⠢", // B | |
161 | + L"in", L"⠔", // 4 | |
162 | + L"st", L"⠌", // , | |
163 | + L"ing", L"⠬", // L | |
164 | + L"ar", L"⠜" // < | |
165 | +}; | |
166 | +/////////////////////////////////////////////////////////////////////////////// | |
167 | +// 2コマ略字 | |
168 | +/////////////////////////////////////////////////////////////////////////////// | |
169 | +static std::wstring e07[] = { | |
170 | + L"cannot", L"⠸⠉", // | |
171 | + L"day", L"⠐⠙", // | |
172 | + L"ound", L"⠨⠙", // | |
173 | + L"ever", L"⠐⠑", // | |
174 | + L"ance", L"⠨⠑", // | |
175 | + L"ence", L"⠰⠑", // | |
176 | + L"father", L"⠐⠋", // | |
177 | + L"ong", L"⠰⠛", // | |
178 | + L"here", L"⠐⠓", // | |
179 | + L"had", L"⠸⠓", // | |
180 | + L"know", L"⠐⠅", // 0 | |
181 | + L"lord", L"⠐⠇", // 0 | |
182 | + L"ful", L"⠰⠇", // | |
183 | + L"mother", L"⠐⠍", // 0 | |
184 | + L"many", L"⠸⠍", // | |
185 | + L"name", L"⠐⠝", // 0 | |
186 | + L"sion", L"⠨⠝", // | |
187 | + L"tion", L"⠰⠝", // | |
188 | + L"ation", L"⠠⠝", // | |
189 | + L"one", L"⠐⠕", // 0 | |
190 | + L"part", L"⠐⠏", // 0 | |
191 | + L"question", L"⠐⠟", // 0 | |
192 | + L"right", L"⠐⠗", // 0 | |
193 | + L"some", L"⠐⠎", // 0 | |
194 | + L"less", L"⠨⠎", // | |
195 | + L"ness", L"⠰⠎", // | |
196 | + L"spirit", L"⠸⠎", // | |
197 | + L"time", L"⠐⠞", // 0 | |
198 | + L"ount", L"⠨⠞", // | |
199 | + L"ment", L"⠰⠞", // | |
200 | + L"under", L"⠐⠥", // 0 | |
201 | + L"upon", L"⠘⠥", // | |
202 | + L"work", L"⠐⠺", // | |
203 | + L"word", L"⠘⠺", // | |
204 | + L"world", L"⠸⠺", // | |
205 | + L"young", L"⠐⠽", // | |
206 | + L"ity", L"⠰⠽", // | |
207 | + L"ally", L"⠠⠽", // | |
208 | + L"there", L"⠐⠮", // | |
209 | + L"these", L"⠰⠮", // | |
210 | + L"their", L"⠸⠮", // | |
211 | + L"character", L"⠐⠡", // | |
212 | + L"through", L"⠐⠹", // | |
213 | + L"those", L"⠘⠹", // | |
214 | + L"where", L"⠐⠱", // | |
215 | + L"whose", L"⠘⠱", // | |
216 | + L"ought", L"⠐⠳" // | |
217 | +}; | |
218 | + |
@@ -0,0 +1,285 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +// 52(26*2) | |
4 | +static std::wstring i01[] = { | |
5 | + L"A", L"⠁", // | |
6 | + L"B", L"⠃", // | |
7 | + L"C", L"⠉", // | |
8 | + L"D", L"⠙", // | |
9 | + L"E", L"⠑", // | |
10 | + L"F", L"⠋", // | |
11 | + L"G", L"⠛", // | |
12 | + L"H", L"⠓", // | |
13 | + L"I", L"⠊", // | |
14 | + L"J", L"⠚", // | |
15 | + L"K", L"⠅", // | |
16 | + L"L", L"⠇", // | |
17 | + L"M", L"⠍", // | |
18 | + L"N", L"⠝", // | |
19 | + L"O", L"⠕", // | |
20 | + L"P", L"⠏", // | |
21 | + L"Q", L"⠟", // | |
22 | + L"R", L"⠗", // | |
23 | + L"S", L"⠎", // | |
24 | + L"T", L"⠞", // | |
25 | + L"U", L"⠥", // | |
26 | + L"V", L"⠧", // | |
27 | + L"W", L"⠺", // | |
28 | + L"X", L"⠭", // | |
29 | + L"Y", L"⠽", // | |
30 | + L"Z", L"⠵", // | |
31 | + L" ", L"⠀", // <SPACE> | |
32 | + | |
33 | + L"\r", L"\r", // \r | |
34 | + L"\n", L"\n", // \n | |
35 | + | |
36 | + | |
37 | + | |
38 | + | |
39 | + //@@@@@@@@@@@@@@@@@@@@ | |
40 | + L",", L"⠂", // | |
41 | + L".", L"⠲", // | |
42 | + L";", L"⠆", // | |
43 | + L"!", L"⠖", // | |
44 | + L"@", L"⠪", // | |
45 | + L"#", L"⠩", // | |
46 | + L"\\", L"⠫", // | |
47 | + L"$", L"⠹", // | |
48 | + L"%", L"⠻", // | |
49 | + L"&", L"⠯", // | |
50 | + L"*", L"⠡", // | |
51 | + L"|", L"⠳", // | |
52 | + L"+", L"⠬", // | |
53 | + L"-", L"⠤", // | |
54 | + L"/", L"⠌", // | |
55 | + L"\"", L"⠶", // | |
56 | + L"'", L"⠄", // | |
57 | + L"^", L"⠘", // | |
58 | + L"(", L"⠦", // | |
59 | + L")", L"⠴", // | |
60 | + L"{", L"⠣", // | |
61 | + L"}", L"⠜", // | |
62 | + L"[", L"⠷", // | |
63 | + L"]", L"⠾", // | |
64 | + //@@@@@@@@@@@@@@@@@@@@ | |
65 | + | |
66 | + L":", L"⠐⠂", // | |
67 | + L"?", L"⠐⠦", // | |
68 | + L"=", L"⠒⠒", // | |
69 | + L"<", L"⠔⠔", // | |
70 | + L">", L"⠢⠢", // | |
71 | + L"`", L"⠐⠑", // | |
72 | + L"_", L"⠐⠤", // | |
73 | + L"~", L"⠐⠉" // | |
74 | + | |
75 | + | |
76 | +}; | |
77 | + | |
78 | +// 52(26*2) | |
79 | +static std::wstring i02[] = { | |
80 | + L"a", L"⠁", // | |
81 | + L"b", L"⠃", // | |
82 | + L"c", L"⠉", // | |
83 | + L"d", L"⠙", // | |
84 | + L"e", L"⠑", // | |
85 | + L"f", L"⠋", // | |
86 | + L"g", L"⠛", // | |
87 | + L"h", L"⠓", // | |
88 | + L"i", L"⠊", // | |
89 | + L"j", L"⠚", // | |
90 | + L"k", L"⠅", // | |
91 | + L"l", L"⠇", // | |
92 | + L"m", L"⠍", // | |
93 | + L"n", L"⠝", // | |
94 | + L"o", L"⠕", // | |
95 | + L"p", L"⠏", // | |
96 | + L"q", L"⠟", // | |
97 | + L"r", L"⠗", // | |
98 | + L"s", L"⠎", // | |
99 | + L"t", L"⠞", // | |
100 | + L"u", L"⠥", // | |
101 | + L"v", L"⠧", // | |
102 | + L"w", L"⠺", // | |
103 | + L"x", L"⠭", // | |
104 | + L"y", L"⠽", // | |
105 | + L"z", L"⠵", // | |
106 | + L" ", L"⠀", // <SPACE> | |
107 | + | |
108 | + L"", L"\r", // \r | |
109 | + L"", L"\n", // \n | |
110 | + | |
111 | + L"\r\n ", L"\n⠀", // \n | |
112 | + | |
113 | +// L"\r", L"\r", // \r | |
114 | +// L"\n", L"\n", // \n | |
115 | + | |
116 | + //@@@@@@@@@@@@@@@@@@@@ | |
117 | + L",", L"⠂", // | |
118 | + L".", L"⠲", // | |
119 | + L";", L"⠆", // | |
120 | + L"!", L"⠖", // | |
121 | + L"@", L"⠪", // | |
122 | + L"#", L"⠩", // | |
123 | + L"\\", L"⠫", // | |
124 | + L"$", L"⠹", // | |
125 | + L"%", L"⠻", // | |
126 | + L"&", L"⠯", // | |
127 | + L"*", L"⠡", // | |
128 | + L"|", L"⠳", // | |
129 | + L"+", L"⠬", // | |
130 | + L"-", L"⠤", // | |
131 | + L"/", L"⠌", // | |
132 | + L"\"", L"⠶", // | |
133 | + L"'", L"⠄", // | |
134 | + L"^", L"⠘", // | |
135 | + L"(", L"⠦", // | |
136 | + L")", L"⠴", // | |
137 | + L"{", L"⠣", // | |
138 | + L"}", L"⠜", // | |
139 | + L"[", L"⠷", // | |
140 | + L"]", L"⠾", // | |
141 | + //@@@@@@@@@@@@@@@@@@@@ | |
142 | + | |
143 | + L":", L"⠐⠂", // | |
144 | + L"?", L"⠐⠦", // | |
145 | + L"=", L"⠒⠒", // | |
146 | + L"<", L"⠔⠔", // | |
147 | + L">", L"⠢⠢", // | |
148 | + L"`", L"⠐⠑", // | |
149 | + L"_", L"⠐⠤", // | |
150 | + L"~", L"⠐⠉" // | |
151 | + | |
152 | + | |
153 | +}; | |
154 | + | |
155 | +// 22(11*2) | |
156 | +static std::wstring i03[] = { | |
157 | + L"1", L"⠁", // | |
158 | + L"2", L"⠃", // | |
159 | + L"3", L"⠉", // | |
160 | + L"4", L"⠙", // | |
161 | + L"5", L"⠑", // | |
162 | + L"6", L"⠋", // | |
163 | + L"7", L"⠛", // | |
164 | + L"8", L"⠓", // | |
165 | + L"9", L"⠊", // | |
166 | + L"0", L"⠚", // | |
167 | + L".", L"⠂" // " | |
168 | +}; | |
169 | + | |
170 | + | |
171 | + | |
172 | + | |
173 | +// 64(32*2) | |
174 | +static std::wstring i04[] = { | |
175 | + L",", L"⠂", // | |
176 | + L".", L"⠲", // | |
177 | + L":", L"⠐⠂", // | |
178 | + L";", L"⠆", // | |
179 | + L"!", L"⠖", // | |
180 | + L"?", L"⠐⠦", // | |
181 | + L"@", L"⠪", // | |
182 | + L"#", L"⠩", // | |
183 | + L"\\", L"⠫", // | |
184 | + L"$", L"⠹", // | |
185 | + L"%", L"⠻", // | |
186 | + L"&", L"⠯", // | |
187 | + L"*", L"⠡", // | |
188 | + L"|", L"⠳", // | |
189 | + L"+", L"⠬", // | |
190 | + L"-", L"⠤", // | |
191 | + L"/", L"⠌", // | |
192 | + L"=", L"⠒⠒", // | |
193 | + L"<", L"⠔⠔", // | |
194 | + L">", L"⠢⠢", // | |
195 | + L"\"", L"⠶", // | |
196 | + L"'", L"⠄", // | |
197 | + L"^", L"⠘", // | |
198 | + L"`", L"⠐⠑", // | |
199 | + L"_", L"⠐⠤", // | |
200 | + L"~", L"⠐⠉", // | |
201 | + L"(", L"⠦", // | |
202 | + L")", L"⠴", // | |
203 | + L"{", L"⠣", // | |
204 | + L"}", L"⠜", // | |
205 | + L"[", L"⠷", // | |
206 | + L"]", L"⠾" // | |
207 | +}; | |
208 | + | |
209 | +// 96(48*2) | |
210 | +// 114(57*2) 小文字の場合シフト記号前置 | |
211 | +static std::wstring i05[] = { | |
212 | + L"ア", L"⠁", // | |
213 | + L"イ", L"⠃", // | |
214 | + L"ウ", L"⠉", // | |
215 | + L"エ", L"⠋", // | |
216 | + L"オ", L"⠊", // | |
217 | + L"カ", L"⠡ ", // | |
218 | + L"キ", L"⠣", // | |
219 | + L"ク", L"⠩", // | |
220 | + L"ケ", L"⠫", // | |
221 | + L"コ", L"⠪", // | |
222 | + L"サ", L"⠱", // | |
223 | + L"シ", L"⠳", // | |
224 | + L"ス", L"⠹", // | |
225 | + L"セ", L"⠻", // | |
226 | + L"ソ", L"⠺", // | |
227 | + L"タ", L"⠕", // | |
228 | + L"チ", L"⠗", // | |
229 | + L"ツ", L"⠝", // | |
230 | + L"テ", L"⠟", // | |
231 | + L"ト", L"⠞", // | |
232 | + L"ナ", L"⠅", // | |
233 | + L"ニ", L"⠇", // | |
234 | + L"ヌ", L"⠍", // | |
235 | + L"ネ", L"⠏", // | |
236 | + L"ノ", L"⠎", // | |
237 | + L"ハ", L"⠥", // | |
238 | + L"ヒ", L"⠧", // | |
239 | + L"フ", L"⠭", // | |
240 | + L"ヘ", L"⠯", // | |
241 | + L"ホ", L"⠮", // | |
242 | + L"マ", L"⠵", // | |
243 | + L"ミ", L"⠷", // | |
244 | + L"ム", L"⠽", // | |
245 | + L"メ", L"⠿", // | |
246 | + L"モ", L"⠾", // | |
247 | + L"ヤ", L"⠌", // | |
248 | + L"ユ", L"⠬", // | |
249 | + L"ヨ", L"⠜", // | |
250 | + L"ラ", L"⠑", // | |
251 | + L"リ", L"⠓", // | |
252 | + L"ル", L"⠙", // | |
253 | + L"レ", L"⠛", // | |
254 | + L"ロ", L"⠚", // | |
255 | + L"ワ", L"⠄", // | |
256 | + L"ン", L"⠴", // | |
257 | + L"ヲ", L"⠔", // | |
258 | + L"゙", L"⠂", // | |
259 | + L"゚", L"⠆", // | |
260 | + // 小文字 | |
261 | + L"ァ", L"⠘⠁", // | |
262 | + L"ィ", L"⠘⠃", // | |
263 | + L"ゥ", L"⠘⠉", // | |
264 | + L"ェ", L"⠘⠋", // | |
265 | + L"ォ", L"⠘⠊", // | |
266 | + L"ャ", L"⠘⠌", // | |
267 | + L"ュ", L"⠘⠬", // | |
268 | + L"ョ", L"⠘⠜", // | |
269 | + L"ッ", L"⠘⠝" // | |
270 | + | |
271 | + | |
272 | + | |
273 | + | |
274 | +}; | |
275 | + | |
276 | +// 14(7*2) 出力遷移フラグ | |
277 | +static std::wstring i06[] = { | |
278 | + L"<大文字フラグ>", L"⠠", | |
279 | + L"<小文字フラグ>", L"⠰", | |
280 | + L"<数字フラグ>", L"⠼", | |
281 | + L"<仮名フラグ>", L"⠨", | |
282 | + L"<単独大文字符>", L"⠠", | |
283 | + L"<連続大文字符>", L"⠠⠠", | |
284 | + L"<仮名記号遷移符>", L"⠐" | |
285 | +}; | |
\ No newline at end of file |
@@ -0,0 +1,1162 @@ | ||
1 | +/////////////////////////////////////////////////////////////////////////////// | |
2 | +// インクルード宣言 | |
3 | +#include "stdafx.h" // | |
4 | +#include "Braille.h" // 点字変換クラスライブラリ | |
5 | + | |
6 | +/////////////////////////////////////////////////////////////////////////////// | |
7 | +// コンストラクタ | |
8 | +CBraille::CBraille(wstring m_FileName) | |
9 | +{ | |
10 | + /////////////////////////////////////////////////////////////////////////// | |
11 | + // ファイル読み込み | |
12 | + this->m_Data = this->ReadFile(m_FileName); | |
13 | + | |
14 | + /////////////////////////////////////////////////////////////////////////// | |
15 | + // 略語列取得 | |
16 | + for(unsigned i=0;i<this->size(e07);i+=2) | |
17 | + { | |
18 | + if(e07[i+1].length()==2) | |
19 | + { | |
20 | + wstring m_Bf; | |
21 | + m_Bf += e07[i+1].at(0); | |
22 | + m_Buff.push_back(m_Bf); | |
23 | + } | |
24 | + } | |
25 | + //文字昇順ソート | |
26 | + sort(m_Buff.begin(),m_Buff.end()); | |
27 | + vector<wstring>::iterator new_end = | |
28 | + unique(m_Buff.begin(),m_Buff.end(),this->is_eqals); | |
29 | + //重複データを削除する(文字昇順ソート済みであること) | |
30 | + m_Buff.erase(new_end, m_Buff.end()); | |
31 | + //文字数降順ソート | |
32 | + //sort(m_Buff.begin(),m_Buff.end(),this->is_sizes); | |
33 | + | |
34 | + // 文字列の降順ソート | |
35 | + sort(m_Buff.begin(),m_Buff.end(),greater<wstring>()); | |
36 | + | |
37 | + //区切り文字のコード一覧を作る。 | |
38 | + m_Separator = L"⠀⠤\r\n"; | |
39 | + | |
40 | +// m_Katakana = this->katakana_conv(); | |
41 | + | |
42 | + m_Katakana = this->Cxx(this->katakana_conv()); // カタカナ変換 | |
43 | + m_Katakana = this->Cxx2(m_Katakana); // 改行コードを変換 | |
44 | + m_Katakana = this->Cxx3(m_Katakana); // 行頭にスペースを埋め込む | |
45 | + | |
46 | +} | |
47 | +/////////////////////////////////////////////////////////////////////////////// | |
48 | +// デストラクタ | |
49 | +CBraille::~CBraille(void) | |
50 | +{ | |
51 | + | |
52 | +} | |
53 | +/////////////////////////////////////////////////////////////////////////////// | |
54 | +// 点字ベースコード凸面(braille) | |
55 | +// 戻り値:6点字文字コード(0から63のユニコード) | |
56 | +wstring CBraille::braille_code(void) | |
57 | +{ | |
58 | + wstring ret; | |
59 | + for(wchar_t i=(wchar_t)L'⠀';i<=(wchar_t)L'⠿';i++) | |
60 | + ret += i; | |
61 | + return ret; | |
62 | +} | |
63 | + | |
64 | +/////////////////////////////////////////////////////////////////////////////// | |
65 | +// 点字ベースコード凹面(braille) | |
66 | +// 戻り値:6点字文字コード(0から63のユニコード) | |
67 | +wstring CBraille::braille_code_r(void) | |
68 | +{ | |
69 | + wstring ret; | |
70 | + for(wchar_t i=(wchar_t)L'⠿';i>=(wchar_t)L'⠀';i--) | |
71 | + ret += i; | |
72 | + return ret; | |
73 | +} | |
74 | +/////////////////////////////////////////////////////////////////////////////// | |
75 | +// 点字ベースコード凸面(win-bes) | |
76 | +// 戻り値:6点字文字コード(0から63のwin-besコード) | |
77 | +wstring CBraille::winbes_code(void) | |
78 | +{ | |
79 | + wstring ret; | |
80 | + for(wchar_t i=(wchar_t)L' ';i<=(wchar_t)L'_';i++) | |
81 | + ret += i; | |
82 | + return ret; | |
83 | +} | |
84 | +/////////////////////////////////////////////////////////////////////////////// | |
85 | +// 点字ベースコード凹面(win-bes) | |
86 | +// 戻り値:6点字文字コード(0から63のwin-besコード) | |
87 | +wstring CBraille::winbes_code_r(void) | |
88 | +{ | |
89 | + wstring ret; | |
90 | + for(wchar_t i=(wchar_t)L'_';i>=(wchar_t)L' ';i--) | |
91 | + ret += i; | |
92 | + return ret; | |
93 | +} | |
94 | + | |
95 | +/////////////////////////////////////////////////////////////////////////////// | |
96 | +// カタカナ ベースコード | |
97 | +// 戻り値:カタカナ文字コード(ア~ン) | |
98 | +wstring CBraille::katakana_code(void) | |
99 | +{ | |
100 | + wstring ret; | |
101 | + for(wchar_t i=(wchar_t)L'ア';i<=(wchar_t)L'ン';i++) | |
102 | + ret += i; | |
103 | + return ret; | |
104 | +} | |
105 | +////////////////////////////////////////////////////////////////////////////////// | |
106 | +// カタカナからひらがなに変換 | |
107 | +// 引き数:カタカナ | |
108 | +// 戻り値:ひらがな | |
109 | +wstring CBraille::katakana_to_hiragana(wstring katakana) | |
110 | +{ | |
111 | + wchar_t h1 = L'ぁ'; | |
112 | + wchar_t h2 = L'ん'; | |
113 | + wchar_t k1 = L'ァ'; | |
114 | + wchar_t k2 = L'ン'; | |
115 | + wstring ret = L""; | |
116 | + for(unsigned i=0;i<katakana.length() ; i++ ) | |
117 | + if( (katakana[i]<k1)||(katakana[i]>k2) ) | |
118 | + ret += katakana[i]; | |
119 | + else | |
120 | + ret += (katakana[i]+(h1-k1)); | |
121 | + return ret; | |
122 | +} | |
123 | +////////////////////////////////////////////////////////////////////////////////// | |
124 | +// ひらがなからカタカナに変換 | |
125 | +// 引き数:ひらがな | |
126 | +// 戻り値:カタカナ | |
127 | +wstring CBraille::hiragana_to_katakana(wstring hiragana) | |
128 | +{ | |
129 | + wchar_t h1 = L'ぁ'; | |
130 | + wchar_t h2 = L'ん'; | |
131 | + wchar_t k1 = L'ァ'; | |
132 | + wchar_t k2 = L'ン'; | |
133 | + wstring ret = L""; | |
134 | + for(unsigned i=0;i<hiragana.length() ; i++ ) | |
135 | + if( (hiragana[i]<h1)||(hiragana[i]>h2) ) | |
136 | + ret += hiragana[i]; | |
137 | + else | |
138 | + ret += (hiragana[i]+(k1-h1)); | |
139 | + return ret; | |
140 | +} | |
141 | +////////////////////////////////////////////////////////////////////////////////// | |
142 | +// アルファベットの小文字を大文字に変換 | |
143 | +// 引き数:小文字 | |
144 | +// 戻り値:大文字 | |
145 | +wstring CBraille::a_to_A(wstring al) | |
146 | +{ | |
147 | + wchar_t h1 = L'a'; | |
148 | + wchar_t h2 = L'z'; | |
149 | + wchar_t k1 = L'A'; | |
150 | + wchar_t k2 = L'Z'; | |
151 | + wstring ret = L""; | |
152 | + for(unsigned i=0;i<al.length() ; i++ ) | |
153 | + if( (al[i]<h1)||(al[i]>h2) ) | |
154 | + ret += al[i]; | |
155 | + else | |
156 | + ret += (al[i]+(k1-h1)); | |
157 | + return ret; | |
158 | +} | |
159 | +////////////////////////////////////////////////////////////////////////////////// | |
160 | +// アルファベットの大文字を小文字に変換 | |
161 | +// 引き数:小文字 | |
162 | +// 戻り値:大文字 | |
163 | +wstring CBraille::A_to_a(wstring Al) | |
164 | +{ | |
165 | + wchar_t h1 = L'A'; | |
166 | + wchar_t h2 = L'Z'; | |
167 | + wchar_t k1 = L'a'; | |
168 | + wchar_t k2 = L'z'; | |
169 | + wstring ret = L""; | |
170 | + for(unsigned i=0;i<Al.length() ; i++ ) | |
171 | + if( (Al[i]<h1)||(Al[i]>h2) ) | |
172 | + ret += Al[i]; | |
173 | + else | |
174 | + ret += (Al[i]+(k1-h1)); | |
175 | + return ret; | |
176 | +} | |
177 | + | |
178 | +////////////////////////////////////////////////////////// | |
179 | +//ワイド文字列からマルチバイト文字列 | |
180 | +//ロケール依存 | |
181 | +// 実行時時に指定が必要:setlocale(LC_CTYPE, ""); | |
182 | +string CBraille::narrow(const wstring &src) { | |
183 | + string dest = ""; | |
184 | + char *mbs = new char[src.length() * MB_CUR_MAX + 1]; | |
185 | +size_t convertedChars = 0; | |
186 | +wcstombs_s(&convertedChars,mbs, src.length() * MB_CUR_MAX + 1, src.c_str(),_TRUNCATE); | |
187 | +//@@ wcstombs(mbs, src.c_str(), src.length() * MB_CUR_MAX + 1); | |
188 | + dest = mbs; | |
189 | + delete [] mbs; | |
190 | + return dest; | |
191 | +} | |
192 | +////////////////////////////////////////////////////////// | |
193 | +//マルチバイト文字列からワイド文字列 | |
194 | +//ロケール依存 | |
195 | +// 実行時時に指定が必要:setlocale(LC_CTYPE, ""); | |
196 | +wstring CBraille::widen(const string &src) | |
197 | +{ | |
198 | + std::wstring dest=L""; | |
199 | + wchar_t *wcs = new wchar_t[src.length() + 1]; | |
200 | +size_t convertedChars = 0; | |
201 | +mbstowcs_s(&convertedChars,wcs,src.length() + 1,src.c_str(),_TRUNCATE); | |
202 | +//@@ mbstowcs(wcs, src.c_str(), src.length() + 1); | |
203 | + dest = wcs; | |
204 | + delete [] wcs; | |
205 | + return dest; | |
206 | +} | |
207 | +/////////////////////////////////////////////////////////// | |
208 | +// 重複チェック演算子(wstring) | |
209 | +// | |
210 | +bool CBraille::is_eqals(const wstring& left,const wstring& right) | |
211 | +{ | |
212 | + return ((left.compare(right)==0) ); | |
213 | +} | |
214 | +/////////////////////////////////////////////////////////////////////////////// | |
215 | +// 文字サイズ降順チェック演算子(wstring) | |
216 | +// | |
217 | +bool CBraille::is_sizes(const wstring& left,const wstring& right) | |
218 | +{ | |
219 | + return left.size() > right.size(); | |
220 | +} | |
221 | +/////////////////////////////////////////////////////////////////////////////// | |
222 | +// BES、BETファイル読み込み関数 | |
223 | +// 引き数:ファイル名 | |
224 | +// 戻り値:UNICODE点字データ | |
225 | +wstring CBraille::ReadFile(wstring p_LoadFileName) | |
226 | +{ | |
227 | + | |
228 | + /////////////////////////////////////////////////////////////////////////// | |
229 | + // テキストファイルの場合の処理 | |
230 | + if (this->a_to_A(p_LoadFileName).rfind(L".TXT")==wstring::npos) | |
231 | + { | |
232 | + ; | |
233 | + ; | |
234 | + ; | |
235 | + } | |
236 | + /////////////////////////////////////////////////////////////////////////// | |
237 | + // 拡張子チエック | |
238 | + if( | |
239 | + (this->a_to_A(p_LoadFileName).rfind(L".BES")==wstring::npos) && | |
240 | + (this->a_to_A(p_LoadFileName).rfind(L".BET")==wstring::npos) | |
241 | + ) | |
242 | + return L"File Extension Error"; | |
243 | + | |
244 | + /////////////////////////////////////////////////////////////////////////// | |
245 | + // 点字ファイルオープン | |
246 | + ifstream p_FileStream; | |
247 | + p_FileStream.open( | |
248 | + narrow(p_LoadFileName).c_str(), | |
249 | + ios::binary | ios::in | |
250 | + ); | |
251 | + bool p_ISOPEN = p_FileStream.is_open(); | |
252 | + /////////////////////////////////////////////////////////////////////////// | |
253 | + // 点字ファイルオープン | |
254 | + if(!p_ISOPEN) | |
255 | + return L"File Open Error"; | |
256 | + /////////////////////////////////////////////////////////////////////////// | |
257 | + // バッファー宣言 | |
258 | + unsigned char ch = 0x00; | |
259 | + string buff = ""; | |
260 | + /////////////////////////////////////////////////////////////////////////// | |
261 | + // ヘッダー読み込み | |
262 | + while((ch!=0xfd)&&(!p_FileStream.eof())) | |
263 | + { | |
264 | + unsigned int pHederCount=0x00; | |
265 | + p_FileStream >> ch; | |
266 | + if( p_FileStream.fail() ) | |
267 | + return L"File Read Error"; | |
268 | + if(pHederCount++ > 1024) | |
269 | + break; | |
270 | + } | |
271 | + ////////////////////////////////////////////////////////////////////////////// | |
272 | + // 本文読み込み | |
273 | + while(!p_FileStream.eof()) | |
274 | + { | |
275 | + p_FileStream >> ch; | |
276 | + buff+=(char)ch; | |
277 | + if( p_FileStream.fail() ) | |
278 | + break; | |
279 | + } | |
280 | + ////////////////////////////////////////////////////////////////////////////// | |
281 | + // ページサイズコードを点字のスペースコードに置換する。 | |
282 | + for(unsigned i=0;i<buff.length();i++) | |
283 | + { | |
284 | + if((unsigned char)buff[i]==0xfd) | |
285 | + { | |
286 | + buff[i-2]=(unsigned)0xA0; // | |
287 | + buff[i-1]=(unsigned)0xA0; // | |
288 | + } | |
289 | + } | |
290 | + ////////////////////////////////////////////////////////////////////////////// | |
291 | + // UNICODEに変換しバッファーに格納する。 | |
292 | + std::wostringstream wbuff; | |
293 | + for (unsigned i=0;i<buff.length();i++) | |
294 | + { | |
295 | + switch ((unsigned char)buff.at(i)) | |
296 | + { | |
297 | + // 改行コードを変換してバッファーに格納 | |
298 | + case 0xfe: | |
299 | + // wbuff << endl; | |
300 | + wbuff << L"\r\n"; // windows用の改行コード | |
301 | + break; | |
302 | + // ページコードを変換してバッファーに格納 | |
303 | + case 0xfd: | |
304 | + // wbuff << endl; | |
305 | + wbuff << L"\r\n"; // windows用の改行コード | |
306 | + break; | |
307 | + // 点字コードに変換してバッファーに格納 | |
308 | + default: | |
309 | + wbuff << (wchar_t)(buff.at(i)+0x2800+0x80-(unsigned char)L' '); | |
310 | + break; | |
311 | + } | |
312 | + } | |
313 | + | |
314 | + ////////////////////////////////////////////////////////////////////////////// | |
315 | + // UNICODE点字データを返す。 | |
316 | + return wbuff.str(); | |
317 | +} | |
318 | +/////////////////////////////////////////////////////////////////////////////// | |
319 | +// UNICODEテキスト点字形式でファイルに保存する。 | |
320 | +// 引き数:ファイル名 | |
321 | +// 戻り値:なし | |
322 | +void CBraille::SaveFile(wstring p_SaveFileName) | |
323 | +{ | |
324 | + //////////////////////////////////////////////////////////////////////////// | |
325 | + // ファイル出力(ユニコード点字) | |
326 | + // WINDOWS系 | |
327 | + if(p_SaveFileName!=L"") | |
328 | + { | |
329 | + FILE *p_File; | |
330 | + _wfopen_s(&p_File,p_SaveFileName.c_str(),L"wb"); | |
331 | + fwrite(this->m_Data.c_str() , sizeof(wchar_t), this->m_Data.size(), p_File); | |
332 | + fclose(p_File); | |
333 | + } | |
334 | + | |
335 | + //////////////////////////////////////////////////////////////////////////// | |
336 | + // ファイル出力 | |
337 | + // UNIX系 | |
338 | + /* | |
339 | + std::wfstream file_stream(this->narrow(p_SaveFileName).c_str(),std::ios::out); | |
340 | + | |
341 | + file_stream.imbue( std::locale( "ja_JP.UTF-8" ) ); | |
342 | + file_stream << this->m_Data ; | |
343 | + file_stream.close(); | |
344 | + */ | |
345 | +} | |
346 | + | |
347 | +///////////////////////////////////////////////////////////////////////////////// | |
348 | +// ユニコード点字からカタカナに変換する。 | |
349 | +// | |
350 | +wstring CBraille::katakana_conv(void) | |
351 | +{ | |
352 | + wostringstream wbuff; | |
353 | + unsigned pos = 0; | |
354 | + | |
355 | + while(pos<this->m_Data.length()) | |
356 | + { | |
357 | + switch ((wchar_t)m_Data.at(pos)) | |
358 | + { | |
359 | + // 数符がきた場合の処理 | |
360 | + case L'⠼': | |
361 | + wbuff << this->numeric_conv(pos); // 数符処理へ | |
362 | + // wbuff << this->numeric2_conv(pos); // 数符処理へ | |
363 | + break; | |
364 | + // 外字符及び読点がきた場合の処理 | |
365 | + case L'⠰': | |
366 | + if(m_Data.at(pos+1)==L'⠄') | |
367 | + { | |
368 | + wbuff << L"<"; | |
369 | + pos++; | |
370 | + } | |
371 | + else if(this->m_Separator.find_first_of(m_Data.at(pos+1),0)!=wstring::npos) | |
372 | + if(m_Data.at(pos+1)==L'⠤') | |
373 | + { | |
374 | + wbuff << L"『"; | |
375 | + pos++; | |
376 | + } | |
377 | + else | |
378 | + wbuff << this->finedS(j01,m_Data.substr(pos,1)); | |
379 | + else | |
380 | + { | |
381 | + wbuff << this->roma_conv(pos); // 外字符処理へ | |
382 | + } | |
383 | + break; | |
384 | + // 外国語引用符がきた場合の処理 | |
385 | + case L'⠦': | |
386 | + wbuff << this->eng_conv(pos,m_Data.substr(pos-1,1)); // 外国語引用符処理へ | |
387 | + // wbuff << this->eng_conv2(pos,m_Data.substr(pos-1,1)); // 外国語引用符処理へ | |
388 | + break; | |
389 | + // 閉じ括弧がきた場合の処理 | |
390 | + case L'⠤': | |
391 | + if(m_Data.at(pos+1)==L'⠆') | |
392 | + { | |
393 | + wbuff << L"』"; | |
394 | + pos++; | |
395 | + } | |
396 | + else if(m_Data.at(pos+1)==L'⠂') | |
397 | + { | |
398 | + wbuff << L"】"; | |
399 | + // wbuff << L"_"; | |
400 | + pos++; | |
401 | + } | |
402 | + else | |
403 | + wbuff << this->finedS(j01,m_Data.substr(pos,1)); | |
404 | + break; | |
405 | + // 長音の次の不整合の処理 | |
406 | + case L'⠒': | |
407 | + if(m_Data.at(pos+1)==L'⠂') // ッ | |
408 | + { | |
409 | + wbuff << L"ー・"; | |
410 | + pos++; | |
411 | + } | |
412 | + else | |
413 | + wbuff << this->finedS(j01,m_Data.substr(pos,1)); | |
414 | + break; | |
415 | + // 合濁拗音(句読点を前置) | |
416 | + case L'⠲': | |
417 | + if(this->finedS(j09,m_Data.substr(pos,2)).compare(L"─")!=0) | |
418 | + { | |
419 | + wbuff << this->finedS(j09,m_Data.substr(pos,2)); | |
420 | + pos++; | |
421 | + } | |
422 | + else | |
423 | + wbuff << L"。"; | |
424 | + break; | |
425 | + // 合拗音(疑問符を前置) | |
426 | + case L'⠢': | |
427 | + if(this->finedS(j08,m_Data.substr(pos,2)).compare(L"─")!=0) | |
428 | + { | |
429 | + wbuff << this->finedS(j08,m_Data.substr(pos,2)); | |
430 | + pos++; | |
431 | + } | |
432 | + else | |
433 | + wbuff << L"?"; | |
434 | + break; | |
435 | + // その他1 | |
436 | + case L'⠸': | |
437 | + if(this->finedS(j07,m_Data.substr(pos,2)).compare(L"─")!=0) | |
438 | + { | |
439 | + wbuff << this->finedS(j07,m_Data.substr(pos,2)); | |
440 | + pos++; | |
441 | + } | |
442 | + else | |
443 | + ; //wbuff << L"◆その他◆"; | |
444 | + break; | |
445 | + // 半濁拗音モード | |
446 | + case L'⠨': | |
447 | + if(this->finedS(j06,m_Data.substr(pos,2)).compare(L"─")!=0) | |
448 | + { | |
449 | + wbuff << this->finedS(j06,m_Data.substr(pos,2)); | |
450 | + pos++; | |
451 | + } | |
452 | + else | |
453 | + ; //wbuff << L"◆半濁拗音◆"; | |
454 | + break; | |
455 | + // 濁拗音モード | |
456 | + case L'⠘': | |
457 | + if(this->finedS(j05,m_Data.substr(pos,2)).compare(L"─")!=0) | |
458 | + { | |
459 | + wbuff << this->finedS(j05,m_Data.substr(pos,2)); | |
460 | + pos++; | |
461 | + } | |
462 | + else | |
463 | + ; //wbuff << L"◆濁拗音◆"; | |
464 | + break; | |
465 | + // 拗音モード | |
466 | + case L'⠈': | |
467 | + if(this->finedS(j04,m_Data.substr(pos,2)).compare(L"─")!=0) | |
468 | + { | |
469 | + wbuff << this->finedS(j04,m_Data.substr(pos,2)); | |
470 | + pos++; | |
471 | + } | |
472 | + else | |
473 | + ; //wbuff << L"◆拗音◆"; | |
474 | + break; | |
475 | + // 半濁点モード | |
476 | + case L'⠠': | |
477 | + if(m_Data.at(pos+1)==L'⠦') | |
478 | + { | |
479 | + // 情報変換モード; | |
480 | + wbuff << this->info_conv(pos); | |
481 | + } | |
482 | + else if(m_Data.at(pos+1)==L'⠆') | |
483 | + { | |
484 | + wbuff << L">"; | |
485 | + pos++; | |
486 | + } | |
487 | + else if(this->finedS(j03,m_Data.substr(pos,2)).compare(L"─")!=0) | |
488 | + { | |
489 | + wbuff << this->finedS(j03,m_Data.substr(pos,2)); | |
490 | + pos++; | |
491 | + } | |
492 | + else | |
493 | + ; //wbuff << L"◆半濁点◆"; | |
494 | + break; | |
495 | + // 濁点モード(ッを前置) | |
496 | + case L'⠐': | |
497 | + if(this->finedS(j02,m_Data.substr(pos,2)).compare(L"─")!=0) | |
498 | + { | |
499 | + wbuff << this->finedS(j02,m_Data.substr(pos,2)); | |
500 | + pos++; | |
501 | + } | |
502 | + else | |
503 | + wbuff << L"ッ"; | |
504 | + break; | |
505 | + default: | |
506 | + wbuff << this->finedS(j01,m_Data.substr(pos,1)); | |
507 | + break; | |
508 | + } | |
509 | + pos++; | |
510 | + } | |
511 | + return wbuff.str(); | |
512 | +} | |
513 | +/////////////////////////////////////////////////////////////////////////////// | |
514 | +// ユニコード点字から数値に変換する。 | |
515 | +// | |
516 | +wstring CBraille::numeric_conv(unsigned &pos) | |
517 | +{ | |
518 | + wostringstream wbuff; | |
519 | + | |
520 | + pos++; | |
521 | + while(pos<this->m_Data.length()) | |
522 | + { | |
523 | + switch ((wchar_t)m_Data.at(pos)) | |
524 | + { | |
525 | + case L'⠼': | |
526 | + wbuff << L"、"; // スペースを出力 | |
527 | + break; | |
528 | + default: | |
529 | + if(m_Data.substr(pos,1).compare(L"\r")==0) | |
530 | + { | |
531 | + pos++; | |
532 | + wbuff << L"\r\n"; | |
533 | + return wbuff.str(); | |
534 | + } | |
535 | + else if(this->finedS(j10,m_Data.substr(pos,1)).compare(L"─")==0) | |
536 | + { | |
537 | + pos--; | |
538 | + return wbuff.str(); | |
539 | + } | |
540 | + wbuff << this->finedS(j10,m_Data.substr(pos,1)); | |
541 | + break; | |
542 | + } | |
543 | + pos++; | |
544 | + } | |
545 | + return wbuff.str(); | |
546 | +} | |
547 | +/////////////////////////////////////////////////////////////////////////////// | |
548 | +// ユニコード点字から数値に変換する。 | |
549 | +// | |
550 | +wstring CBraille::numeric2_conv(unsigned &pos) | |
551 | +{ | |
552 | + wostringstream wbuff; | |
553 | + bool f_hankaku = false; | |
554 | + | |
555 | +// if(m_Data.substr(pos-1,1).compare(L"⠀")!=0) | |
556 | + f_hankaku = true; | |
557 | + pos++; | |
558 | + | |
559 | + | |
560 | + while(pos<this->m_Data.length()) | |
561 | + { | |
562 | + switch ((wchar_t)m_Data.at(pos)) | |
563 | + { | |
564 | + // 数符がきた場合の処理 | |
565 | + case L'⠼': | |
566 | + if(f_hankaku) | |
567 | + wbuff << L","; // スペースを出力 | |
568 | + else | |
569 | + wbuff << L"、"; // スペースを出力 | |
570 | + break; | |
571 | + default: | |
572 | + if(m_Data.substr(pos,1).compare(L"\r")==0) | |
573 | + { | |
574 | + pos++; | |
575 | + wbuff << L"\r\n"; | |
576 | + return wbuff.str(); | |
577 | + } | |
578 | + else if(this->finedS(i03,m_Data.substr(pos,1)).compare(L"─")==0) | |
579 | + { | |
580 | + pos--; | |
581 | + return wbuff.str(); | |
582 | + } | |
583 | + if(f_hankaku) | |
584 | + wbuff << this->finedS(i03,m_Data.substr(pos,1)); | |
585 | + else | |
586 | + wbuff << this->finedS(j10,m_Data.substr(pos,1)); | |
587 | + | |
588 | + break; | |
589 | + } | |
590 | + pos++; | |
591 | + } | |
592 | + return wbuff.str(); | |
593 | +} | |
594 | + | |
595 | + | |
596 | + | |
597 | +/////////////////////////////////////////////////////////////////////////////// | |
598 | +// ユニコード点字から外字に変換する。 | |
599 | +// | |
600 | +wstring CBraille::roma_conv(unsigned &pos) | |
601 | +{ | |
602 | + wostringstream wbuff; | |
603 | + unsigned f_oomoji=0; | |
604 | + | |
605 | + pos++; | |
606 | + while(pos<this->m_Data.length()) | |
607 | + { | |
608 | + switch ((wchar_t)m_Data.at(pos)) | |
609 | + { | |
610 | + case L'⠠': | |
611 | + if(m_Data.at(pos+1)==L'⠠') | |
612 | + f_oomoji=1; // 大文字連続 | |
613 | + else if (f_oomoji!=1) | |
614 | + f_oomoji=2; // 大文字単独フラグ | |
615 | + break; | |
616 | + default: | |
617 | + if(this->finedS(j11,m_Data.substr(pos,1)).compare(L"─")==0) | |
618 | + { | |
619 | + pos--; | |
620 | + return wbuff.str(); | |
621 | + } | |
622 | + switch (f_oomoji) | |
623 | + { | |
624 | + case 0: | |
625 | + wbuff << this->finedS(j12,m_Data.substr(pos,1)); | |
626 | + break; | |
627 | + case 1: | |
628 | + wbuff << this->finedS(j11,m_Data.substr(pos,1)); | |
629 | + break; | |
630 | + case 2: | |
631 | + wbuff << this->finedS(j11,m_Data.substr(pos,1)); | |
632 | + f_oomoji=0; | |
633 | + break; | |
634 | + } | |
635 | + } | |
636 | + pos++; | |
637 | + } | |
638 | + return wbuff.str(); | |
639 | +} | |
640 | + | |
641 | +/////////////////////////////////////////////////////////////////////////////// | |
642 | +// ユニコード点字から情報点字に変換する。 | |
643 | +// | |
644 | +wstring CBraille::info_conv(unsigned &pos) | |
645 | +{ | |
646 | + wostringstream wbuff; | |
647 | + unsigned f_oomoji=0; | |
648 | + | |
649 | + pos++; // ヘッダーコード分進める。 | |
650 | + | |
651 | + while(pos<this->m_Data.length()) | |
652 | + { | |
653 | + switch ((wchar_t)m_Data.at(pos)) | |
654 | + { | |
655 | + case L'⠠': | |
656 | + if(m_Data.at(pos+1)==L'⠴') | |
657 | + { | |
658 | + pos+=1; | |
659 | + wbuff<< L")"; | |
660 | + return wbuff.str(); | |
661 | + } | |
662 | + else if(m_Data.at(pos+1)==L'⠠') | |
663 | + { | |
664 | + f_oomoji=1; // 大文字連続 | |
665 | + } | |
666 | + else if (f_oomoji!=1) | |
667 | + { | |
668 | + f_oomoji=2; // 大文字単独フラグ | |
669 | + } | |
670 | + else if (m_Data.at(pos+1)==L'⠨') | |
671 | + { | |
672 | + f_oomoji=3; // カナフラグ | |
673 | + } | |
674 | + break; | |
675 | + case L'⠼': | |
676 | + wbuff << this->numeric2_conv(pos); | |
677 | + break; | |
678 | + default: | |
679 | + switch (f_oomoji) | |
680 | + { | |
681 | + // 英数小文字処理 | |
682 | + case 0: | |
683 | + for(unsigned x=pos;x<this->m_Data.length();x++) | |
684 | + { | |
685 | + if(m_Data.substr(x,2).compare(L"⠠⠴")==0) | |
686 | + { | |
687 | + pos = x-1; | |
688 | + break; | |
689 | + } | |
690 | + else if( m_Data.substr(x,1).compare(L"⠼")==0) | |
691 | + { | |
692 | + wbuff << this->numeric2_conv(x); | |
693 | + } | |
694 | + else if(this->finedS(i02,m_Data.substr(x,2)).compare(L"─")!=0) | |
695 | + { | |
696 | + wbuff << this->finedS(i02,m_Data.substr(x,2)); | |
697 | + x++; | |
698 | + } | |
699 | + else if(this->finedS(i02,m_Data.substr(x,1)).compare(L"─")!=0) | |
700 | + wbuff << this->finedS(i02,m_Data.substr(x,1)); | |
701 | + else | |
702 | + { | |
703 | + pos=x; | |
704 | + break; | |
705 | + } | |
706 | + } | |
707 | + break; | |
708 | + // 英数大文字処理(連続) | |
709 | + case 1: | |
710 | + for(unsigned x=pos;x<this->m_Data.length();x++) | |
711 | + { | |
712 | + if(m_Data.substr(x,2).compare(L"⠠⠴")==0) | |
713 | + { | |
714 | + pos = x-1; | |
715 | + break; | |
716 | + } | |
717 | + else if( m_Data.substr(x,1).compare(L"⠼")==0) | |
718 | + { | |
719 | + wbuff << this->numeric2_conv(x); | |
720 | + } | |
721 | + else if(this->finedS(i01,m_Data.substr(x,2)).compare(L"─")!=0) | |
722 | + { | |
723 | + wbuff << this->finedS(i01,m_Data.substr(x,2)); | |
724 | + x++; | |
725 | + } | |
726 | + else if(this->finedS(i01,m_Data.substr(x,1)).compare(L"─")!=0) | |
727 | + wbuff << this->finedS(i01,m_Data.substr(x,1)); | |
728 | + else | |
729 | + { | |
730 | + pos=x; | |
731 | + break; | |
732 | + } | |
733 | + } | |
734 | + break; | |
735 | + // 英数大文字処理(単独) | |
736 | + case 2: | |
737 | + for(unsigned x=pos;x<this->m_Data.length();x++) | |
738 | + { | |
739 | + if(m_Data.substr(x,2).compare(L"⠠⠴")==0) | |
740 | + { | |
741 | + pos = x-1; | |
742 | + break; | |
743 | + } | |
744 | + else if( m_Data.substr(x,1).compare(L"⠼")==0) | |
745 | + { | |
746 | + wbuff << this->numeric2_conv(x); | |
747 | + } | |
748 | + else if(this->finedS(i01,m_Data.substr(x,2)).compare(L"─")!=0) | |
749 | + { | |
750 | + wbuff << this->finedS(i01,m_Data.substr(x,2)); | |
751 | + x++; | |
752 | + } | |
753 | + else if(this->finedS(i01,m_Data.substr(x,1)).compare(L"─")!=0) | |
754 | + wbuff << this->finedS(i01,m_Data.substr(x,1)); | |
755 | + else | |
756 | + { | |
757 | + pos=x; | |
758 | + break; | |
759 | + } | |
760 | + break; // 一回のみ。 | |
761 | + } | |
762 | + f_oomoji=0; | |
763 | + break; | |
764 | + // カタカナ処理 | |
765 | + case 3: | |
766 | + ; | |
767 | + ; | |
768 | + f_oomoji=0; | |
769 | + break; | |
770 | + } | |
771 | + break; | |
772 | + } | |
773 | + pos++; | |
774 | + } | |
775 | + return wbuff.str(); | |
776 | +} | |
777 | +/////////////////////////////////////////////////////////////////////////////// | |
778 | +// ユニコード点字から英文点字に変換する。 | |
779 | +// | |
780 | +wstring CBraille::eng_conv(unsigned &pos,wstring s_c) | |
781 | +{ | |
782 | + wostringstream wbuff; | |
783 | + unsigned f_oomoji=0; | |
784 | + | |
785 | + wstring xxx; | |
786 | + xxx=L"⠴"; | |
787 | + if(this->finedS(j01,s_c).compare(L"_")==0) | |
788 | + xxx+=s_c; | |
789 | + else if(this->finedS(j01,s_c).compare(L"|")==0) | |
790 | + xxx+=s_c; | |
791 | + else if(this->finedS(j01,s_c).compare(L" ")==0) | |
792 | + xxx+=s_c; | |
793 | + | |
794 | + pos++; // ヘッダーコード分進める。 | |
795 | + | |
796 | + wbuff << L" ̄"; | |
797 | + | |
798 | + if(m_Data.substr(pos,2).compare(L"⠠⠠")==0) | |
799 | + { | |
800 | + f_oomoji=1; // 大文字連続 | |
801 | + pos+=2; | |
802 | + } | |
803 | + else if(m_Data.substr(pos,1).compare(L"⠠")==0) | |
804 | + { | |
805 | + f_oomoji=2; // 大文字単独フラグ | |
806 | + pos++; | |
807 | + } | |
808 | + else | |
809 | + { | |
810 | + f_oomoji=0; | |
811 | + | |
812 | + } | |
813 | + | |
814 | + while(pos<this->m_Data.length()) | |
815 | + { | |
816 | + | |
817 | + switch ((wchar_t)m_Data.at(pos)) | |
818 | + { | |
819 | + case L'⠴': | |
820 | + // if( m_Data.at(pos+1)==s_c.at(0)) | |
821 | + if (m_Data.substr(pos,xxx.length()).compare(xxx)==0) | |
822 | + { | |
823 | + wbuff << L" ̄"; | |
824 | + return wbuff.str(); | |
825 | + } | |
826 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴⠀")==0) | |
827 | + { | |
828 | + wbuff << L" ̄"; | |
829 | + return wbuff.str(); | |
830 | + } | |
831 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴\n")==0) | |
832 | + { | |
833 | + wbuff << L" ̄"; | |
834 | + return wbuff.str(); | |
835 | + } | |
836 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴\r")==0) | |
837 | + { | |
838 | + wbuff << L" ̄"; | |
839 | + return wbuff.str(); | |
840 | + } | |
841 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴⠤")==0) | |
842 | + { | |
843 | + wbuff << L" ̄"; | |
844 | + return wbuff.str(); | |
845 | + } | |
846 | + | |
847 | + break; | |
848 | + default: | |
849 | + switch (f_oomoji) | |
850 | + { | |
851 | + // 英数小文字処理 | |
852 | + case 0: | |
853 | + for(unsigned x=pos;x<this->m_Data.length();x++) | |
854 | + { | |
855 | + if (m_Data.substr(x,xxx.length()).compare(xxx)==0) | |
856 | + { | |
857 | + pos = x; | |
858 | + wbuff << L" ̄"; | |
859 | + return wbuff.str(); | |
860 | + break; | |
861 | + } | |
862 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴⠀")==0) | |
863 | + { | |
864 | + pos = x; | |
865 | + wbuff << L" ̄"; | |
866 | + return wbuff.str(); | |
867 | + break; | |
868 | + } | |
869 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴\n")==0) | |
870 | + { | |
871 | + pos = x; | |
872 | + wbuff << L" ̄"; | |
873 | + return wbuff.str(); | |
874 | + break; | |
875 | + } | |
876 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴\r")==0) | |
877 | + { | |
878 | + pos = x; | |
879 | + wbuff << L" ̄"; | |
880 | + return wbuff.str(); | |
881 | + break; | |
882 | + } | |
883 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴⠤")==0) | |
884 | + { | |
885 | + pos = x; | |
886 | + wbuff << L" ̄"; | |
887 | + return wbuff.str(); | |
888 | + break; | |
889 | + } | |
890 | + //@@ | |
891 | + | |
892 | + else if(m_Data.substr(x,2).compare(L"⠠⠠")==0) | |
893 | + { | |
894 | + f_oomoji=1; // 大文字連続 | |
895 | + x++; | |
896 | + break; | |
897 | + } | |
898 | + else if(m_Data.substr(x,1).compare(L"⠠")==0) | |
899 | + { | |
900 | + f_oomoji=2; // 大文字単独フラグ | |
901 | + break; | |
902 | + } | |
903 | + else if( m_Data.substr(x,1).compare(L"⠼")==0) | |
904 | + { | |
905 | + wbuff << this->numeric2_conv(x); | |
906 | + } | |
907 | + else if(this->finedS(e03,m_Data.substr(x,1)).compare(L"─")!=0) | |
908 | + { | |
909 | + wbuff << this->finedS(e03,m_Data.substr(x,1)); | |
910 | + } | |
911 | + else if(this->finedS(e02,m_Data.substr(x,1)).compare(L"─")!=0) | |
912 | + { | |
913 | + wbuff << this->finedS(e02,m_Data.substr(x,1)); | |
914 | + } | |
915 | + pos=x; | |
916 | + // break; // 一回のみ。 | |
917 | + } | |
918 | + break; | |
919 | + case 1: | |
920 | + for(unsigned x=pos;x<this->m_Data.length();x++) | |
921 | + { | |
922 | + if (m_Data.substr(x,xxx.length()).compare(xxx)==0) | |
923 | + { | |
924 | + pos=x; | |
925 | + wbuff << L" ̄"; | |
926 | + return wbuff.str(); | |
927 | + break; | |
928 | + } | |
929 | + | |
930 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴⠀")==0) | |
931 | + { | |
932 | + pos = x; | |
933 | + wbuff << L" ̄"; | |
934 | + return wbuff.str(); | |
935 | + break; | |
936 | + } | |
937 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴\n")==0) | |
938 | + { | |
939 | + pos = x; | |
940 | + wbuff << L" ̄"; | |
941 | + return wbuff.str(); | |
942 | + break; | |
943 | + } | |
944 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴\r")==0) | |
945 | + { | |
946 | + pos = x; | |
947 | + wbuff << L" ̄"; | |
948 | + return wbuff.str(); | |
949 | + break; | |
950 | + } | |
951 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴⠤")==0) | |
952 | + { | |
953 | + pos = x; | |
954 | + wbuff << L" ̄"; | |
955 | + return wbuff.str(); | |
956 | + break; | |
957 | + } | |
958 | + //@@ | |
959 | + | |
960 | + else if(m_Data.substr(x,2).compare(L"⠠⠠")==0) | |
961 | + { | |
962 | + f_oomoji=1; // 大文字連続 | |
963 | + x++; | |
964 | + break; | |
965 | + } | |
966 | + else if(m_Data.substr(x,1).compare(L"⠠")==0) | |
967 | + { | |
968 | + f_oomoji=2; // 大文字単独フラグ | |
969 | + break; | |
970 | + } | |
971 | + else if( m_Data.substr(x,1).compare(L"⠼")==0) | |
972 | + { | |
973 | + wbuff << this->numeric2_conv(x); | |
974 | + } | |
975 | + else if(this->finedS(e03,m_Data.substr(x,1)).compare(L"─")!=0) | |
976 | + { | |
977 | + wbuff << this->finedS(e03,m_Data.substr(x,1)); | |
978 | + } | |
979 | + else if(this->finedS(e01,m_Data.substr(x,1)).compare(L"─")!=0) | |
980 | + { | |
981 | + wbuff << this->finedS(e01,m_Data.substr(x,1)); | |
982 | + } | |
983 | + f_oomoji=0; | |
984 | + pos=x; | |
985 | + // break; // 一回のみ。 | |
986 | + } | |
987 | + break; | |
988 | + case 2: | |
989 | + for(unsigned x=pos;x<this->m_Data.length();x++) | |
990 | + { | |
991 | + if (m_Data.substr(x,xxx.length()).compare(xxx)==0) | |
992 | + { | |
993 | + pos =x; | |
994 | + wbuff << L" ̄"; | |
995 | + return wbuff.str(); | |
996 | + break; | |
997 | + } | |
998 | + | |
999 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴⠀")==0) | |
1000 | + { | |
1001 | + pos = x; | |
1002 | + wbuff << L" ̄"; | |
1003 | + return wbuff.str(); | |
1004 | + break; | |
1005 | + } | |
1006 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴\n")==0) | |
1007 | + { | |
1008 | + pos = x; | |
1009 | + wbuff << L" ̄"; | |
1010 | + return wbuff.str(); | |
1011 | + break; | |
1012 | + } | |
1013 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴\r")==0) | |
1014 | + { | |
1015 | + pos = x; | |
1016 | + wbuff << L" ̄"; | |
1017 | + return wbuff.str(); | |
1018 | + break; | |
1019 | + } | |
1020 | + else if (m_Data.substr(pos,xxx.length()).compare(L"⠴⠤")==0) | |
1021 | + { | |
1022 | + pos = x; | |
1023 | + wbuff << L" ̄"; | |
1024 | + return wbuff.str(); | |
1025 | + break; | |
1026 | + } | |
1027 | + | |
1028 | + else if(m_Data.substr(x,2).compare(L"⠠⠠")==0) | |
1029 | + { | |
1030 | + f_oomoji=1; // 大文字連続 | |
1031 | + x++; | |
1032 | + break; | |
1033 | + } | |
1034 | + else if(m_Data.substr(x,1).compare(L"⠠")==0) | |
1035 | + { | |
1036 | + f_oomoji=2; // 大文字単独フラグ | |
1037 | + break; | |
1038 | + } | |
1039 | + else if( m_Data.substr(x,1).compare(L"⠼")==0) | |
1040 | + { | |
1041 | + wbuff << this->numeric2_conv(x); | |
1042 | + } | |
1043 | + else if(this->finedS(e03,m_Data.substr(x,1)).compare(L"─")!=0) | |
1044 | + { | |
1045 | + wbuff << this->finedS(e03,m_Data.substr(x,1)); | |
1046 | + } | |
1047 | + else if(this->finedS(e01,m_Data.substr(x,1)).compare(L"─")!=0) | |
1048 | + { | |
1049 | + wbuff << this->finedS(e01,m_Data.substr(x,1)); | |
1050 | + } | |
1051 | + f_oomoji=0; | |
1052 | + pos=x; | |
1053 | + break; // 一回のみ。 | |
1054 | + } | |
1055 | + break; | |
1056 | + default: | |
1057 | + /////////////////////////////////////////////////////////////////////////////////////// | |
1058 | + /////////////////////////////////////////////////////////////////////////////////////// | |
1059 | + /////////////////////////////////////////////////////////////////////////////////////// | |
1060 | + /////////////////////////////////////////////////////////////////////////////////////// | |
1061 | + f_oomoji=0; | |
1062 | + break; | |
1063 | + } | |
1064 | + break; | |
1065 | + } | |
1066 | + pos++; | |
1067 | + } | |
1068 | + return wbuff.str(); | |
1069 | +} | |
1070 | + | |
1071 | + | |
1072 | +/////////////////////////////////////////////////////////////////////////////// | |
1073 | +// ユニコード点字から英文点字に変換する。 | |
1074 | +// | |
1075 | +wstring CBraille::eng_conv2(unsigned &pos,wstring s_c) | |
1076 | +{ | |
1077 | + wostringstream wbuff; | |
1078 | + | |
1079 | + wbuff << L"<ここは英文点字です。> ̄"; | |
1080 | + | |
1081 | + wstring xxx; | |
1082 | + xxx=L"⠴"; | |
1083 | + if(this->finedS(j01,s_c).compare(L"_")==0) | |
1084 | + xxx+=s_c; | |
1085 | + else if(this->finedS(j01,s_c).compare(L"|")==0) | |
1086 | + xxx+=s_c; | |
1087 | + | |
1088 | + | |
1089 | + while(pos<this->m_Data.length()) | |
1090 | + { | |
1091 | + switch ((wchar_t)m_Data.at(pos)) | |
1092 | + { | |
1093 | + case L'⠴': | |
1094 | + if (m_Data.substr(pos,xxx.length()).compare(xxx)==0) | |
1095 | + { | |
1096 | + wbuff << L" ̄"; | |
1097 | + return wbuff.str(); | |
1098 | + } | |
1099 | + break; | |
1100 | + default: | |
1101 | + break; | |
1102 | + } | |
1103 | + pos++; | |
1104 | + } | |
1105 | + | |
1106 | + return wbuff.str(); | |
1107 | +} | |
1108 | + | |
1109 | +/////////////////////////////////////////////////////////////////////////////// | |
1110 | +// 空白行にスペースを埋め込む | |
1111 | +/////////////////////////////////////////////////////////////////////////////// | |
1112 | +wstring CBraille::Cxx(wstring cbuff) | |
1113 | +{ | |
1114 | + size_t pos=0; | |
1115 | + wstring Dc_1 = L"ッッ"; | |
1116 | + wstring Dc_2 = L"……"; | |
1117 | + | |
1118 | + while((pos = cbuff.find(Dc_1.c_str(),pos))!=std::wstring::npos) | |
1119 | + { | |
1120 | + cbuff.replace(pos, Dc_1.length(),Dc_2); | |
1121 | + } | |
1122 | + Dc_1 = L"…ッ"; | |
1123 | + | |
1124 | + pos=0; | |
1125 | + while((pos = cbuff.find(Dc_1.c_str(),pos))!=std::wstring::npos) | |
1126 | + { | |
1127 | + cbuff.replace(pos, Dc_1.length(),Dc_2); | |
1128 | + } | |
1129 | + | |
1130 | + return cbuff; | |
1131 | + | |
1132 | +} | |
1133 | + | |
1134 | + | |
1135 | +/////////////////////////////////////////////////////////////////////////////// | |
1136 | +// 改行変換 | |
1137 | +/////////////////////////////////////////////////////////////////////////////// | |
1138 | +wstring CBraille::Cxx2(wstring cbuff) | |
1139 | +{ | |
1140 | + size_t pos=0; | |
1141 | + std::wstring Dc_1 = L"\r\n"; | |
1142 | + std::wstring Dc_2 = L"\n"; | |
1143 | + | |
1144 | + while((pos = cbuff.find(Dc_1.c_str(),pos))!=std::wstring::npos) | |
1145 | + cbuff.replace(pos, Dc_1.length(),Dc_2); | |
1146 | + return cbuff; | |
1147 | + | |
1148 | +} | |
1149 | +/////////////////////////////////////////////////////////////////////////////// | |
1150 | +// 空白行にスペースを埋め込む | |
1151 | +/////////////////////////////////////////////////////////////////////////////// | |
1152 | +wstring CBraille::Cxx3(wstring cbuff) | |
1153 | +{ | |
1154 | + size_t pos=0; | |
1155 | + wstring Dc_1 = L"\n\n"; | |
1156 | + wstring Dc_2 = L"\n \n"; | |
1157 | + | |
1158 | + while((pos = cbuff.find(Dc_1.c_str(),pos))!=std::wstring::npos) | |
1159 | + cbuff.replace(pos, Dc_1.length(),Dc_2); | |
1160 | + return cbuff; | |
1161 | +} | |
1162 | + |
@@ -0,0 +1,10 @@ | ||
1 | +#include <iostream> // 入出力ストリーム | |
2 | +#include <fstream> // ファイルストリーム | |
3 | +#include <string> // 文字列 | |
4 | +#include <locale> // ロケール | |
5 | +using namespace std; | |
6 | + | |
7 | +string TenjiTexter( | |
8 | + wstring p_LoadFileName, | |
9 | + wstring p_SaveFileName | |
10 | +); // ファイル変換 |
@@ -0,0 +1,8 @@ | ||
1 | +// stdafx.cpp : 標準インクルード tenji_texter.pch のみを | |
2 | +// 含むソース ファイルは、プリコンパイル済みヘッダーになります。 | |
3 | +// stdafx.obj にはプリコンパイル済み型情報が含まれます。 | |
4 | + | |
5 | +#include "stdafx.h" | |
6 | + | |
7 | +// TODO: このファイルではなく、STDAFX.H で必要な | |
8 | +// 追加ヘッダーを参照してください。 |
@@ -0,0 +1,62 @@ | ||
1 | +======================================================================== | |
2 | +WIN32 アプリケーション : TenjiTexter プロジェクトの概要 | |
3 | +======================================================================== | |
4 | + | |
5 | +この TenjiTexter アプリケーションは、AppWizard によって作成されました。 | |
6 | + | |
7 | +このファイルには、TenjiTexter アプリケーションを構成する各ファイルの | |
8 | +内容の概略が記述されています。 | |
9 | + | |
10 | + | |
11 | +TenjiTexter.vcproj | |
12 | + これは、アプリケーション ウィザードで生成される VC++ プロジェクトのメインの | |
13 | + プロジェクト ファイルです。 | |
14 | + ファイルを生成した Visual C++ のバージョン情報と、アプリケーション | |
15 | + ウィザードで選択したプラットフォーム、構成、およびプロジェクトの機能に関する | |
16 | + 情報が記述されています。 | |
17 | + | |
18 | +TenjiTexter.cpp | |
19 | + これは、メインのアプリケーション ソース ファイルです。 | |
20 | + | |
21 | +///////////////////////////////////////////////////////////////////////////// | |
22 | +AppWizard によって、次のリソースが作成されました。 | |
23 | + | |
24 | +TenjiTexter.rc | |
25 | + これは、プログラムで使用する Microsoft Windows の全リソースの一覧です。 | |
26 | + RES サブディレクトリに保存されるアイコン、ビットマップ、カーソルなどが | |
27 | + 含まれます。このファイルは、Microsoft Visual C++ で直接編集できます。 | |
28 | + | |
29 | +Resource.h | |
30 | + これは、新しいリソース ID を定義する標準のヘッダー ファイルです。 | |
31 | + このファイルの読み込みおよび更新は、Microsoft Visual C++ で行います。 | |
32 | + | |
33 | +TenjiTexter.ico | |
34 | + これは、アプリケーションのアイコン (32x32) として使用されるアイコン | |
35 | + ファイルです。 | |
36 | + このアイコンは、メインのリソース ファイル TenjiTexter.rc によって | |
37 | + 組み込まれます。 | |
38 | + | |
39 | +small.ico | |
40 | + これは、小さいバージョン (16x16) のアプリケーションのアイコンを含むアイコン | |
41 | + ファイルです。このアイコンは、メインのリソース ファイル | |
42 | + TenjiTexter.rc によって組み込まれます。 | |
43 | + | |
44 | +///////////////////////////////////////////////////////////////////////////// | |
45 | +その他の標準ファイル : | |
46 | + | |
47 | +StdAfx.h, StdAfx.cpp | |
48 | + これらのファイルは、コンパイル済みヘッダー (PCH) ファイル | |
49 | + TenjiTexter.pch とプリコンパイル済み型ファイル StdAfx.obj を | |
50 | + ビルドするために使用します。 | |
51 | + | |
52 | +///////////////////////////////////////////////////////////////////////////// | |
53 | +その他のメモ : | |
54 | + | |
55 | +AppWizard では "TODO:" コメントを使用して、ユーザーが追加またはカスタマイズする | |
56 | +ソース部分を示します。 | |
57 | + | |
58 | +///////////////////////////////////////////////////////////////////////////// | |
59 | + | |
60 | + | |
61 | + | |
62 | + |
@@ -0,0 +1,72 @@ | ||
1 | +#include "StdAfx.h" | |
2 | +#include "Notepad.h" | |
3 | + | |
4 | +/////////////////////////////////////////////////////////////////////////////// | |
5 | +// コールバック関数 | |
6 | +BOOL CALLBACK FindWindowProc(HWND hWnd, LPARAM lParam) | |
7 | +{ | |
8 | + HWND *hProcessWnd = (HWND *)lParam; | |
9 | + // ルートウインドウのハンドルを取得 | |
10 | + if(GetParent(hWnd) == NULL) { | |
11 | + *hProcessWnd = hWnd; | |
12 | + return FALSE;// 列挙を中断 | |
13 | + } | |
14 | + return TRUE; | |
15 | +} | |
16 | +/////////////////////////////////////////////////////////////////////////////// | |
17 | +// ノートパッド起動 | |
18 | +VOID Notepad(std::wstring FileName) | |
19 | +{ | |
20 | + | |
21 | + PROCESS_INFORMATION pi; | |
22 | + STARTUPINFO si; | |
23 | + HWND hProcessWnd = NULL; | |
24 | + | |
25 | + ZeroMemory(&si,sizeof(si)); | |
26 | + si.cb = sizeof(si); | |
27 | + | |
28 | + si.dwFlags = STARTF_USESHOWWINDOW; | |
29 | + si.wShowWindow = SW_HIDE; | |
30 | + | |
31 | + _TCHAR cmd[_MAX_PATH]; | |
32 | + _tcscpy_s(cmd,_MAX_PATH,L"notepad.exe "); | |
33 | + _tcscat_s(cmd,_MAX_PATH,FileName.c_str()); | |
34 | + | |
35 | + CreateProcess( | |
36 | + NULL, | |
37 | + cmd, | |
38 | + NULL, | |
39 | + NULL, | |
40 | + FALSE, | |
41 | + NORMAL_PRIORITY_CLASS, | |
42 | + NULL, | |
43 | + NULL, | |
44 | + &si, | |
45 | + &pi | |
46 | + ); | |
47 | + // プロセスの初期化が終わるまで待機 | |
48 | + int COMPLETE = 0; | |
49 | + if(WaitForInputIdle(pi.hProcess, INFINITE) == COMPLETE) | |
50 | + { | |
51 | + // 指定されたスレッドに関連付けられたウインドウを取得 | |
52 | + EnumThreadWindows(pi.dwThreadId, FindWindowProc, (LPARAM)&hProcessWnd); | |
53 | + } | |
54 | + | |
55 | + // ウインド取得に成功した場合の処理 | |
56 | + if(hProcessWnd != NULL) { | |
57 | + | |
58 | + //@@ ファイル削除 | |
59 | + DeleteFile(FileName.c_str()); | |
60 | + | |
61 | + SetWindowText(hProcessWnd,L"TenjiTexter Ver0.9.0 : Copyright(C)2009 Masataka Shinke All Rights Reserved (GPLv3)"); | |
62 | + ShowWindow(hProcessWnd, SW_SHOW); | |
63 | + SetForegroundWindow(hProcessWnd); | |
64 | + } | |
65 | + // ウインド取得に失敗した場合の処理 | |
66 | + else { | |
67 | + MessageBox(NULL, L"メモ帳が開けません。", L"起動エラー", MB_OK); | |
68 | + } | |
69 | + // ハンドル開放 | |
70 | + CloseHandle(pi.hProcess); | |
71 | + | |
72 | +} |
@@ -0,0 +1,31 @@ | ||
1 | +//{{NO_DEPENDENCIES}} | |
2 | +// Microsoft Visual C++ generated include file. | |
3 | +// Used by TenjiTexter.rc | |
4 | +// | |
5 | + | |
6 | +#define IDS_APP_TITLE 103 | |
7 | + | |
8 | +#define IDR_MAINFRAME 128 | |
9 | +#define IDD_TENJITEXTER_DIALOG 102 | |
10 | +#define IDD_ABOUTBOX 103 | |
11 | +#define IDM_ABOUT 104 | |
12 | +#define IDM_EXIT 105 | |
13 | +#define IDI_TENJITEXTER 107 | |
14 | +#define IDI_SMALL 108 | |
15 | +#define IDC_TENJITEXTER 109 | |
16 | +#define IDC_MYICON 2 | |
17 | +#ifndef IDC_STATIC | |
18 | +#define IDC_STATIC -1 | |
19 | +#endif | |
20 | +// 新しいオブジェクトの次の既定値 | |
21 | +// | |
22 | +#ifdef APSTUDIO_INVOKED | |
23 | +#ifndef APSTUDIO_READONLY_SYMBOLS | |
24 | + | |
25 | +#define _APS_NO_MFC 130 | |
26 | +#define _APS_NEXT_RESOURCE_VALUE 129 | |
27 | +#define _APS_NEXT_COMMAND_VALUE 32771 | |
28 | +#define _APS_NEXT_CONTROL_VALUE 1000 | |
29 | +#define _APS_NEXT_SYMED_VALUE 110 | |
30 | +#endif | |
31 | +#endif |
@@ -0,0 +1,416 @@ | ||
1 | + GNU 一般公衆利用許諾契約書 | |
2 | + バージョン2、1991年6月 | |
3 | + 日本語訳、2002年5月20日 | |
4 | + | |
5 | + Copyright (C) 1989, 1991 Free Software Foundation, Inc. | |
6 | + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
7 | + この利用許諾契約書を、一字一句そのままに複製し頒布することは許可する。 | |
8 | + しかし変更は認めない。 | |
9 | + | |
10 | + This is an unofficial translation of the GNU General Public License | |
11 | + into Japanese. It was not published by the Free Software Foundation, | |
12 | + and does not legally state the distribution terms for software that | |
13 | + uses the GNU GPL--only the original English text of the GNU GPL does | |
14 | + that. However, we hope that this translation will help Japanese | |
15 | + speakers understand the GNU GPL better. | |
16 | + | |
17 | + (訳: 以下はGNU General Public Licenseの非公式な日本語訳です。これはフ | |
18 | + リーソフトウェア財団(the Free Software Foundataion)によって発表された | |
19 | + ものではなく、GNU GPLを適用したソフトウェアの頒布条件を法的に有効な形 | |
20 | + で述べたものではありません。頒布条件としてはGNU GPLの英語版テキストで | |
21 | + 指定されているもののみが有効です。しかしながら、私たちはこの翻訳が、 | |
22 | + 日本語を使用する人々にとってGNU GPLをより良く理解する助けとなることを | |
23 | + 望んでいます。) | |
24 | + | |
25 | + 翻訳は 八田真行<mhatta@gnu.org>が行った。原文は | |
26 | + http://www.gnu.org/licenses/gpl.txtである。誤訳の指摘や改善案を歓迎す | |
27 | + る。 | |
28 | + はじめに | |
29 | + | |
30 | +ソフトウェア向けライセンスの大半は、あなたがそのソフトウェアを共有した | |
31 | +り変更したりする自由を奪うように設計されています。対照的に、GNU 一般公 | |
32 | +衆利用許諾契約書は、あなたがフリーソフトウェアを共有したり変更したりす | |
33 | +る自由を保証する--すなわち、ソフトウェアがそのユーザすべてにとってフリー | |
34 | +であることを保証することを目的としています。この一般公衆利用許諾契約書 | |
35 | +はフリーソフトウェア財団のソフトウェアのほとんどに適用されており、また | |
36 | +GNU GPLを適用すると決めたフリーソフトウェア財団以外の作者によるプログ | |
37 | +ラムにも適用されています(いくつかのフリーソフトウェア財団のソフトウェ | |
38 | +アには、GNU GPLではなくGNU ライブラリ一般公衆利用許諾契約書が適用され | |
39 | +ていることもあります)。あなたもまた、ご自分のプログラムにGNU GPLを適用 | |
40 | +することが可能です。 | |
41 | + | |
42 | +私たちがフリーソフトウェアと言うとき、それは利用の自由について言及して | |
43 | +いるのであって、価格は問題にしていません。私たちの一般公衆利用許諾契約 | |
44 | +書は、あなたがフリーソフトウェアの複製物を頒布する自由を保証するよう設 | |
45 | +計されています(希望に応じてその種のサービスに手数料を課す自由も保証さ | |
46 | +れます)。また、あなたがソースコードを受け取るか、あるいは望めばそれを | |
47 | +入手することが可能であるということ、あなたがソフトウェアを変更し、その | |
48 | +一部を新たなフリーのプログラムで利用できるということ、そして、以上で述 | |
49 | +べたようなことができるということがあなたに知らされるということも保証さ | |
50 | +れます。 | |
51 | + | |
52 | +あなたの権利を守るため、私たちは誰かがあなたの有するこれらの権利を否定 | |
53 | +することや、これらの権利を放棄するよう要求することを禁止するという制限 | |
54 | +を加える必要があります。よって、あなたがソフトウェアの複製物を頒布した | |
55 | +りそれを変更したりする場合には、これらの制限のためにあなたにある種の責 | |
56 | +任が発生することになります。 | |
57 | + | |
58 | +例えば、あなたがフリーなプログラムの複製物を頒布する場合、有料か無料に | |
59 | +関わらず、あなたは自分が有する権利を全て受領者に与えなければなりません。 | |
60 | +また、あなたは彼らもソースコードを受け取るか手に入れることができるよう | |
61 | +保証しなければなりません。そして、あなたは彼らに対して以下で述べる条件 | |
62 | +を示し、彼らに自らの持つ権利について知らしめるようにしなければなりませ | |
63 | +ん。 | |
64 | + | |
65 | +私たちはあなたの権利を二段階の手順を踏んで保護します。(1) まずソフトウェ | |
66 | +アに対して著作権を主張し、そして (2) あなたに対して、ソフトウェアの複 | |
67 | +製や頒布または改変についての法的な許可を与えるこの契約書を提示します。 | |
68 | + | |
69 | +また、各作者や私たちを保護するため、私たちはこのフリーソフトウェアには | |
70 | +何の保証も無いということを誰もが確実に理解するようにし、またソフトウェ | |
71 | +アが誰か他人によって改変され、それが次々と頒布されていったとしても、そ | |
72 | +の受領者は彼らが手に入れたソフトウェアがオリジナルのバージョンでは無い | |
73 | +こと、そして原作者の名声は他人によって持ち込まれた可能性のある問題によっ | |
74 | +て影響されることがないということを周知させたいと思います。 | |
75 | + | |
76 | +最後に、ソフトウェア特許がいかなるフリーのプログラムの存在にも不断の脅 | |
77 | +威を投げかけていますが、私たちは、フリーなプログラムの再頒布者が個々に | |
78 | +特許ライセンスを取得することによって、事実上プログラムを独占的にしてし | |
79 | +まうという危険を避けたいと思います。こういった事態を予防するため、私た | |
80 | +ちはいかなる特許も誰もが自由に利用できるようライセンスされるか、全くラ | |
81 | +イセンスされないかのどちらかでなければならないことを明確にしました。 | |
82 | + | |
83 | +(訳注: 本契約書で「独占的(proprietary)」とは、ソフトウェアの利用や再頒 | |
84 | +布、改変が禁止されているか、許可を得ることが必要とされているか、あるい | |
85 | +は厳しい制限が課せられていて自由にそうすることが事実上できなくなってい | |
86 | +る状態のことを指す。詳しくは | |
87 | +http://www.gnu.org/philosophy/categories.ja.html#ProprietarySoftwareを | |
88 | +参照せよ。) | |
89 | + | |
90 | +複製や頒布、改変についての正確な条件と制約を以下で述べていきます。 | |
91 | + | |
92 | + GNU 一般公衆利用許諾契約書 | |
93 | + 複製、頒布、改変に関する条件と制約 | |
94 | + | |
95 | +0. この利用許諾契約書は、そのプログラム(またはその他の著作物)をこの一 | |
96 | +般公衆利用許諾契約書の定める条件の下で頒布できるという告知が著作権者に | |
97 | +よって記載されたプログラムまたはその他の著作物全般に適用される。以下で | |
98 | +は、「『プログラム』」とはそのようにしてこの契約書が適用されたプログラ | |
99 | +ムや著作物全般を意味し、また「『プログラム』を基にした著作物」とは『プ | |
100 | +ログラム』やその他著作権法の下で派生物と見なされるもの全般を指す。すな | |
101 | +わち、『プログラム』かその一部を、全く同一のままか、改変を加えたか、あ | |
102 | +るいは他の言語に翻訳された形で含む著作物のことである(「改変」という語 | |
103 | +の本来の意味からはずれるが、以下では翻訳も改変の一種と見なす)。それぞ | |
104 | +れの契約者は「あなた」と表現される。 | |
105 | + | |
106 | +複製や頒布、改変以外の活動はこの契約書ではカバーされない。それらはこの | |
107 | +契約書の対象外である。『プログラム』を実行する行為自体に制限はない。ま | |
108 | +た、そのような『プログラム』の出力結果は、その内容が『プログラム』を基 | |
109 | +にした著作物を構成する場合のみこの契約書によって保護される(『プログラ | |
110 | +ム』を実行したことによって作成されたということとは無関係である)。この | |
111 | +ような線引きの妥当性は、『プログラム』が何をするのかに依存する。 | |
112 | + | |
113 | +1. それぞれの複製物において適切な著作権表示と保証の否認声明(disclaimer | |
114 | +of warranty)を目立つよう適切に掲載し、またこの契約書および一切の保証の | |
115 | +不在に触れた告知すべてをそのまま残し、そしてこの契約書の複製物を『プロ | |
116 | +グラム』のいかなる受領者にも『プログラム』と共に頒布する限り、あなたは | |
117 | +『プログラム』のソースコードの複製物を、あなたが受け取った通りの形で複 | |
118 | +製または頒布することができる。媒体は問わない。 | |
119 | + | |
120 | +あなたは、物理的に複製物を譲渡するという行為に関して手数料を課しても良 | |
121 | +いし、希望によっては手数料を取って交換における保護の保証を提供しても良 | |
122 | +い。 | |
123 | + | |
124 | +2. あなたは自分の『プログラム』の複製物かその一部を改変して『プログラ | |
125 | +ム』を基にした著作物を形成し、そのような改変点や著作物を上記第1節の定 | |
126 | +める条件の下で複製または頒布することができる。ただし、そのためには以下 | |
127 | +の条件すべてを満たしていなければならない: | |
128 | + | |
129 | + a) あなたがそれらのファイルを変更したということと変更した日時が良 | |
130 | + く分かるよう、改変されたファイルに告示しなければならない。 | |
131 | + | |
132 | + b) 『プログラム』またはその一部を含む著作物、あるいは『プログラム』 | |
133 | + かその一部から派生した著作物を頒布あるいは発表する場合には、その全 | |
134 | + 体をこの契約書の条件に従って第三者へ無償で利用許諾しなければならな | |
135 | + い。 | |
136 | + | |
137 | + c) 改変されたプログラムが、通常実行する際に対話的にコマンドを読む | |
138 | + ようになっているならば、そのプログラムを最も一般的な方法で対話的に | |
139 | + 実行する際、適切な著作権表示、無保証であること(あるいはあなたが保 | |
140 | + 証を提供するということ)、ユーザがプログラムをこの契約書で述べた条 | |
141 | + 件の下で頒布することができるということ、そしてこの契約書の複製物を | |
142 | + 閲覧するにはどうしたらよいかというユーザへの説明を含む告知が印刷さ | |
143 | + れるか、あるいは画面に表示されるようにしなければならない(例外とし | |
144 | + て、『プログラム』そのものは対話的であっても通常そのような告知を印 | |
145 | + 刷しない場合には、『プログラム』を基にしたあなたの著作物にそのよう | |
146 | + な告知を印刷させる必要はない)。 | |
147 | + | |
148 | +以上の必要条件は全体としての改変された著作物に適用される。著作物の一部 | |
149 | +が『プログラム』から派生したものではないと確認でき、それら自身別の独立 | |
150 | +した著作物であると合理的に考えられるならば、あなたがそれらを別の著作物 | |
151 | +として分けて頒布する場合、そういった部分にはこの契約書とその条件は | |
152 | +適用されない。しかし、あなたが同じ部分を『プログラム』を基にした著作物 | |
153 | +全体の一部として頒布するならば、全体としての頒布物は、この契約書が | |
154 | +課す条件に従わなければならない。というのは、この契約書が他の契約者 | |
155 | +に与える許可は『プログラム』丸ごと全体に及び、誰が書いたかは関係なく各 | |
156 | +部分のすべてを保護するからである。 | |
157 | + | |
158 | +よって、すべてあなたによって書かれた著作物に対し、権利を主張したりあな | |
159 | +たの権利に異議を申し立てることはこの節の意図するところではない。むしろ、 | |
160 | +その趣旨は『プログラム』を基にした派生物ないし集合著作物の頒布を管理す | |
161 | +る権利を行使するということにある。 | |
162 | + | |
163 | +また、『プログラム』を基にしていないその他の著作物を『プログラム』(あ | |
164 | +るいは『プログラム』を基にした著作物)と一緒に集めただけのものを一巻の | |
165 | +保管装置ないし頒布媒体に収めても、その他の著作物までこの契約書が保 | |
166 | +護する対象になるということにはならない。 | |
167 | + | |
168 | +3. あなたは上記第1節および2節の条件に従い、『プログラム』(あるいは第2 | |
169 | +節における派生物)をオブジェクトコードないし実行形式で複製または頒布す | |
170 | +ることができる。ただし、その場合あなたは以下のうちどれか一つを実施しな | |
171 | +ければならない: | |
172 | + | |
173 | + a) 著作物に、『プログラム』に対応した完全かつ機械で読み取り可能な | |
174 | + ソースコードを添付する。ただし、ソースコードは上記第1節および2節の | |
175 | + 条件に従いソフトウェアの交換で習慣的に使われる媒体で頒布しなければ | |
176 | + ならない。あるいは、 | |
177 | + | |
178 | + b) 著作物に、いかなる第三者に対しても、『プログラム』に対応した完 | |
179 | + 全かつ機械で読み取り可能なソースコードを、頒布に要する物理的コスト | |
180 | + を上回らない程度の手数料と引き換えに提供する旨述べた少なくとも3年 | |
181 | + 間は有効な書面になった申し出を添える。ただし、ソースコードは上記第 | |
182 | + 1節および2節の条件に従いソフトウェアの交換で習慣的に使われる媒体で | |
183 | + 頒布しなければならない。あるいは、 | |
184 | + | |
185 | + c) 対応するソースコード頒布の申し出に際して、あなたが得た情報を一 | |
186 | + 緒に引き渡す(この選択肢は、営利を目的としない頒布であって、かつあ | |
187 | + なたが上記小節bで指定されているような申し出と共にオブジェクトコー | |
188 | + ドあるいは実行形式のプログラムしか入手していない場合に限り許可され | |
189 | + る)。 | |
190 | + | |
191 | +著作物のソースコードとは、それに対して改変を加える上で好ましいとされる | |
192 | +著作物の形式を意味する。ある実行形式の著作物にとって完全なソースコード | |
193 | +とは、それが含むモジュールすべてのソースコード全部に加え、関連するイン | |
194 | +ターフェース定義ファイルのすべてとライブラリのコンパイルやインストール | |
195 | +を制御するために使われるスクリプトをも加えたものを意味する。しかし特別 | |
196 | +な例外として、そのコンポーネント自体が実行形式に付随するのでは無い限り、 | |
197 | +頒布されるものの中に、実行形式が実行されるオペレーティングシステムの主 | |
198 | +要なコンポーネント(コンパイラやカーネル等)と通常一緒に(ソースかバイナ | |
199 | +リ形式のどちらかで)頒布されるものを含んでいる必要はないとする。 | |
200 | + | |
201 | +実行形式またはオブジェクトコードの頒布が、指定された場所からコピーする | |
202 | +ためのアクセス手段を提供することで為されるとして、その上でソースコード | |
203 | +も同等のアクセス手段によって同じ場所からコピーできるようになっているな | |
204 | +らば、第三者がオブジェクトコードと一緒にソースも強制的にコピーさせられ | |
205 | +るようになっていなくてもソースコード頒布の条件を満たしているものとする。 | |
206 | + | |
207 | +4. あなたは『プログラム』を、この契約書において明確に提示された行 | |
208 | +為を除き複製や改変、サブライセンス、あるいは頒布してはならない。他に | |
209 | +『プログラム』を複製や改変、サブライセンス、あるいは頒布する企てはすべ | |
210 | +て無効であり、この契約書の下でのあなたの権利を自動的に終結させるこ | |
211 | +とになろう。しかし、複製物や権利をこの契約書に従ってあなたから得た | |
212 | +人々に関しては、そのような人々がこの契約書に完全に従っている限り彼 | |
213 | +らのライセンスまで終結することはない。 | |
214 | + | |
215 | +5. あなたはこの契約書を受諾する必要は無い。というのは、あなたはこ | |
216 | +れに署名していないからである。しかし、この契約書以外にあなたに対し | |
217 | +て『プログラム』やその派生物を変更、頒布する許可を与えるものは存在しな | |
218 | +い。これらの行為は、あなたがこの契約書を受け入れない限り法によって | |
219 | +禁じられている。そこで、『プログラム』(あるいは『プログラム』を基にし | |
220 | +た著作物のすべて)を改変ないし頒布することにより、あなたは自分がそのよ | |
221 | +うな行為を行うためにこの契約書を受諾したということ、そして『プログ | |
222 | +ラム』とそれに基づく著作物の複製や頒布、改変についてこの契約書が課 | |
223 | +す制約と条件をすべて受け入れたということを示したものと見なす。 | |
224 | + | |
225 | +6. あなたが『プログラム』(または『プログラム』を基にした著作物全般)を | |
226 | +再頒布するたびに、その受領者は元々のライセンス許可者から、この契約書で | |
227 | +指定された条件と制約の下で『プログラム』を複製や頒布、あるいは改変する | |
228 | +許可を自動的に得るものとする。あなたは、受領者がここで認められた権利を | |
229 | +行使することに関してこれ以上他のいかなる制限も課すことができない。あな | |
230 | +たには、第三者がこの契約書に従うことを強制する責任はない。 | |
231 | + | |
232 | +7. 特許侵害あるいはその他の理由(特許関係に限らない)から、裁判所の判決 | |
233 | +あるいは申し立ての結果としてあなたに(裁判所命令や契約などにより)この契 | |
234 | +約書の条件と矛盾する制約が課された場合でも、あなたがこの契約書の条件を | |
235 | +免除されるわけではない。もしこの契約書の下であなたに課せられた責任と他 | |
236 | +の関連する責任を同時に満たすような形で頒布できないならば、結果としてあ | |
237 | +なたは『プログラム』を頒布することが全くできないということである。例え | |
238 | +ば特許ライセンスが、あなたから直接間接を問わずコピーを受け取った人が誰 | |
239 | +でも『プログラム』を使用料無料で再頒布することを認めていない場合、あな | |
240 | +たがその制約とこの契約書を両方とも満たすには『プログラム』の頒布を完全 | |
241 | +に中止するしかないだろう。 | |
242 | + | |
243 | +この節の一部分が特定の状況の下で無効ないし実施不可能な場合でも、節の残 | |
244 | +りの部分は適用されるよう意図されている。その他の状況では節が全体として | |
245 | +適用されるよう意図されている。 | |
246 | + | |
247 | +特許やその他の財産権を侵害したり、そのような権利の主張の効力に異議を唱 | |
248 | +えたりするようあなたを誘惑することがこの節の目的ではない。この節には、 | |
249 | +人々によってライセンス慣行として実現されてきた、フリーソフトウェア頒布 | |
250 | +のシステムの完全性を護るという目的しかない。多くの人々が、フリーソフト | |
251 | +ウェアの頒布システムが首尾一貫して適用されているという信頼に基づき、こ | |
252 | +のシステムを通じて頒布される多様なソフトウェアに寛大な貢献をしてきたの | |
253 | +は事実であるが、人がどのようなシステムを通じてソフトウェアを頒布したい | |
254 | +と思うかはあくまでも作者/寄与者次第であり、あなたが選択を押しつけるこ | |
255 | +とはできない。 | |
256 | + | |
257 | +この節は、この契約書のこの節以外の部分の一帰結になると考えられるケー | |
258 | +スを徹底的に明らかにすることを目的としている。 | |
259 | + | |
260 | +8. 『プログラム』の頒布や利用が、ある国においては特許または著作権が主 | |
261 | +張されたインターフェースのいずれかによって制限されている場合、『プログ | |
262 | +ラム』にこの契約書を適用した元の著作権者は、そういった国々を排除し | |
263 | +た明確な地理的頒布制限を加え、そこで排除されていない国の中やそれらの国々 | |
264 | +の間でのみ頒布が許可されるようにしても構わない。その場合、そのような制 | |
265 | +限はこの契約書本文で書かれているのと同様に見なされる。 | |
266 | + | |
267 | +9. フリーソフトウェア財団は、時によって改訂または新版の一般公衆利用許 | |
268 | +諾書を発表することができる。そのような新版は現在のバージョンとその精神 | |
269 | +においては似たものになるだろうが、新たな問題や懸念を解決するため細部で | |
270 | +は異なる可能性がある。 | |
271 | + | |
272 | +それぞれのバージョンには、見分けが付くようにバージョン番号が振られてい | |
273 | +る。『プログラム』においてそれに適用されるこの契約書のバージョン番号が | |
274 | +指定されていて、更に「それ以降のいかなるバージョン」も適用して良いとなっ | |
275 | +ていた場合、あなたは従う条件と制約として、指定のバージョンか、フリーソ | |
276 | +フトウェア財団によって発行された指定のバージョン以降の版のどれか一つの | |
277 | +どちらかを選ぶことが出来る。『プログラム』でライセンスのバージョン番号 | |
278 | +が指定されていないならば、あなたは今までにフリーソフトウェア財団から発 | |
279 | +行されたバージョンの中から好きに選んで構わない。 | |
280 | + | |
281 | +10. もしあなたが『プログラム』の一部を、その頒布条件がこの契約書と | |
282 | +異なる他のフリーなプログラムと統合したいならば、作者に連絡して許可を求 | |
283 | +めよ。フリーソフトウェア財団が著作権を保有するソフトウェアについては、 | |
284 | +フリーソフトウェア財団に連絡せよ。私たちは、このような場合のために特別 | |
285 | +な例外を設けることもある。私たちが決定を下すにあたっては、私たちのフリー | |
286 | +ソフトウェアの派生物すべてがフリーな状態に保たれるということと、一般的 | |
287 | +にソフトウェアの共有と再利用を促進するという二つの目標を規準に検討され | |
288 | +るであろう。 | |
289 | + 無保証について | |
290 | + | |
291 | +11. 『プログラム』は代価無しに利用が許可されるので、適切な法が認める限 | |
292 | +りにおいて、『プログラム』に関するいかなる保証も存在しない。書面で別に | |
293 | +述べる場合を除いて、著作権者、またはその他の団体は、『プログラム』を、 | |
294 | +表明されたか言外にかは問わず、商業的適性を保証するほのめかしやある特定 | |
295 | +の目的への適合性(に限られない)を含む一切の保証無しに「あるがまま」で提 | |
296 | +供する。『プログラム』の質と性能に関するリスクのすべてはあなたに帰属す | |
297 | +る。『プログラム』に欠陥があると判明した場合、あなたは必要な保守点検や | |
298 | +補修、修正に要するコストのすべてを引き受けることになる。 | |
299 | + | |
300 | +12. 適切な法か書面での同意によって命ぜられない限り、著作権者、または上 | |
301 | +記で許可されている通りに『プログラム』を改変または再頒布したその他の団 | |
302 | +体は、あなたに対して『プログラム』の利用ないし利用不能で生じた一般的、 | |
303 | +特別的、偶然的、必然的な損害(データの消失や不正確な処理、あなたか第三 | |
304 | +者が被った損失、あるいは『プログラム』が他のソフトウェアと一緒に動作し | |
305 | +ないという不具合などを含むがそれらに限らない)に一切の責任を負わない。 | |
306 | +そのような損害が生ずる可能性について彼らが忠告されていたとしても同様で | |
307 | +ある。 | |
308 | + | |
309 | + 条件と制約終わり | |
310 | + | |
311 | + 以上の条項をあなたの新しいプログラムに適用する方法 | |
312 | + | |
313 | +あなたが新しいプログラムを開発したとして、公衆によってそれが利用される | |
314 | +可能性を最大にしたいなら、そのプログラムをこの契約書の条項に従って | |
315 | +誰でも再頒布あるいは変更できるようフリーソフトウェアにするのが最善です。 | |
316 | + | |
317 | +そのためには、プログラムに以下のような表示を添付してください。その場合、 | |
318 | +保証が排除されているということを最も効果的に伝えるために、それぞれのソー | |
319 | +スファイルの冒頭に表示を添付すれば最も安全です。少なくとも、「著作権表 | |
320 | +示」という行と全文がある場所へのポインタだけは各ファイルに含めて置いて | |
321 | +ください。 | |
322 | + | |
323 | + <one line to give the program's name and a brief idea of what it does.> | |
324 | + Copyright (C) <year> <name of author> | |
325 | + | |
326 | + This program is free software; you can redistribute it and/or modify | |
327 | + it under the terms of the GNU General Public License as published by | |
328 | + the Free Software Foundation; either version 2 of the License, or | |
329 | + (at your option) any later version. | |
330 | + | |
331 | + This program is distributed in the hope that it will be useful, | |
332 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
333 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
334 | + GNU General Public License for more details. | |
335 | + | |
336 | + You should have received a copy of the GNU General Public License | |
337 | + along with this program; if not, write to the Free Software | |
338 | + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
339 | + | |
340 | + (訳: | |
341 | + | |
342 | + <プログラムの名前と、それが何をするかについての簡単な説明。> | |
343 | + Copyright (C) <西暦年> <作者の名前> | |
344 | + | |
345 | + このプログラムはフリーソフトウェアです。あなたはこれを、フリーソフ | |
346 | + トウェア財団によって発行された GNU 一般公衆利用許諾契約書(バージョ | |
347 | + ン2か、希望によってはそれ以降のバージョンのうちどれか)の定める条件 | |
348 | + の下で再頒布または改変することができます。 | |
349 | + | |
350 | + このプログラムは有用であることを願って頒布されますが、*全くの無保 | |
351 | + 証* です。商業可能性の保証や特定の目的への適合性は、言外に示された | |
352 | + ものも含め全く存在しません。詳しくはGNU 一般公衆利用許諾契約書をご | |
353 | + 覧ください。 | |
354 | + | |
355 | + あなたはこのプログラムと共に、GNU 一般公衆利用許諾契約書の複製物を | |
356 | + 一部受け取ったはずです。もし受け取っていなければ、フリーソフトウェ | |
357 | + ア財団まで請求してください(宛先は the Free Software Foundation, | |
358 | + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA)。 | |
359 | + | |
360 | + ) | |
361 | + | |
362 | +電子ないし紙のメールであなたに問い合わせる方法についての情報も書き加え | |
363 | +ましょう。 | |
364 | + | |
365 | +プログラムが対話的なものならば、対話モードで起動した際に出力として以下 | |
366 | +のような短い告知が表示されるようにしてください: | |
367 | + | |
368 | + Gnomovision version 69, Copyright (C) year name of author | |
369 | + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
370 | + This is free software, and you are welcome to redistribute it | |
371 | + under certain conditions; type `show c' for details. | |
372 | + | |
373 | + (訳: | |
374 | + | |
375 | + Gnomovision バージョン 69, Copyright (C) 年 作者の名前 | |
376 | + Gnomovision は*全くの無保証*で提供されます。詳しくは「show w」 | |
377 | + とタイプして下さい。これはフリーソフトウェアであり、ある条件の下で | |
378 | + 再頒布することが奨励されています。詳しくは「show c」とタイプして下 | |
379 | + さい。 | |
380 | + | |
381 | + ) | |
382 | + | |
383 | +ここで、仮想的なコマンド「show w」と「show c」は一般公衆利用許諾契約書 | |
384 | +の適切な部分を表示するようになっていなければなりません。もちろん、あな | |
385 | +たが使うコマンドを「show w」や「show c」と呼ぶ必然性はありませんので、 | |
386 | +あなたのプログラムに合わせてマウスのクリックやメニューのアイテムにして | |
387 | +も結構です。 | |
388 | + | |
389 | +またあなたは、必要ならば(プログラマーとして働いていたら)あなたの雇用主、 | |
390 | +あるいは場合によっては学校から、そのプログラムに関する「著作権放棄声明 | |
391 | +(copyright disclaimer)」に署名してもらうべきです。以下は例ですので、名 | |
392 | +前を変えてください: | |
393 | + | |
394 | + Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |
395 | + `Gnomovision' (which makes passes at compilers) written by James Hacker. | |
396 | + | |
397 | + <signature of Ty Coon>, 1 April 1989 | |
398 | + Ty Coon, President of Vice | |
399 | + | |
400 | + (訳: | |
401 | + | |
402 | + Yoyodyne社はここに、James Hackerによって書かれたプログラム | |
403 | + 「Gnomovision」(コンパイラへ通すプログラム)に関する一切の著作権の利 | |
404 | + 益を放棄します。 | |
405 | + | |
406 | + <Ty Coon氏の署名>、1989年4月1日 | |
407 | + Ty Coon、副社長 | |
408 | + | |
409 | + ) | |
410 | + | |
411 | +この一般公衆利用許諾契約書では、あなたのプログラムを独占的なプログラム | |
412 | +に統合することを認めていません。あなたのプログラムがサブルーチンライブ | |
413 | +ラリならば、独占的なアプリケーションとあなたのライブラリをリンクするこ | |
414 | +とを許可したほうがより便利であると考えるかもしれません。もしこれがあな | |
415 | +たの望むことならば、この契約書の代わりにGNU ライブラリ一般公衆利用許諾 | |
416 | +契約書を適用してください。 |
@@ -0,0 +1,674 @@ | ||
1 | + GNU GENERAL PUBLIC LICENSE | |
2 | + Version 3, 29 June 2007 | |
3 | + | |
4 | + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
5 | + Everyone is permitted to copy and distribute verbatim copies | |
6 | + of this license document, but changing it is not allowed. | |
7 | + | |
8 | + Preamble | |
9 | + | |
10 | + The GNU General Public License is a free, copyleft license for | |
11 | +software and other kinds of works. | |
12 | + | |
13 | + The licenses for most software and other practical works are designed | |
14 | +to take away your freedom to share and change the works. By contrast, | |
15 | +the GNU General Public License is intended to guarantee your freedom to | |
16 | +share and change all versions of a program--to make sure it remains free | |
17 | +software for all its users. We, the Free Software Foundation, use the | |
18 | +GNU General Public License for most of our software; it applies also to | |
19 | +any other work released this way by its authors. You can apply it to | |
20 | +your programs, too. | |
21 | + | |
22 | + When we speak of free software, we are referring to freedom, not | |
23 | +price. Our General Public Licenses are designed to make sure that you | |
24 | +have the freedom to distribute copies of free software (and charge for | |
25 | +them if you wish), that you receive source code or can get it if you | |
26 | +want it, that you can change the software or use pieces of it in new | |
27 | +free programs, and that you know you can do these things. | |
28 | + | |
29 | + To protect your rights, we need to prevent others from denying you | |
30 | +these rights or asking you to surrender the rights. Therefore, you have | |
31 | +certain responsibilities if you distribute copies of the software, or if | |
32 | +you modify it: responsibilities to respect the freedom of others. | |
33 | + | |
34 | + For example, if you distribute copies of such a program, whether | |
35 | +gratis or for a fee, you must pass on to the recipients the same | |
36 | +freedoms that you received. You must make sure that they, too, receive | |
37 | +or can get the source code. And you must show them these terms so they | |
38 | +know their rights. | |
39 | + | |
40 | + Developers that use the GNU GPL protect your rights with two steps: | |
41 | +(1) assert copyright on the software, and (2) offer you this License | |
42 | +giving you legal permission to copy, distribute and/or modify it. | |
43 | + | |
44 | + For the developers' and authors' protection, the GPL clearly explains | |
45 | +that there is no warranty for this free software. For both users' and | |
46 | +authors' sake, the GPL requires that modified versions be marked as | |
47 | +changed, so that their problems will not be attributed erroneously to | |
48 | +authors of previous versions. | |
49 | + | |
50 | + Some devices are designed to deny users access to install or run | |
51 | +modified versions of the software inside them, although the manufacturer | |
52 | +can do so. This is fundamentally incompatible with the aim of | |
53 | +protecting users' freedom to change the software. The systematic | |
54 | +pattern of such abuse occurs in the area of products for individuals to | |
55 | +use, which is precisely where it is most unacceptable. Therefore, we | |
56 | +have designed this version of the GPL to prohibit the practice for those | |
57 | +products. If such problems arise substantially in other domains, we | |
58 | +stand ready to extend this provision to those domains in future versions | |
59 | +of the GPL, as needed to protect the freedom of users. | |
60 | + | |
61 | + Finally, every program is threatened constantly by software patents. | |
62 | +States should not allow patents to restrict development and use of | |
63 | +software on general-purpose computers, but in those that do, we wish to | |
64 | +avoid the special danger that patents applied to a free program could | |
65 | +make it effectively proprietary. To prevent this, the GPL assures that | |
66 | +patents cannot be used to render the program non-free. | |
67 | + | |
68 | + The precise terms and conditions for copying, distribution and | |
69 | +modification follow. | |
70 | + | |
71 | + TERMS AND CONDITIONS | |
72 | + | |
73 | + 0. Definitions. | |
74 | + | |
75 | + "This License" refers to version 3 of the GNU General Public License. | |
76 | + | |
77 | + "Copyright" also means copyright-like laws that apply to other kinds of | |
78 | +works, such as semiconductor masks. | |
79 | + | |
80 | + "The Program" refers to any copyrightable work licensed under this | |
81 | +License. Each licensee is addressed as "you". "Licensees" and | |
82 | +"recipients" may be individuals or organizations. | |
83 | + | |
84 | + To "modify" a work means to copy from or adapt all or part of the work | |
85 | +in a fashion requiring copyright permission, other than the making of an | |
86 | +exact copy. The resulting work is called a "modified version" of the | |
87 | +earlier work or a work "based on" the earlier work. | |
88 | + | |
89 | + A "covered work" means either the unmodified Program or a work based | |
90 | +on the Program. | |
91 | + | |
92 | + To "propagate" a work means to do anything with it that, without | |
93 | +permission, would make you directly or secondarily liable for | |
94 | +infringement under applicable copyright law, except executing it on a | |
95 | +computer or modifying a private copy. Propagation includes copying, | |
96 | +distribution (with or without modification), making available to the | |
97 | +public, and in some countries other activities as well. | |
98 | + | |
99 | + To "convey" a work means any kind of propagation that enables other | |
100 | +parties to make or receive copies. Mere interaction with a user through | |
101 | +a computer network, with no transfer of a copy, is not conveying. | |
102 | + | |
103 | + An interactive user interface displays "Appropriate Legal Notices" | |
104 | +to the extent that it includes a convenient and prominently visible | |
105 | +feature that (1) displays an appropriate copyright notice, and (2) | |
106 | +tells the user that there is no warranty for the work (except to the | |
107 | +extent that warranties are provided), that licensees may convey the | |
108 | +work under this License, and how to view a copy of this License. If | |
109 | +the interface presents a list of user commands or options, such as a | |
110 | +menu, a prominent item in the list meets this criterion. | |
111 | + | |
112 | + 1. Source Code. | |
113 | + | |
114 | + The "source code" for a work means the preferred form of the work | |
115 | +for making modifications to it. "Object code" means any non-source | |
116 | +form of a work. | |
117 | + | |
118 | + A "Standard Interface" means an interface that either is an official | |
119 | +standard defined by a recognized standards body, or, in the case of | |
120 | +interfaces specified for a particular programming language, one that | |
121 | +is widely used among developers working in that language. | |
122 | + | |
123 | + The "System Libraries" of an executable work include anything, other | |
124 | +than the work as a whole, that (a) is included in the normal form of | |
125 | +packaging a Major Component, but which is not part of that Major | |
126 | +Component, and (b) serves only to enable use of the work with that | |
127 | +Major Component, or to implement a Standard Interface for which an | |
128 | +implementation is available to the public in source code form. A | |
129 | +"Major Component", in this context, means a major essential component | |
130 | +(kernel, window system, and so on) of the specific operating system | |
131 | +(if any) on which the executable work runs, or a compiler used to | |
132 | +produce the work, or an object code interpreter used to run it. | |
133 | + | |
134 | + The "Corresponding Source" for a work in object code form means all | |
135 | +the source code needed to generate, install, and (for an executable | |
136 | +work) run the object code and to modify the work, including scripts to | |
137 | +control those activities. However, it does not include the work's | |
138 | +System Libraries, or general-purpose tools or generally available free | |
139 | +programs which are used unmodified in performing those activities but | |
140 | +which are not part of the work. For example, Corresponding Source | |
141 | +includes interface definition files associated with source files for | |
142 | +the work, and the source code for shared libraries and dynamically | |
143 | +linked subprograms that the work is specifically designed to require, | |
144 | +such as by intimate data communication or control flow between those | |
145 | +subprograms and other parts of the work. | |
146 | + | |
147 | + The Corresponding Source need not include anything that users | |
148 | +can regenerate automatically from other parts of the Corresponding | |
149 | +Source. | |
150 | + | |
151 | + The Corresponding Source for a work in source code form is that | |
152 | +same work. | |
153 | + | |
154 | + 2. Basic Permissions. | |
155 | + | |
156 | + All rights granted under this License are granted for the term of | |
157 | +copyright on the Program, and are irrevocable provided the stated | |
158 | +conditions are met. This License explicitly affirms your unlimited | |
159 | +permission to run the unmodified Program. The output from running a | |
160 | +covered work is covered by this License only if the output, given its | |
161 | +content, constitutes a covered work. This License acknowledges your | |
162 | +rights of fair use or other equivalent, as provided by copyright law. | |
163 | + | |
164 | + You may make, run and propagate covered works that you do not | |
165 | +convey, without conditions so long as your license otherwise remains | |
166 | +in force. You may convey covered works to others for the sole purpose | |
167 | +of having them make modifications exclusively for you, or provide you | |
168 | +with facilities for running those works, provided that you comply with | |
169 | +the terms of this License in conveying all material for which you do | |
170 | +not control copyright. Those thus making or running the covered works | |
171 | +for you must do so exclusively on your behalf, under your direction | |
172 | +and control, on terms that prohibit them from making any copies of | |
173 | +your copyrighted material outside their relationship with you. | |
174 | + | |
175 | + Conveying under any other circumstances is permitted solely under | |
176 | +the conditions stated below. Sublicensing is not allowed; section 10 | |
177 | +makes it unnecessary. | |
178 | + | |
179 | + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |
180 | + | |
181 | + No covered work shall be deemed part of an effective technological | |
182 | +measure under any applicable law fulfilling obligations under article | |
183 | +11 of the WIPO copyright treaty adopted on 20 December 1996, or | |
184 | +similar laws prohibiting or restricting circumvention of such | |
185 | +measures. | |
186 | + | |
187 | + When you convey a covered work, you waive any legal power to forbid | |
188 | +circumvention of technological measures to the extent such circumvention | |
189 | +is effected by exercising rights under this License with respect to | |
190 | +the covered work, and you disclaim any intention to limit operation or | |
191 | +modification of the work as a means of enforcing, against the work's | |
192 | +users, your or third parties' legal rights to forbid circumvention of | |
193 | +technological measures. | |
194 | + | |
195 | + 4. Conveying Verbatim Copies. | |
196 | + | |
197 | + You may convey verbatim copies of the Program's source code as you | |
198 | +receive it, in any medium, provided that you conspicuously and | |
199 | +appropriately publish on each copy an appropriate copyright notice; | |
200 | +keep intact all notices stating that this License and any | |
201 | +non-permissive terms added in accord with section 7 apply to the code; | |
202 | +keep intact all notices of the absence of any warranty; and give all | |
203 | +recipients a copy of this License along with the Program. | |
204 | + | |
205 | + You may charge any price or no price for each copy that you convey, | |
206 | +and you may offer support or warranty protection for a fee. | |
207 | + | |
208 | + 5. Conveying Modified Source Versions. | |
209 | + | |
210 | + You may convey a work based on the Program, or the modifications to | |
211 | +produce it from the Program, in the form of source code under the | |
212 | +terms of section 4, provided that you also meet all of these conditions: | |
213 | + | |
214 | + a) The work must carry prominent notices stating that you modified | |
215 | + it, and giving a relevant date. | |
216 | + | |
217 | + b) The work must carry prominent notices stating that it is | |
218 | + released under this License and any conditions added under section | |
219 | + 7. This requirement modifies the requirement in section 4 to | |
220 | + "keep intact all notices". | |
221 | + | |
222 | + c) You must license the entire work, as a whole, under this | |
223 | + License to anyone who comes into possession of a copy. This | |
224 | + License will therefore apply, along with any applicable section 7 | |
225 | + additional terms, to the whole of the work, and all its parts, | |
226 | + regardless of how they are packaged. This License gives no | |
227 | + permission to license the work in any other way, but it does not | |
228 | + invalidate such permission if you have separately received it. | |
229 | + | |
230 | + d) If the work has interactive user interfaces, each must display | |
231 | + Appropriate Legal Notices; however, if the Program has interactive | |
232 | + interfaces that do not display Appropriate Legal Notices, your | |
233 | + work need not make them do so. | |
234 | + | |
235 | + A compilation of a covered work with other separate and independent | |
236 | +works, which are not by their nature extensions of the covered work, | |
237 | +and which are not combined with it such as to form a larger program, | |
238 | +in or on a volume of a storage or distribution medium, is called an | |
239 | +"aggregate" if the compilation and its resulting copyright are not | |
240 | +used to limit the access or legal rights of the compilation's users | |
241 | +beyond what the individual works permit. Inclusion of a covered work | |
242 | +in an aggregate does not cause this License to apply to the other | |
243 | +parts of the aggregate. | |
244 | + | |
245 | + 6. Conveying Non-Source Forms. | |
246 | + | |
247 | + You may convey a covered work in object code form under the terms | |
248 | +of sections 4 and 5, provided that you also convey the | |
249 | +machine-readable Corresponding Source under the terms of this License, | |
250 | +in one of these ways: | |
251 | + | |
252 | + a) Convey the object code in, or embodied in, a physical product | |
253 | + (including a physical distribution medium), accompanied by the | |
254 | + Corresponding Source fixed on a durable physical medium | |
255 | + customarily used for software interchange. | |
256 | + | |
257 | + b) Convey the object code in, or embodied in, a physical product | |
258 | + (including a physical distribution medium), accompanied by a | |
259 | + written offer, valid for at least three years and valid for as | |
260 | + long as you offer spare parts or customer support for that product | |
261 | + model, to give anyone who possesses the object code either (1) a | |
262 | + copy of the Corresponding Source for all the software in the | |
263 | + product that is covered by this License, on a durable physical | |
264 | + medium customarily used for software interchange, for a price no | |
265 | + more than your reasonable cost of physically performing this | |
266 | + conveying of source, or (2) access to copy the | |
267 | + Corresponding Source from a network server at no charge. | |
268 | + | |
269 | + c) Convey individual copies of the object code with a copy of the | |
270 | + written offer to provide the Corresponding Source. This | |
271 | + alternative is allowed only occasionally and noncommercially, and | |
272 | + only if you received the object code with such an offer, in accord | |
273 | + with subsection 6b. | |
274 | + | |
275 | + d) Convey the object code by offering access from a designated | |
276 | + place (gratis or for a charge), and offer equivalent access to the | |
277 | + Corresponding Source in the same way through the same place at no | |
278 | + further charge. You need not require recipients to copy the | |
279 | + Corresponding Source along with the object code. If the place to | |
280 | + copy the object code is a network server, the Corresponding Source | |
281 | + may be on a different server (operated by you or a third party) | |
282 | + that supports equivalent copying facilities, provided you maintain | |
283 | + clear directions next to the object code saying where to find the | |
284 | + Corresponding Source. Regardless of what server hosts the | |
285 | + Corresponding Source, you remain obligated to ensure that it is | |
286 | + available for as long as needed to satisfy these requirements. | |
287 | + | |
288 | + e) Convey the object code using peer-to-peer transmission, provided | |
289 | + you inform other peers where the object code and Corresponding | |
290 | + Source of the work are being offered to the general public at no | |
291 | + charge under subsection 6d. | |
292 | + | |
293 | + A separable portion of the object code, whose source code is excluded | |
294 | +from the Corresponding Source as a System Library, need not be | |
295 | +included in conveying the object code work. | |
296 | + | |
297 | + A "User Product" is either (1) a "consumer product", which means any | |
298 | +tangible personal property which is normally used for personal, family, | |
299 | +or household purposes, or (2) anything designed or sold for incorporation | |
300 | +into a dwelling. In determining whether a product is a consumer product, | |
301 | +doubtful cases shall be resolved in favor of coverage. For a particular | |
302 | +product received by a particular user, "normally used" refers to a | |
303 | +typical or common use of that class of product, regardless of the status | |
304 | +of the particular user or of the way in which the particular user | |
305 | +actually uses, or expects or is expected to use, the product. A product | |
306 | +is a consumer product regardless of whether the product has substantial | |
307 | +commercial, industrial or non-consumer uses, unless such uses represent | |
308 | +the only significant mode of use of the product. | |
309 | + | |
310 | + "Installation Information" for a User Product means any methods, | |
311 | +procedures, authorization keys, or other information required to install | |
312 | +and execute modified versions of a covered work in that User Product from | |
313 | +a modified version of its Corresponding Source. The information must | |
314 | +suffice to ensure that the continued functioning of the modified object | |
315 | +code is in no case prevented or interfered with solely because | |
316 | +modification has been made. | |
317 | + | |
318 | + If you convey an object code work under this section in, or with, or | |
319 | +specifically for use in, a User Product, and the conveying occurs as | |
320 | +part of a transaction in which the right of possession and use of the | |
321 | +User Product is transferred to the recipient in perpetuity or for a | |
322 | +fixed term (regardless of how the transaction is characterized), the | |
323 | +Corresponding Source conveyed under this section must be accompanied | |
324 | +by the Installation Information. But this requirement does not apply | |
325 | +if neither you nor any third party retains the ability to install | |
326 | +modified object code on the User Product (for example, the work has | |
327 | +been installed in ROM). | |
328 | + | |
329 | + The requirement to provide Installation Information does not include a | |
330 | +requirement to continue to provide support service, warranty, or updates | |
331 | +for a work that has been modified or installed by the recipient, or for | |
332 | +the User Product in which it has been modified or installed. Access to a | |
333 | +network may be denied when the modification itself materially and | |
334 | +adversely affects the operation of the network or violates the rules and | |
335 | +protocols for communication across the network. | |
336 | + | |
337 | + Corresponding Source conveyed, and Installation Information provided, | |
338 | +in accord with this section must be in a format that is publicly | |
339 | +documented (and with an implementation available to the public in | |
340 | +source code form), and must require no special password or key for | |
341 | +unpacking, reading or copying. | |
342 | + | |
343 | + 7. Additional Terms. | |
344 | + | |
345 | + "Additional permissions" are terms that supplement the terms of this | |
346 | +License by making exceptions from one or more of its conditions. | |
347 | +Additional permissions that are applicable to the entire Program shall | |
348 | +be treated as though they were included in this License, to the extent | |
349 | +that they are valid under applicable law. If additional permissions | |
350 | +apply only to part of the Program, that part may be used separately | |
351 | +under those permissions, but the entire Program remains governed by | |
352 | +this License without regard to the additional permissions. | |
353 | + | |
354 | + When you convey a copy of a covered work, you may at your option | |
355 | +remove any additional permissions from that copy, or from any part of | |
356 | +it. (Additional permissions may be written to require their own | |
357 | +removal in certain cases when you modify the work.) You may place | |
358 | +additional permissions on material, added by you to a covered work, | |
359 | +for which you have or can give appropriate copyright permission. | |
360 | + | |
361 | + Notwithstanding any other provision of this License, for material you | |
362 | +add to a covered work, you may (if authorized by the copyright holders of | |
363 | +that material) supplement the terms of this License with terms: | |
364 | + | |
365 | + a) Disclaiming warranty or limiting liability differently from the | |
366 | + terms of sections 15 and 16 of this License; or | |
367 | + | |
368 | + b) Requiring preservation of specified reasonable legal notices or | |
369 | + author attributions in that material or in the Appropriate Legal | |
370 | + Notices displayed by works containing it; or | |
371 | + | |
372 | + c) Prohibiting misrepresentation of the origin of that material, or | |
373 | + requiring that modified versions of such material be marked in | |
374 | + reasonable ways as different from the original version; or | |
375 | + | |
376 | + d) Limiting the use for publicity purposes of names of licensors or | |
377 | + authors of the material; or | |
378 | + | |
379 | + e) Declining to grant rights under trademark law for use of some | |
380 | + trade names, trademarks, or service marks; or | |
381 | + | |
382 | + f) Requiring indemnification of licensors and authors of that | |
383 | + material by anyone who conveys the material (or modified versions of | |
384 | + it) with contractual assumptions of liability to the recipient, for | |
385 | + any liability that these contractual assumptions directly impose on | |
386 | + those licensors and authors. | |
387 | + | |
388 | + All other non-permissive additional terms are considered "further | |
389 | +restrictions" within the meaning of section 10. If the Program as you | |
390 | +received it, or any part of it, contains a notice stating that it is | |
391 | +governed by this License along with a term that is a further | |
392 | +restriction, you may remove that term. If a license document contains | |
393 | +a further restriction but permits relicensing or conveying under this | |
394 | +License, you may add to a covered work material governed by the terms | |
395 | +of that license document, provided that the further restriction does | |
396 | +not survive such relicensing or conveying. | |
397 | + | |
398 | + If you add terms to a covered work in accord with this section, you | |
399 | +must place, in the relevant source files, a statement of the | |
400 | +additional terms that apply to those files, or a notice indicating | |
401 | +where to find the applicable terms. | |
402 | + | |
403 | + Additional terms, permissive or non-permissive, may be stated in the | |
404 | +form of a separately written license, or stated as exceptions; | |
405 | +the above requirements apply either way. | |
406 | + | |
407 | + 8. Termination. | |
408 | + | |
409 | + You may not propagate or modify a covered work except as expressly | |
410 | +provided under this License. Any attempt otherwise to propagate or | |
411 | +modify it is void, and will automatically terminate your rights under | |
412 | +this License (including any patent licenses granted under the third | |
413 | +paragraph of section 11). | |
414 | + | |
415 | + However, if you cease all violation of this License, then your | |
416 | +license from a particular copyright holder is reinstated (a) | |
417 | +provisionally, unless and until the copyright holder explicitly and | |
418 | +finally terminates your license, and (b) permanently, if the copyright | |
419 | +holder fails to notify you of the violation by some reasonable means | |
420 | +prior to 60 days after the cessation. | |
421 | + | |
422 | + Moreover, your license from a particular copyright holder is | |
423 | +reinstated permanently if the copyright holder notifies you of the | |
424 | +violation by some reasonable means, this is the first time you have | |
425 | +received notice of violation of this License (for any work) from that | |
426 | +copyright holder, and you cure the violation prior to 30 days after | |
427 | +your receipt of the notice. | |
428 | + | |
429 | + Termination of your rights under this section does not terminate the | |
430 | +licenses of parties who have received copies or rights from you under | |
431 | +this License. If your rights have been terminated and not permanently | |
432 | +reinstated, you do not qualify to receive new licenses for the same | |
433 | +material under section 10. | |
434 | + | |
435 | + 9. Acceptance Not Required for Having Copies. | |
436 | + | |
437 | + You are not required to accept this License in order to receive or | |
438 | +run a copy of the Program. Ancillary propagation of a covered work | |
439 | +occurring solely as a consequence of using peer-to-peer transmission | |
440 | +to receive a copy likewise does not require acceptance. However, | |
441 | +nothing other than this License grants you permission to propagate or | |
442 | +modify any covered work. These actions infringe copyright if you do | |
443 | +not accept this License. Therefore, by modifying or propagating a | |
444 | +covered work, you indicate your acceptance of this License to do so. | |
445 | + | |
446 | + 10. Automatic Licensing of Downstream Recipients. | |
447 | + | |
448 | + Each time you convey a covered work, the recipient automatically | |
449 | +receives a license from the original licensors, to run, modify and | |
450 | +propagate that work, subject to this License. You are not responsible | |
451 | +for enforcing compliance by third parties with this License. | |
452 | + | |
453 | + An "entity transaction" is a transaction transferring control of an | |
454 | +organization, or substantially all assets of one, or subdividing an | |
455 | +organization, or merging organizations. If propagation of a covered | |
456 | +work results from an entity transaction, each party to that | |
457 | +transaction who receives a copy of the work also receives whatever | |
458 | +licenses to the work the party's predecessor in interest had or could | |
459 | +give under the previous paragraph, plus a right to possession of the | |
460 | +Corresponding Source of the work from the predecessor in interest, if | |
461 | +the predecessor has it or can get it with reasonable efforts. | |
462 | + | |
463 | + You may not impose any further restrictions on the exercise of the | |
464 | +rights granted or affirmed under this License. For example, you may | |
465 | +not impose a license fee, royalty, or other charge for exercise of | |
466 | +rights granted under this License, and you may not initiate litigation | |
467 | +(including a cross-claim or counterclaim in a lawsuit) alleging that | |
468 | +any patent claim is infringed by making, using, selling, offering for | |
469 | +sale, or importing the Program or any portion of it. | |
470 | + | |
471 | + 11. Patents. | |
472 | + | |
473 | + A "contributor" is a copyright holder who authorizes use under this | |
474 | +License of the Program or a work on which the Program is based. The | |
475 | +work thus licensed is called the contributor's "contributor version". | |
476 | + | |
477 | + A contributor's "essential patent claims" are all patent claims | |
478 | +owned or controlled by the contributor, whether already acquired or | |
479 | +hereafter acquired, that would be infringed by some manner, permitted | |
480 | +by this License, of making, using, or selling its contributor version, | |
481 | +but do not include claims that would be infringed only as a | |
482 | +consequence of further modification of the contributor version. For | |
483 | +purposes of this definition, "control" includes the right to grant | |
484 | +patent sublicenses in a manner consistent with the requirements of | |
485 | +this License. | |
486 | + | |
487 | + Each contributor grants you a non-exclusive, worldwide, royalty-free | |
488 | +patent license under the contributor's essential patent claims, to | |
489 | +make, use, sell, offer for sale, import and otherwise run, modify and | |
490 | +propagate the contents of its contributor version. | |
491 | + | |
492 | + In the following three paragraphs, a "patent license" is any express | |
493 | +agreement or commitment, however denominated, not to enforce a patent | |
494 | +(such as an express permission to practice a patent or covenant not to | |
495 | +sue for patent infringement). To "grant" such a patent license to a | |
496 | +party means to make such an agreement or commitment not to enforce a | |
497 | +patent against the party. | |
498 | + | |
499 | + If you convey a covered work, knowingly relying on a patent license, | |
500 | +and the Corresponding Source of the work is not available for anyone | |
501 | +to copy, free of charge and under the terms of this License, through a | |
502 | +publicly available network server or other readily accessible means, | |
503 | +then you must either (1) cause the Corresponding Source to be so | |
504 | +available, or (2) arrange to deprive yourself of the benefit of the | |
505 | +patent license for this particular work, or (3) arrange, in a manner | |
506 | +consistent with the requirements of this License, to extend the patent | |
507 | +license to downstream recipients. "Knowingly relying" means you have | |
508 | +actual knowledge that, but for the patent license, your conveying the | |
509 | +covered work in a country, or your recipient's use of the covered work | |
510 | +in a country, would infringe one or more identifiable patents in that | |
511 | +country that you have reason to believe are valid. | |
512 | + | |
513 | + If, pursuant to or in connection with a single transaction or | |
514 | +arrangement, you convey, or propagate by procuring conveyance of, a | |
515 | +covered work, and grant a patent license to some of the parties | |
516 | +receiving the covered work authorizing them to use, propagate, modify | |
517 | +or convey a specific copy of the covered work, then the patent license | |
518 | +you grant is automatically extended to all recipients of the covered | |
519 | +work and works based on it. | |
520 | + | |
521 | + A patent license is "discriminatory" if it does not include within | |
522 | +the scope of its coverage, prohibits the exercise of, or is | |
523 | +conditioned on the non-exercise of one or more of the rights that are | |
524 | +specifically granted under this License. You may not convey a covered | |
525 | +work if you are a party to an arrangement with a third party that is | |
526 | +in the business of distributing software, under which you make payment | |
527 | +to the third party based on the extent of your activity of conveying | |
528 | +the work, and under which the third party grants, to any of the | |
529 | +parties who would receive the covered work from you, a discriminatory | |
530 | +patent license (a) in connection with copies of the covered work | |
531 | +conveyed by you (or copies made from those copies), or (b) primarily | |
532 | +for and in connection with specific products or compilations that | |
533 | +contain the covered work, unless you entered into that arrangement, | |
534 | +or that patent license was granted, prior to 28 March 2007. | |
535 | + | |
536 | + Nothing in this License shall be construed as excluding or limiting | |
537 | +any implied license or other defenses to infringement that may | |
538 | +otherwise be available to you under applicable patent law. | |
539 | + | |
540 | + 12. No Surrender of Others' Freedom. | |
541 | + | |
542 | + If conditions are imposed on you (whether by court order, agreement or | |
543 | +otherwise) that contradict the conditions of this License, they do not | |
544 | +excuse you from the conditions of this License. If you cannot convey a | |
545 | +covered work so as to satisfy simultaneously your obligations under this | |
546 | +License and any other pertinent obligations, then as a consequence you may | |
547 | +not convey it at all. For example, if you agree to terms that obligate you | |
548 | +to collect a royalty for further conveying from those to whom you convey | |
549 | +the Program, the only way you could satisfy both those terms and this | |
550 | +License would be to refrain entirely from conveying the Program. | |
551 | + | |
552 | + 13. Use with the GNU Affero General Public License. | |
553 | + | |
554 | + Notwithstanding any other provision of this License, you have | |
555 | +permission to link or combine any covered work with a work licensed | |
556 | +under version 3 of the GNU Affero General Public License into a single | |
557 | +combined work, and to convey the resulting work. The terms of this | |
558 | +License will continue to apply to the part which is the covered work, | |
559 | +but the special requirements of the GNU Affero General Public License, | |
560 | +section 13, concerning interaction through a network will apply to the | |
561 | +combination as such. | |
562 | + | |
563 | + 14. Revised Versions of this License. | |
564 | + | |
565 | + The Free Software Foundation may publish revised and/or new versions of | |
566 | +the GNU General Public License from time to time. Such new versions will | |
567 | +be similar in spirit to the present version, but may differ in detail to | |
568 | +address new problems or concerns. | |
569 | + | |
570 | + Each version is given a distinguishing version number. If the | |
571 | +Program specifies that a certain numbered version of the GNU General | |
572 | +Public License "or any later version" applies to it, you have the | |
573 | +option of following the terms and conditions either of that numbered | |
574 | +version or of any later version published by the Free Software | |
575 | +Foundation. If the Program does not specify a version number of the | |
576 | +GNU General Public License, you may choose any version ever published | |
577 | +by the Free Software Foundation. | |
578 | + | |
579 | + If the Program specifies that a proxy can decide which future | |
580 | +versions of the GNU General Public License can be used, that proxy's | |
581 | +public statement of acceptance of a version permanently authorizes you | |
582 | +to choose that version for the Program. | |
583 | + | |
584 | + Later license versions may give you additional or different | |
585 | +permissions. However, no additional obligations are imposed on any | |
586 | +author or copyright holder as a result of your choosing to follow a | |
587 | +later version. | |
588 | + | |
589 | + 15. Disclaimer of Warranty. | |
590 | + | |
591 | + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |
592 | +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |
593 | +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |
594 | +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |
595 | +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
596 | +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |
597 | +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |
598 | +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
599 | + | |
600 | + 16. Limitation of Liability. | |
601 | + | |
602 | + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
603 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |
604 | +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |
605 | +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |
606 | +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |
607 | +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |
608 | +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |
609 | +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |
610 | +SUCH DAMAGES. | |
611 | + | |
612 | + 17. Interpretation of Sections 15 and 16. | |
613 | + | |
614 | + If the disclaimer of warranty and limitation of liability provided | |
615 | +above cannot be given local legal effect according to their terms, | |
616 | +reviewing courts shall apply local law that most closely approximates | |
617 | +an absolute waiver of all civil liability in connection with the | |
618 | +Program, unless a warranty or assumption of liability accompanies a | |
619 | +copy of the Program in return for a fee. | |
620 | + | |
621 | + END OF TERMS AND CONDITIONS | |
622 | + | |
623 | + How to Apply These Terms to Your New Programs | |
624 | + | |
625 | + If you develop a new program, and you want it to be of the greatest | |
626 | +possible use to the public, the best way to achieve this is to make it | |
627 | +free software which everyone can redistribute and change under these terms. | |
628 | + | |
629 | + To do so, attach the following notices to the program. It is safest | |
630 | +to attach them to the start of each source file to most effectively | |
631 | +state the exclusion of warranty; and each file should have at least | |
632 | +the "copyright" line and a pointer to where the full notice is found. | |
633 | + | |
634 | + <one line to give the program's name and a brief idea of what it does.> | |
635 | + Copyright (C) <year> <name of author> | |
636 | + | |
637 | + This program is free software: you can redistribute it and/or modify | |
638 | + it under the terms of the GNU General Public License as published by | |
639 | + the Free Software Foundation, either version 3 of the License, or | |
640 | + (at your option) any later version. | |
641 | + | |
642 | + This program is distributed in the hope that it will be useful, | |
643 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
644 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
645 | + GNU General Public License for more details. | |
646 | + | |
647 | + You should have received a copy of the GNU General Public License | |
648 | + along with this program. If not, see <http://www.gnu.org/licenses/>. | |
649 | + | |
650 | +Also add information on how to contact you by electronic and paper mail. | |
651 | + | |
652 | + If the program does terminal interaction, make it output a short | |
653 | +notice like this when it starts in an interactive mode: | |
654 | + | |
655 | + <program> Copyright (C) <year> <name of author> | |
656 | + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
657 | + This is free software, and you are welcome to redistribute it | |
658 | + under certain conditions; type `show c' for details. | |
659 | + | |
660 | +The hypothetical commands `show w' and `show c' should show the appropriate | |
661 | +parts of the General Public License. Of course, your program's commands | |
662 | +might be different; for a GUI interface, you would use an "about box". | |
663 | + | |
664 | + You should also get your employer (if you work as a programmer) or school, | |
665 | +if any, to sign a "copyright disclaimer" for the program, if necessary. | |
666 | +For more information on this, and how to apply and follow the GNU GPL, see | |
667 | +<http://www.gnu.org/licenses/>. | |
668 | + | |
669 | + The GNU General Public License does not permit incorporating your program | |
670 | +into proprietary programs. If your program is a subroutine library, you | |
671 | +may consider it more useful to permit linking proprietary applications with | |
672 | +the library. If this is what you want to do, use the GNU Lesser General | |
673 | +Public License instead of this License. But first, please read | |
674 | +<http://www.gnu.org/philosophy/why-not-lgpl.html>. |