Changeset 19278
- Timestamp:
- 09/14/08 10:43:06 (5 years ago)
- Location:
- lang/cplusplus/i3
- Files:
-
- 6 modified
- 1 moved
-
TODO.txt (modified) (2 diffs)
-
intl/wlibintl.h (modified) (4 diffs)
-
src/LibintlConfig.h (moved) (moved from lang/cplusplus/i3/src/LibintlUtf16le.h) (1 prop)
-
src/gui-windows/Gui.h (modified) (1 diff)
-
src/os-windows/Os.cpp (modified) (1 diff)
-
windows/i3.vcproj (modified) (2 diffs)
-
windows/i3_test.vcproj (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/cplusplus/i3/TODO.txt
r19273 r19278 1 妄幻夢想白昼夢.txt1 妄幻夢想白昼夢.txt 2 2 3 3 *(a|b|c|k|z)shと同じkey打ちで、同じ効果!、でも補完は親切に! … … 48 48 *utf8 cygwinでもテストする 49 49 *アプリケーションログを取りたい 50 *MBCS版はlibintl.dllも別ビルド -
lang/cplusplus/i3/intl/wlibintl.h
r19274 r19278 3 3 4 4 #include <windows.h> 5 #define WINDOWS_PATH_MAX_ELEMENTS 4000 5 6 #define WLIBINTL_WINDOWS_PATH_MAX_ELEMENTS 4000 6 7 7 8 #define WLIBINTL_UTF8_TO_UTF16LE_ALLOCA(data8, data16) \ 8 WCHAR* data16 = NULL; \9 wchar_t* data16 = NULL; \ 9 10 do { \ 10 const char* check = data8; \11 const char* check = data8; check; \ 11 12 unsigned int num_elements = MultiByteToWideChar(CP_UTF8, 0, data8, -1, NULL, 0); \ 12 13 if (num_elements == 0 || num_elements >= WINDOWS_PATH_MAX_ELEMENTS) { \ … … 23 24 char* data8 = NULL; \ 24 25 do { \ 25 const WCHAR* check = data16;\26 const wchar_t* check = data16; check; \ 26 27 unsigned int num_elements = WideCharToMultiByte( CP_UTF8, 0, data16, -1, NULL, 0, 0, 0); \ 27 28 if (num_elements == 0 || num_elements >= WINDOWS_PATH_MAX_ELEMENTS) { \ … … 35 36 } while (0) 36 37 37 static inline const WCHAR* wbindtextdomain(const char* domainname,38 const WCHAR* dirname16) {38 static const wchar_t* wbindtextdomain(const char* domainname, 39 const wchar_t* dirname16) { 39 40 WLIBINTL_UTF16LE_TO_UTF8_ALLOCA(dirname16, dirname8); 40 41 if (dirname8 == NULL) { … … 47 48 } 48 49 50 51 //#define _(String) (wgettext(String, L##String)) 52 static const wchar_t* wgettext(const char* msgid, const wchar_t* wmsgid) 53 { 54 const char* translated = gettext(msgid); 55 return translated != msgid ? (const wchar_t*)translated : wmsgid; 56 } 57 58 59 #ifdef __cplusplus 60 61 template <size_t Size1, size_t Size2> 62 static inline const wchar_t* wgettext(const char (&msgid)[Size1], const wchar_t (&wmsgid)[Size2]) 63 { 64 char a[Size1 == 0 ? 1 : -1]; 65 char b[Size1 == Size2 ? 1 : -1]; 66 a,b; 67 68 return wgettext((const char*)msgid, (const wchar_t*)wmsgid); 69 } 70 71 #endif 72 49 73 //undef WINDOWS_PATH_MAX_ELEMENTS 50 74 //undef UTF8_TO_UTF16LE_ALLOCA 51 75 52 53 76 #endif // WLIBINTL_H_4985016 -
lang/cplusplus/i3/src/LibintlConfig.h
-
lang/cplusplus/i3/src/gui-windows/Gui.h
r19233 r19278 2 2 3 3 #include "../os-windows/WindowsCommon.h" 4 5 #if defined(UNICODE) || defined(_UNICODE)6 #define _(String) (reinterpret_cast<const TCHAR*>(i3::gettext_utf16(String, L##String)))7 #else8 #define _(String) (reinterpret_cast<const TCHAR*>(gettext(String)))9 #endif10 4 11 5 namespace i3 -
lang/cplusplus/i3/src/os-windows/Os.cpp
r18928 r19278 4 4 namespace i3 5 5 { 6 void init_windows_gettext() 7 { 8 using namespace std; 9 10 TCHAR locale_dir[1000] = {}; 11 DWORD result = GetModuleFileName( 12 GetModuleHandle(NULL), 13 locale_dir, 14 _countof(locale_dir)); 15 if (result == 0 || result == _countof(locale_dir)) // error 16 { 17 return; 18 } 19 if (PathRemoveFileSpec(locale_dir) == FALSE) 20 { 21 return; 22 } 23 if (0 != _tcscat_s(locale_dir, _T("\\locale"))) 24 { 25 return; 26 } 27 28 setlocale(LC_ALL, ""); 29 30 #if defined(UNICODE) || defined(_UNICODE) 31 wbindtextdomain(PACKAGE_NAME, locale_dir); 32 bind_textdomain_codeset(PACKAGE_NAME,"UTF-16LE"); 33 #else 34 bindtextdomain(PACKAGE_NAME, locale_dir); 35 #endif 36 37 textdomain(PACKAGE_NAME); 38 } 39 6 40 void init_os_global_data(int& argc,char**& argv) 7 41 { -
lang/cplusplus/i3/windows/i3.vcproj
r18001 r19278 374 374 </File> 375 375 <File 376 RelativePath="..\src\windows\CompletionWindowCore.h" 377 > 378 </File> 379 <File 376 380 RelativePath="..\src\gui-windows\CompletionWindowCore.h" 377 381 > 378 382 </File> 379 383 <File 380 RelativePath="..\src\windows\CompletionWindowCore.h"381 >382 </File>383 <File384 384 RelativePath="..\src\os-windows\CygwinPty.h" 385 385 > … … 406 406 </File> 407 407 <File 408 RelativePath="..\src\windows\InputWindowCore.h" 409 > 410 </File> 411 <File 408 412 RelativePath="..\src\gui-windows\InputWindowCore.h" 409 >410 </File>411 <File412 RelativePath="..\src\windows\InputWindowCore.h"413 413 > 414 414 </File> -
lang/cplusplus/i3/windows/i3_test.vcproj
r19216 r19278 329 329 </File> 330 330 <File 331 RelativePath="..\src\LibintlUtf16le.cpp"332 >333 </File>334 <File335 331 RelativePath="..\src\Mediator.cpp" 336 332 > … … 403 399 </File> 404 400 <File 401 RelativePath="..\src\gui-windows\CompletionWindowCore.h" 402 > 403 </File> 404 <File 405 405 RelativePath="..\src\windows\CompletionWindowCore.h" 406 406 > 407 407 </File> 408 408 <File 409 RelativePath="..\src\gui-windows\CompletionWindowCore.h"410 >411 </File>412 <File413 409 RelativePath="..\src\os-windows\CygwinPty.h" 414 410 > … … 468 464 <File 469 465 RelativePath="..\src\os-windows\WindowsCommon.h" 466 > 467 </File> 468 <File 469 RelativePath="..\intl\wlibintl.h" 470 470 > 471 471 </File>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)