Mercurial > dwindows
comparison os2/dw.c @ 1689:3fb7002e4de6
Unicode (UTF-8) mode on OS/2 as noted to me by Alex Taylor comes with
a performance hit, so you can disable Unicode mode by removing -DUNICODE.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 30 Apr 2012 17:13:16 +0000 |
parents | 72ac6eb33d76 |
children | 0f4bbb78f149 |
comparison
equal
deleted
inserted
replaced
1688:72ac6eb33d76 | 1689:3fb7002e4de6 |
---|---|
4056 _getcwd(_dw_exec_dir, MAX_PATH); | 4056 _getcwd(_dw_exec_dir, MAX_PATH); |
4057 | 4057 |
4058 if(newthread) | 4058 if(newthread) |
4059 { | 4059 { |
4060 dwhab = WinInitialize(0); | 4060 dwhab = WinInitialize(0); |
4061 dwhmq = WinCreateMsgQueue(dwhab, 0); | 4061 dwhmq = WinCreateMsgQueue(dwhab, 0); |
4062 #ifdef UNICODE | |
4062 /* Set the codepage to 1208 (UTF-8) */ | 4063 /* Set the codepage to 1208 (UTF-8) */ |
4063 WinSetCp(dwhmq, 1208); | 4064 WinSetCp(dwhmq, 1208); |
4065 #endif | |
4064 } | 4066 } |
4065 | 4067 |
4066 rc = WinRegisterClass(dwhab, (PSZ)ClassName, _wndproc, CS_SIZEREDRAW | CS_CLIPCHILDREN, 32); | 4068 rc = WinRegisterClass(dwhab, (PSZ)ClassName, _wndproc, CS_SIZEREDRAW | CS_CLIPCHILDREN, 32); |
4067 rc = WinRegisterClass(dwhab, (PSZ)SplitbarClassName, _splitwndproc, 0L, 32); | 4069 rc = WinRegisterClass(dwhab, (PSZ)SplitbarClassName, _splitwndproc, 0L, 32); |
4068 rc = WinRegisterClass(dwhab, (PSZ)ScrollClassName, _scrollwndproc, 0L, 32); | 4070 rc = WinRegisterClass(dwhab, (PSZ)ScrollClassName, _scrollwndproc, 0L, 32); |
4619 { | 4621 { |
4620 strcpy(buf, currfont); | 4622 strcpy(buf, currfont); |
4621 strcpy(fd.fAttrs.szFacename, currfont); | 4623 strcpy(fd.fAttrs.szFacename, currfont); |
4622 } | 4624 } |
4623 } | 4625 } |
4624 fd.fAttrs.usCodePage = 1208; | 4626 #ifdef UNICODE |
4627 fd.fAttrs.usCodePage = 1208; | |
4628 #endif | |
4625 fd.fAttrs.usRecordLength = sizeof(FATTRS); | 4629 fd.fAttrs.usRecordLength = sizeof(FATTRS); |
4626 | 4630 |
4627 /* Fill in the font dialog struct */ | 4631 /* Fill in the font dialog struct */ |
4628 fd.cbSize = sizeof(fd); | 4632 fd.cbSize = sizeof(fd); |
4629 fd.hpsScreen = WinGetScreenPS(HWND_DESKTOP); | 4633 fd.hpsScreen = WinGetScreenPS(HWND_DESKTOP); |
9864 | 9868 |
9865 memset(&fat, 0, sizeof(fat)); | 9869 memset(&fat, 0, sizeof(fat)); |
9866 | 9870 |
9867 fat.usRecordLength = sizeof(FATTRS); | 9871 fat.usRecordLength = sizeof(FATTRS); |
9868 fat.lMatch = fm.lMatch; | 9872 fat.lMatch = fm.lMatch; |
9873 #ifdef UNICODE | |
9869 fat.usCodePage = 1208; | 9874 fat.usCodePage = 1208; |
9875 #endif | |
9870 strcpy(fat.szFacename, fm.szFacename); | 9876 strcpy(fat.szFacename, fm.szFacename); |
9871 | 9877 |
9872 GpiCreateLogFont(hpsDst, 0, 1L, &fat); | 9878 GpiCreateLogFont(hpsDst, 0, 1L, &fat); |
9873 GpiSetCharSet(hpsDst, 1L); | 9879 GpiSetCharSet(hpsDst, 1L); |
9874 | 9880 |
10945 HAB thishab = WinInitialize(0); | 10951 HAB thishab = WinInitialize(0); |
10946 HMQ thishmq = WinCreateMsgQueue(thishab, 0); | 10952 HMQ thishmq = WinCreateMsgQueue(thishab, 0); |
10947 void (API_FUNC threadfunc)(void *) = NULL; | 10953 void (API_FUNC threadfunc)(void *) = NULL; |
10948 void **tmp = (void **)data; | 10954 void **tmp = (void **)data; |
10949 | 10955 |
10956 #ifdef UNICODE | |
10950 /* Set the codepage to 1208 (UTF-8) */ | 10957 /* Set the codepage to 1208 (UTF-8) */ |
10951 WinSetCp(thishmq, 1208); | 10958 WinSetCp(thishmq, 1208); |
10952 | 10959 #endif |
10960 | |
10953 threadfunc = (void (API_FUNC)(void *))tmp[0]; | 10961 threadfunc = (void (API_FUNC)(void *))tmp[0]; |
10954 threadfunc(tmp[1]); | 10962 threadfunc(tmp[1]); |
10955 | 10963 |
10956 free(tmp); | 10964 free(tmp); |
10957 | 10965 |