- Timestamp:
- Jun 18, 2009, 12:04:13 PM (16 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/Makefile
r10609 r21303 130 130 $(ODIN32_LIB)/libuls.lib \ 131 131 $(ODIN32_LIB)/$(ODINCRT).lib \ 132 $(ODIN32_LIB)/imm32os2.lib \133 132 OS2386.LIB \ 134 133 $(RTLLIB_O) -
trunk/src/user32/USER32.DEF
r10611 r21303 646 646 GetWindowModuleFileNameA = _GetWindowModuleFileNameA@12 @610 647 647 648 RealGetWindowClassA = _RealGetWindowClassA@12 @611 649 RealGetWindowClassW = _RealGetWindowClassW@12 @612 650 FlashWindowEx = _FlashWindowEx@4 @613 651 ToUnicodeEx = _ToUnicodeEx@28 @614 652 648 653 ;------------ 649 654 ; Windows 98 … … 745 750 _clipboardPMToOdinFormat@4 @2043 NONAME 746 751 _clipboardOdinToPMFormat@4 @2044 NONAME 747 748 _GetOS2Icon@4 @2045 NONAME -
trunk/src/user32/dbgwrap.cpp
r10316 r21303 324 324 DEBUGWRAP12(GetClassNameA) 325 325 DEBUGWRAP12(GetClassNameW) 326 DEBUGWRAP12(RealGetWindowClassA) 327 DEBUGWRAP12(RealGetWindowClassW) 326 328 DEBUGWRAP8(GetClassWord) 327 329 DEBUGWRAP4(RegisterClassA) -
trunk/src/user32/edit.c
r10607 r21303 31 31 #include "ctrlconf.h" 32 32 #include <heapstring.h> 33 #include <imm.h>34 33 #endif 35 34 … … 129 128 HLOCAL hloc32A; /* alias for ANSI control receiving EM_GETHANDLE 130 129 or EM_SETHANDLE */ 131 #ifdef __WIN32OS2__132 LPWSTR compStr;133 INT compStrLen;134 BOOL moveCaret;135 DWORD sentenceMode;136 #endif137 130 } EDITSTATE; 138 131 … … 1118 1111 else 1119 1112 { 1113 // always DBCS char 1120 1114 CHAR charA[ 2 ]; 1121 INT lenA = 1; 1122 1123 if( IsDBCSLeadByte(( CHAR )( wParam >> 8 ))) 1124 { 1115 1125 1116 charA[ 0 ] = ( CHAR )( wParam >> 8 ); 1126 1117 charA[ 1 ] = ( CHAR )wParam; 1127 lenA = 2; 1128 } 1129 else 1130 charA[ 0 ] = ( CHAR )wParam; 1131 1132 MultiByteToWideChar( CP_ACP, 0, ( LPSTR )charA, lenA, ( LPWSTR )&charW, 1); 1118 1119 MultiByteToWideChar( CP_ACP, 0, ( LPSTR )charA, 2, ( LPWSTR )&charW, 1); 1133 1120 } 1134 1121 … … 1136 1123 break; 1137 1124 } 1138 1139 case WM_IME_COMPOSITION:1140 {1141 HIMC himc;1142 LONG bufSize;1143 INT i;1144 BOOL passToDefWnd = FALSE;1145 #ifdef DEBUG1146 LPSTR strA;1147 INT lenA;1148 #endif1149 1150 DPRINTF_EDIT_MSG32("WM_IME_COMPOSITION");1151 1152 himc = ImmGetContext( hwnd );1153 1154 if( es->sentenceMode )1155 passToDefWnd = TRUE;1156 else if( lParam & GCS_RESULTSTR )1157 {1158 LPWSTR resultStr = NULL;1159 INT resultStrLen = 0;1160 1161 dprintf(("WM_IME_COMPOSITION : GCS_RESULTSTR"));1162 1163 bufSize = ImmGetCompositionStringW( himc, GCS_RESULTSTR, NULL, 0 );1164 if( bufSize > 0 )1165 {1166 INT i;1167 1168 resultStrLen = bufSize / sizeof( WCHAR );1169 resultStr = malloc( bufSize + sizeof( WCHAR ));1170 resultStr[ resultStrLen ] = 0;1171 1172 ImmGetCompositionStringW( himc, GCS_RESULTSTR, resultStr, bufSize );1173 1174 #ifdef DEBUG1175 lenA = WideCharToMultiByte( CP_ACP, 0, resultStr, resultStrLen, 0, 0, 0, 0 );1176 strA = malloc( lenA + 1 );1177 WideCharToMultiByte( CP_ACP, 0, resultStr, resultStrLen, strA, lenA, 0, 0 );1178 strA[ lenA ] = 0;1179 dprintf(("Result String : '%s'", strA ));1180 free( strA );1181 dprintf(("Composition Len %d", es->compStrLen ));1182 #endif1183 DestroyCaret();1184 if( es->compStrLen > 0 )1185 {1186 EDIT_EM_SetSel(hwnd, es, (UINT)-1, 0, FALSE);1187 for( i = 0; i < es->compStrLen; i++ )1188 EDIT_MoveForward(hwnd, es, TRUE);1189 EDIT_WM_Clear(hwnd, es);1190 }1191 1192 EDIT_EM_ReplaceSel(hwnd, es, TRUE, resultStr, TRUE);1193 1194 CreateCaret(hwnd, 0, 2, es->line_height);1195 EDIT_SetCaretPos(hwnd, es, es->selection_end, es->flags & EF_AFTER_WRAP);1196 ShowCaret(hwnd);1197 1198 free( resultStr );1199 1200 }1201 1202 if( es->compStr )1203 free( es->compStr );1204 1205 es->compStr = NULL;1206 es->compStrLen = 0;1207 }1208 else if( lParam & GCS_COMPSTR )1209 {1210 INT prevLen = es->compStrLen;1211 1212 dprintf(("WM_IME_COMPOSITION : GCS_COMPSTR"));1213 1214 if( es->compStr )1215 free( es->compStr );1216 1217 es->compStr = NULL;1218 es->compStrLen = 0;1219 1220 bufSize = ImmGetCompositionStringW( himc, GCS_COMPSTR, NULL, 0 );1221 if( bufSize > 0 )1222 {1223 HDC hdc;1224 SIZE size;1225 BOOL oldMoveCaret;1226 1227 es->compStrLen = bufSize / sizeof( WCHAR );1228 es->compStr = malloc( bufSize + sizeof( WCHAR ));1229 es->compStr[ es->compStrLen ] = 0;1230 1231 ImmGetCompositionStringW( himc, GCS_COMPSTR, es->compStr, bufSize );1232 1233 #ifdef DEBUG1234 lenA = WideCharToMultiByte( CP_ACP, 0, es->compStr, es->compStrLen, 0, 0, 0, 0 );1235 strA = malloc( lenA + 1 );1236 WideCharToMultiByte( CP_ACP, 0, es->compStr, es->compStrLen, strA, lenA, 0, 0 );1237 strA[ lenA ] = 0;1238 dprintf(("Composition String : '%s'", strA ));1239 free( strA );1240 #endif1241 hdc = GetDC( hwnd );1242 GetTextExtentPoint32W( hdc, es->compStr, es->compStrLen, &size);1243 ReleaseDC( hwnd, hdc );1244 1245 oldMoveCaret = es->moveCaret;1246 1247 es->moveCaret = FALSE; // to prevent cursor from flashing too many1248 1249 if( prevLen > 0 )1250 {1251 EDIT_EM_SetSel(hwnd, es, (UINT)-1, 0, FALSE);1252 for( i = 0; i < prevLen; i++ )1253 EDIT_MoveForward(hwnd, es, TRUE);1254 EDIT_WM_Clear(hwnd, es);1255 }1256 1257 EDIT_EM_ReplaceSel(hwnd, es, TRUE, es->compStr, TRUE);1258 1259 for( i = 0; i < es->compStrLen; i++ )1260 EDIT_MoveBackward(hwnd, es, FALSE);1261 1262 es->moveCaret = oldMoveCaret;1263 1264 CreateCaret(hwnd, 0, size.cx, es->line_height);1265 EDIT_SetCaretPos(hwnd, es, es->selection_end, es->flags & EF_AFTER_WRAP);1266 ShowCaret(hwnd);1267 }1268 }1269 else1270 passToDefWnd = TRUE;1271 1272 ImmReleaseContext( hwnd, himc );1273 1274 if( passToDefWnd )1275 {1276 if( unicode )1277 result = DefWindowProcW( hwnd, msg, wParam, lParam );1278 else1279 result = DefWindowProcA( hwnd, msg, wParam, lParam );1280 }1281 break;1282 }1283 1284 case WM_IME_COMPOSITIONFULL:1285 DPRINTF_EDIT_MSG32("WM_IME_COMPOSITIONFULL");1286 if( unicode )1287 result = DefWindowProcW( hwnd, msg, wParam, lParam );1288 else1289 result = DefWindowProcA( hwnd, msg, wParam, lParam );1290 break;1291 1292 case WM_IME_CONTROL:1293 DPRINTF_EDIT_MSG32("WM_IME_CONTROL");1294 if( unicode )1295 result = DefWindowProcW( hwnd, msg, wParam, lParam );1296 else1297 result = DefWindowProcA( hwnd, msg, wParam, lParam );1298 break;1299 1300 case WM_IME_ENDCOMPOSITION:1301 DPRINTF_EDIT_MSG32("WM_IME_ENDCOMPOSITION");1302 1303 if( es->compStr )1304 {1305 INT i;1306 1307 DestroyCaret();1308 1309 EDIT_EM_SetSel(hwnd, es, (UINT)-1, 0, FALSE);1310 for( i = 0; i < es->compStrLen; i++ )1311 EDIT_MoveForward(hwnd, es, TRUE);1312 EDIT_WM_Clear(hwnd, es);1313 1314 CreateCaret(hwnd, 0, 2, es->line_height);1315 EDIT_SetCaretPos(hwnd, es, es->selection_end, es->flags & EF_AFTER_WRAP);1316 ShowCaret(hwnd);1317 1318 free( es->compStr );1319 }1320 1321 es->compStr = NULL;1322 es->compStrLen = 0;1323 1324 if( unicode )1325 result = DefWindowProcW( hwnd, msg, wParam, lParam );1326 else1327 result = DefWindowProcA( hwnd, msg, wParam, lParam );1328 break;1329 1330 case WM_IME_NOTIFY:1331 DPRINTF_EDIT_MSG32("WM_IME_NOTIFY");1332 1333 if( wParam == IMN_SETSENTENCEMODE )1334 {1335 HIMC himc;1336 DWORD conversionMode;1337 1338 himc = ImmGetContext( hwnd );1339 1340 ImmGetConversionStatus( himc, &conversionMode, &es->sentenceMode );1341 1342 ImmReleaseContext( hwnd, himc );1343 }1344 1345 if( unicode )1346 result = DefWindowProcW( hwnd, msg, wParam, lParam );1347 else1348 result = DefWindowProcA( hwnd, msg, wParam, lParam );1349 break;1350 1351 case WM_IME_REQUEST:1352 DPRINTF_EDIT_MSG32("WM_IME_REQUEST");1353 if( unicode )1354 result = DefWindowProcW( hwnd, msg, wParam, lParam );1355 else1356 result = DefWindowProcA( hwnd, msg, wParam, lParam );1357 break;1358 1359 case WM_IME_SELECT:1360 DPRINTF_EDIT_MSG32("WM_IME_SELECT");1361 if( unicode )1362 result = DefWindowProcW( hwnd, msg, wParam, lParam );1363 else1364 result = DefWindowProcA( hwnd, msg, wParam, lParam );1365 break;1366 1367 case WM_IME_SETCONTEXT:1368 DPRINTF_EDIT_MSG32("WM_IME_SETCONTEXT");1369 1370 dprintf(("ImmGetProperty %08lx", ImmGetProperty( 0, IGP_CONVERSION )));1371 1372 if( unicode )1373 result = DefWindowProcW( hwnd, msg, wParam, lParam );1374 else1375 result = DefWindowProcA( hwnd, msg, wParam, lParam );1376 break;1377 1378 case WM_IME_STARTCOMPOSITION:1379 DPRINTF_EDIT_MSG32("WM_IME_STARTCOMPOSITION");1380 1381 es->compStr = NULL;1382 es->compStrLen = 0;1383 1384 if( unicode )1385 result = DefWindowProcW( hwnd, msg, wParam, lParam );1386 else1387 result = DefWindowProcA( hwnd, msg, wParam, lParam );1388 break;1389 1390 case EM_GETIMESTATUS:1391 DPRINTF_EDIT_MSG32("EM_GETIMESTATUS");1392 if( unicode )1393 result = DefWindowProcW( hwnd, msg, wParam, lParam );1394 else1395 result = DefWindowProcA( hwnd, msg, wParam, lParam );1396 break;1397 1398 case EM_SETIMESTATUS:1399 DPRINTF_EDIT_MSG32("EM_SETIMESTATUS");1400 if( unicode )1401 result = DefWindowProcW( hwnd, msg, wParam, lParam );1402 else1403 result = DefWindowProcA( hwnd, msg, wParam, lParam );1404 break;1405 1125 #endif 1406 1126 … … 2720 2440 { 2721 2441 LRESULT res = EDIT_EM_PosFromChar(hwnd, es, pos, after_wrap); 2722 2723 #ifdef __WIN32OS2__2724 if( es->moveCaret )2725 {2726 HIMC himc;2727 CANDIDATEFORM candForm;2728 2729 himc = ImmGetContext( hwnd );2730 2731 #endif2732 2442 SetCaretPos(SLOWORD(res), SHIWORD(res)); 2733 2734 #ifdef __WIN32OS2__2735 if( es->sentenceMode )2736 {2737 COMPOSITIONFORM cf;2738 2739 cf.dwStyle = CFS_POINT;2740 cf.ptCurrentPos.x = SLOWORD( res );2741 cf.ptCurrentPos.y = SHIWORD( res );2742 2743 ImmSetCompositionWindow( himc, &cf );2744 }2745 2746 candForm.dwIndex = 0;2747 candForm.dwStyle = CFS_CANDIDATEPOS;2748 candForm.ptCurrentPos.x = SLOWORD( res );2749 candForm.ptCurrentPos.y = SHIWORD( res ) + es->line_height;2750 2751 ImmSetCandidateWindow( himc, &candForm );2752 2753 ImmReleaseContext( hwnd, himc );2754 }2755 #endif2756 2443 } 2757 2444 … … 5086 4773 } 5087 4774 5088 #ifdef __WIN32OS2__5089 es->compStr = NULL;5090 es->compStrLen = 0;5091 es->moveCaret = TRUE;5092 {5093 HIMC himc;5094 DWORD conversionMode;5095 5096 himc = ImmGetContext( hwnd );5097 5098 ImmGetConversionStatus( himc, &conversionMode, &es->sentenceMode );5099 5100 ImmReleaseContext( hwnd, himc );5101 }5102 #endif5103 5104 4775 return TRUE; 5105 4776 } … … 5238 4909 es->line_height = tm.tmHeight; 5239 4910 es->char_width = tm.tmAveCharWidth; 5240 #ifdef __WIN32OS2__5241 // todo : set font of IME window5242 #endif5243 4911 if (font) 5244 4912 SelectObject(dc, old_font); -
trunk/src/user32/inituser32.cpp
r10595 r21303 149 149 switch (ulFlag) { 150 150 case 0 : 151 STATS_InitializeUSER32 (); 152 151 153 ParseLogStatusUSER32(); 152 154 … … 183 185 184 186 InitClipboardFormats(); 187 188 RasEntry (RAS_EVENT_User32InitComplete, &hInstanceUser32, sizeof (hInstanceUser32)); 189 185 190 break; 186 191 … … 190 195 UnregisterLxDll(hInstanceUser32); 191 196 } 197 STATS_UninitializeUSER32 (); 192 198 break; 193 199 default : -
trunk/src/user32/listbox.c
r10607 r21303 3026 3026 else 3027 3027 { 3028 // always DBCS char 3028 3029 CHAR charA[ 2 ]; 3029 INT lenA = 1; 3030 3031 if( IsDBCSLeadByte(( CHAR )( wParam >> 8 ))) 3032 { 3030 3033 3031 charA[ 0 ] = ( CHAR )( wParam >> 8 ); 3034 3032 charA[ 1 ] = ( CHAR )wParam; 3035 lenA = 2; 3036 } 3037 else 3038 charA[ 0 ] = ( CHAR )wParam; 3039 3040 MultiByteToWideChar( CP_ACP, 0, ( LPSTR )charA, lenA, ( LPWSTR )&charW, 1); 3033 3034 MultiByteToWideChar( CP_ACP, 0, ( LPSTR )charA, 2, ( LPWSTR )&charW, 1); 3041 3035 } 3042 3036 return LISTBOX_HandleChar( hwnd, descr, charW ); -
trunk/src/user32/loadres.cpp
r9796 r21303 168 168 //if in OS/2 mode, then we must replace the standard button bitmaps 169 169 //(min, max, restore, close) 170 if(fOS2Look && (hinst == hInstanceUser32 || !hinst)) { 170 //(NOTE: if hBmpCloseButton present until WGSS has been updated) 171 if(fOS2Look && (hinst == hInstanceUser32 || !hinst) && hBmpCloseButton) { 171 172 switch((ULONG)lpszName) { 172 173 case OBM_CLOSE: -
trunk/src/user32/oslibmsgtranslate.cpp
r10607 r21303 15 15 * 16 16 */ 17 #define INCL_NLS18 #define INCL_GPI19 17 #define INCL_WIN 20 18 #define INCL_PM … … 44 42 #include "user32api.h" 45 43 46 #include <os2im.h>47 #include <im32.h>48 44 49 45 #define DBG_LOCALLOG DBG_oslibmsgtranslate … … 52 48 static BOOL fGenerateDoubleClick = FALSE; 53 49 static MSG doubleClickMsg = {0}; 54 55 extern UINT WINAPI GetACP(void); // from winnls.h56 50 57 51 //For wheel mouse translation … … 759 753 if( scanCode != 0 ) 760 754 { 761 switch( SHORT2FROMMP( os2Msg->mp2 ))762 {763 // for Korean764 case VK_DBE_HANJA :765 bWinVKey = 0x19;766 break;767 768 case VK_DBE_HANGEUL :769 bWinVKey = 0x15;770 break;771 772 case VK_DBE_JAMO :773 bWinVKey = 0;774 break;775 776 // for Japan777 case VK_DBE_KATAKANA :778 bWinVKey = 0;779 break;780 781 case VK_DBE_HIRAGANA :782 bWinVKey = 0;783 break;784 785 case VK_DBE_SBCSCHAR :786 bWinVKey = 0;787 break;788 789 case VK_DBE_DBCSCHAR :790 bWinVKey = 0;791 break;792 793 case VK_DBE_SBCSDBCSCHAR :794 bWinVKey = 0;795 break;796 797 case VK_DBE_ROMAN :798 bWinVKey = 0;799 break;800 801 // for PRC-Chinese802 case VK_DBE_HANZI :803 bWinVKey = 0;804 break;805 806 // for Taiwan807 case VK_DBE_TSANGJYE :808 bWinVKey = 0;809 break;810 811 case VK_DBE_PHONETIC :812 bWinVKey = 0;813 break;814 815 case VK_DBE_CONV :816 bWinVKey = 0;817 break;818 819 case VK_DBE_NOCONV :820 bWinVKey = 0;821 break;822 823 case VK_DBE_ALPHANUMERIC :824 switch( GetACP())825 {826 case 949 : // Korea827 case 1361 :828 bWinVKey = 0x15;829 break;830 831 case 932 : // Japan832 case 942 :833 case 943 :834 835 case 936 : // PRC836 case 1381 :837 838 case 950 : // Taiwan839 default :840 bWinVKey = 0;841 }842 break;843 844 default :845 755 KeyTranslatePMScanToWinVKey(usPMScanCode, 846 756 FALSE, … … 848 758 &wWinScan, 849 759 &fWinExtended); 850 }851 852 760 winMsg->wParam = bWinVKey; 853 761 } … … 1104 1012 case WM_RENDERFMT: 1105 1013 winMsg->message = WINWM_RENDERFORMAT; 1106 winMsg->wParam = (UINT) os2Msg->mp1; 1014 extern UINT WIN32API clipboardPMToOdinFormat(ULONG ulPMFormat); 1015 winMsg->wParam = (UINT)clipboardPMToOdinFormat((ULONG)os2Msg->mp1); 1016 if (!winMsg->wParam) 1017 { 1018 dprintf(("WM_RENDERFMT: failed to convert clipboard format (%d)!!!\n", os2Msg->mp1)); 1019 DebugInt3(); 1020 } 1107 1021 break; 1108 1022 … … 1165 1079 break; 1166 1080 1167 case WM_IMENOTIFY:1168 dprintf(("WM_IMENOTIFY"));1169 1170 winMsg->wParam = 0;1171 winMsg->lParam = 0;1172 1173 switch(( ULONG )os2Msg->mp1 )1174 {1175 case IMN_STARTCONVERSION :1176 winMsg->message = WM_IME_STARTCOMPOSITION_W;1177 break;1178 1179 case IMN_ENDCONVERSION :1180 winMsg->message = WM_IME_ENDCOMPOSITION_W;1181 break;1182 1183 case IMN_CONVERSIONFULL :1184 winMsg->message = WM_IME_COMPOSITIONFULL_W;1185 break;1186 1187 case IMN_IMECHANGED :1188 winMsg->message = WM_IME_SELECT_W;1189 // todo1190 // fall through1191 1192 default :1193 goto dummymessage;1194 1195 }1196 break;1197 1198 case WM_IMEREQUEST:1199 winMsg->wParam = 0;1200 winMsg->lParam = 0;1201 1202 switch(( ULONG )os2Msg->mp1 )1203 {1204 case IMR_INSTANCEACTIVATE :1205 {1206 USHORT usIMR_IA = LOUSHORT( os2Msg->mp2 );1207 1208 winMsg->message = WM_IME_SETCONTEXT_W;1209 winMsg->wParam = HIUSHORT( os2Msg->mp2 );1210 1211 if( usIMR_IA & IMR_IA_STATUS )1212 winMsg->lParam |= ISC_SHOWUIGUIDELINE_W;1213 1214 if( usIMR_IA & IMR_IA_CONVERSION )1215 winMsg->lParam |= ISC_SHOWUICOMPOSITIONWINDOW_W;1216 1217 if( usIMR_IA & IMR_IA_CANDIDATE )1218 winMsg->lParam |= ISC_SHOWUIALLCANDIDATEWINDOW_W;1219 1220 if( usIMR_IA & IMR_IA_INFOMSG )1221 winMsg->lParam |= 0; // todo1222 1223 if( usIMR_IA & IMR_IA_REGWORD )1224 winMsg->lParam |= 0; // todo1225 break;1226 }1227 1228 case IMR_STATUS :1229 winMsg->message = WM_IME_NOTIFY_W;1230 1231 switch(( ULONG )os2Msg->mp2 )1232 {1233 case IMR_STATUS_SHOW :1234 winMsg->wParam = IMN_OPENSTATUSWINDOW_W;1235 break;1236 1237 case IMR_STATUS_HIDE :1238 winMsg->wParam = IMN_CLOSESTATUSWINDOW_W;1239 break;1240 1241 case IMR_STATUS_INPUTMODE : // IMN_SETOPENSTATUS followed by IMN_SETCONVERSIONMODE1242 winMsg->wParam = IMN_SETOPENSTATUS_W;1243 break;1244 1245 case IMR_STATUS_CONVERSIONMODE :1246 winMsg->wParam = IMN_SETSENTENCEMODE_W;1247 break;1248 1249 case IMR_STATUS_STATUSPOS :1250 winMsg->wParam = IMN_SETSTATUSWINDOWPOS_W;1251 break;1252 1253 case IMR_STATUS_STRING :1254 case IMR_STATUS_STRINGATTR :1255 case IMR_STATUS_CURSORPOS :1256 case IMR_STATUS_CURSORATTR :1257 1258 default :1259 // todo1260 goto dummymessage;1261 1262 }1263 break;1264 1265 case IMR_CONVRESULT :1266 {1267 ULONG ulIMR = ( ULONG )os2Msg->mp2;1268 1269 winMsg->message = WM_IME_COMPOSITION_W;1270 winMsg->wParam = 0; // todo : current DBCS char1271 1272 if( ulIMR & IMR_CONV_CONVERSIONSTRING )1273 winMsg->lParam |= GCS_COMPSTR_W;1274 1275 if( ulIMR & IMR_CONV_CONVERSIONATTR )1276 winMsg->lParam |= GCS_COMPATTR_W;1277 1278 if( ulIMR & IMR_CONV_CONVERSIONCLAUSE )1279 winMsg->lParam |= GCS_COMPCLAUSE_W;1280 1281 if( ulIMR & IMR_CONV_READINGSTRING )1282 winMsg->lParam |= GCS_COMPREADSTR_W;1283 1284 if( ulIMR & IMR_CONV_READINGATTR )1285 winMsg->lParam |= GCS_COMPREADATTR_W;1286 1287 if( ulIMR & IMR_CONV_READINGCLAUSE )1288 winMsg->lParam |= GCS_COMPREADCLAUSE_W;1289 1290 if( ulIMR & IMR_CONV_CURSORPOS )1291 winMsg->lParam |= GCS_CURSORPOS_W;1292 1293 if( ulIMR & IMR_CONV_CURSORATTR )1294 winMsg->lParam |= 0; // todo1295 1296 if( ulIMR & IMR_CONV_CHANGESTART )1297 winMsg->lParam |= GCS_DELTASTART_W;1298 1299 if( ulIMR & IMR_CONV_INSERTCHAR )1300 winMsg->lParam |= CS_INSERTCHAR_W;1301 1302 if( ulIMR & IMR_CONV_NOMOVECARET )1303 winMsg->lParam |= CS_NOMOVECARET_W;1304 1305 if( ulIMR & IMR_CONV_CONVERSIONFONT )1306 winMsg->lParam |= 0; // todo1307 1308 if( ulIMR & IMR_CONV_CONVERSIONPOS )1309 winMsg->lParam |= 0; // todo1310 1311 if( ulIMR & IMR_RESULT_RESULTSTRING )1312 winMsg->lParam = GCS_RESULTSTR_W; // clear all composition info1313 1314 if( ulIMR & IMR_RESULT_RESULTATTR )1315 winMsg->lParam |= 0; // todo1316 1317 if( ulIMR & IMR_RESULT_RESULTCLAUSE )1318 winMsg->lParam |= GCS_RESULTCLAUSE_W;1319 1320 if( ulIMR & IMR_RESULT_READINGSTRING )1321 winMsg->lParam |= GCS_RESULTREADSTR_W;1322 1323 if( ulIMR & IMR_RESULT_READINGATTR )1324 winMsg->lParam |= 0; // todo1325 1326 if( ulIMR & IMR_RESULT_READINGCLAUSE )1327 winMsg->lParam |= GCS_RESULTREADCLAUSE_W;1328 1329 if( ulIMR && ( winMsg->lParam == 0 ))1330 goto dummymessage;1331 break;1332 }1333 1334 case IMR_CANDIDATE :1335 winMsg->message = WM_IME_NOTIFY_W;1336 switch(( ULONG )os2Msg->mp2 )1337 {1338 case IMR_CANDIDATE_SHOW :1339 case IMR_CANDIDATE_HIDE :1340 case IMR_CANDIDATE_SELECT :1341 case IMR_CANDIDATE_CHANGE :1342 case IMR_CANDIDATE_CANDIDATEPOS :1343 default :1344 // todo1345 goto dummymessage;1346 }1347 break;1348 1349 case IMR_INFOMSG :1350 winMsg->message = WM_IME_NOTIFY_W;1351 winMsg->wParam = IMN_GUIDELINE_W;1352 break;1353 1354 case IMR_REGWORD :1355 goto dummymessage;1356 1357 case IMR_IMECHANGE :1358 winMsg->message = WM_IME_SELECT_W;1359 // todo1360 goto dummymessage;1361 1362 case IMR_CONFIG :1363 // todo1364 goto dummymessage;1365 1366 case IMR_DICTIONARY :1367 // todo1368 goto dummymessage;1369 1370 case IMR_OTHERINFO :1371 // todo1372 goto dummymessage;1373 }1374 break;1375 1376 #if 0 // application cannot receive this message1377 case WM_IMECONTROL:1378 #endif1379 1081 case WM_INITMENU: 1380 1082 case WM_MENUSELECT: -
trunk/src/user32/pmwindow.cpp
r10607 r21303 61 61 #include "user32api.h" 62 62 #include <kbdhook.h> 63 #include <heapstring.h>64 65 #include <os2im.h>66 #include <im32.h>67 63 68 64 #define DBG_LOCALLOG DBG_pmwindow … … 144 140 #endif 145 141 146 extern "C" ULONG OSLibImSetMsgQueueProperty( ULONG, ULONG );147 148 142 //****************************************************************************** 149 143 // Initialize PM; create hab, message queue and register special Win32 window classes … … 200 194 BOOL rc = WinSetCp(hmq, GetDisplayCodepage()); 201 195 dprintf(("InitPM: WinSetCP was %sOK", rc ? "" : "not ")); 202 203 /* IM instace is created per message queue, that is, thread */204 if( IsDBCSEnv())205 OSLibImSetMsgQueueProperty( hmq, MQP_INSTANCE_PERMQ );206 196 207 197 //CD polling window class … … 1014 1004 dprintf(("OS2: %s %x %x %x", (msg == WM_HSCROLL) ? "WM_HSCROLL" : "WM_VSCROLL", win32wnd->getWindowHandle(), mp1, mp2)); 1015 1005 win32wnd->DispatchMsgA(pWinMsg); 1016 break;1017 1018 case WM_IMEREQUEST:1019 case WM_IMECONTROL:1020 case WM_IMENOTIFY:1021 if( pWinMsg->message )1022 {1023 win32wnd->DispatchMsgA( pWinMsg );1024 1025 if(( pWinMsg->message = WM_IME_NOTIFY_W ) &&1026 ( pWinMsg->wParam == IMN_SETOPENSTATUS_W ))1027 {1028 MSG m;1029 1030 m.message = WM_IME_NOTIFY_W;1031 m.wParam = IMN_SETCONVERSIONMODE_W;1032 m.lParam = 0;1033 1034 win32wnd->DispatchMsgA( &m );1035 }1036 }1037 else1038 goto RunDefWndProc;1039 1006 break; 1040 1007 … … 2243 2210 break; 2244 2211 2245 case WM_IMEREQUEST:2246 case WM_IMECONTROL:2247 case WM_IMENOTIFY:2248 if( pWinMsg->message )2249 {2250 dprintf(("Frame window received IME message"));2251 win32wnd->DispatchMsgA( pWinMsg );2252 2253 if(( pWinMsg->message = WM_IME_NOTIFY_W ) &&2254 ( pWinMsg->wParam == IMN_SETOPENSTATUS_W ))2255 {2256 MSG m;2257 2258 m.message = WM_IME_NOTIFY_W;2259 m.wParam = IMN_SETCONVERSIONMODE_W;2260 m.lParam = 0;2261 2262 win32wnd->DispatchMsgA( &m );2263 }2264 }2265 else2266 goto RunDefWndProc;2267 break;2268 2269 2212 #ifdef DEBUG 2270 2213 case WM_DDE_INITIATE: -
trunk/src/user32/stats.cpp
r7640 r21303 1 1 #include <os2win.h> 2 2 #include <stats.h> 3 4 #ifdef RAS 5 6 RAS_TRACK_HANDLE rthDCCalls = 0; 7 8 //****************************************************************************** 9 //****************************************************************************** 10 void STATS_GetDCEx(HWND hwnd, HDC hdc, HRGN hrgn, ULONG flags) 11 { 12 if (!rthDCCalls) STATS_InitializeUSER32 (); 13 RasAddObject (rthDCCalls, hdc, NULL, 0); 14 } 15 //****************************************************************************** 16 //****************************************************************************** 17 void STATS_ReleaseDC(HWND hwnd, HDC hdc) 18 { 19 if (!rthDCCalls) STATS_InitializeUSER32 (); 20 RasRemoveObject (rthDCCalls, hdc); 21 } 22 //****************************************************************************** 23 //****************************************************************************** 24 void STATS_DumpStatsUSER32() 25 { 26 RasLogObjects (rthDCCalls, RAS_FLAG_LOG_OBJECTS); 27 } 28 void STATS_InitializeUSER32 (void) 29 { 30 RasEnterSerialize (); 31 if (!rthDCCalls) 32 { 33 RasRegisterObjectTracking(&rthDCCalls, "DCCalls", 0, 0, NULL, NULL); 34 } 35 RasExitSerialize (); 36 } 37 38 void STATS_UninitializeUSER32(void) 39 { 40 } 41 42 43 #else 3 44 4 45 #ifdef DEBUG … … 37 78 38 79 #endif //DEBUG 80 #endif //RAS -
trunk/src/user32/user32dbg.def
r10611 r21303 646 646 GetWindowModuleFileNameA = _DbgGetWindowModuleFileNameA@12 @610 647 647 648 RealGetWindowClassA = _DbgRealGetWindowClassA@12 @611 649 RealGetWindowClassW = _DbgRealGetWindowClassW@12 @612 650 FlashWindowEx = _FlashWindowEx@4 @613 651 ToUnicodeEx = _ToUnicodeEx@28 @614 652 648 653 ;------------ 649 654 ; Windows 98 … … 742 747 _clipboardPMToOdinFormat@4 @2043 NONAME 743 748 _clipboardOdinToPMFormat@4 @2044 NONAME 744 745 _GetOS2Icon@4 @2045 NONAME -
trunk/src/user32/win32wbase.cpp
r10607 r21303 70 70 #include "callwrap.h" 71 71 72 #include <imm.h>73 74 72 #define DBG_LOCALLOG DBG_win32wbase 75 73 #include "dbglocal.h" … … 1560 1558 LRESULT Win32BaseWindow::DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam) 1561 1559 { 1560 1561 dprintf(("DefWndProc: winmsg: %x for %x Msg %s", Msg, Win32Hwnd, GetMsgText(HIWORD(lParam)))); 1562 1562 1563 switch(Msg) 1563 1564 { … … 2125 2126 2126 2127 case WM_IME_CHAR: 2127 if( IsDBCSLeadByte(( CHAR )( wParam >> 8 )))2128 if( wParam & 0xFF00 ) // DBCS ? 2128 2129 SendMessageA( getWindowHandle(), WM_CHAR, ( WPARAM )( BYTE )( wParam >> 8 ), lParam ); 2129 2130 SendMessageA( getWindowHandle(), WM_CHAR, ( WPARAM )( BYTE )( wParam & 0xFF ), lParam ); 2130 2131 break; 2131 2132 case WM_IME_KEYDOWN:2133 return SendMessageA( getWindowHandle(), WM_KEYDOWN, wParam, lParam );2134 2135 case WM_IME_KEYUP:2136 return SendMessageA( getWindowHandle(), WM_KEYUP, wParam, lParam );2137 2138 case WM_IME_COMPOSITION:2139 case WM_IME_COMPOSITIONFULL:2140 case WM_IME_CONTROL:2141 case WM_IME_ENDCOMPOSITION:2142 case WM_IME_NOTIFY:2143 case WM_IME_REQUEST:2144 case WM_IME_SELECT:2145 case WM_IME_SETCONTEXT:2146 case WM_IME_STARTCOMPOSITION:2147 {2148 HWND hwndIME = ImmGetDefaultIMEWnd( getWindowHandle());2149 2150 if( hwndIME )2151 {2152 BOOL result = ImmIsUIMessageA( hwndIME, Msg, wParam, lParam );2153 2154 switch( Msg )2155 {2156 case WM_IME_SETCONTEXT :2157 return result;2158 2159 case WM_IME_CONTROL :2160 // todo : IMC_GETSTATUSWINDOWPOS return POINTS structure2161 return !result;2162 2163 case WM_IME_REQUEST :2164 // todo2165 return 0;2166 }2167 }2168 break;2169 }2170 2132 2171 2133 default: … … 2247 2209 SendMessageW( getWindowHandle(), WM_CHAR, wParam, lParam ); 2248 2210 return 0; 2249 2250 case WM_IME_KEYDOWN:2251 return SendMessageW( getWindowHandle(), WM_KEYDOWN, wParam, lParam );2252 2253 case WM_IME_KEYUP:2254 return SendMessageW( getWindowHandle(), WM_KEYUP, wParam, lParam );2255 2256 case WM_IME_COMPOSITION:2257 case WM_IME_COMPOSITIONFULL:2258 case WM_IME_CONTROL:2259 case WM_IME_ENDCOMPOSITION:2260 case WM_IME_NOTIFY:2261 case WM_IME_REQUEST:2262 case WM_IME_SELECT:2263 case WM_IME_SETCONTEXT:2264 case WM_IME_STARTCOMPOSITION:2265 {2266 HWND hwndIME = ImmGetDefaultIMEWnd( getWindowHandle());2267 2268 if( hwndIME )2269 {2270 BOOL result = ImmIsUIMessageW( hwndIME, Msg, wParam, lParam );2271 2272 switch( Msg )2273 {2274 case WM_IME_SETCONTEXT :2275 return result;2276 2277 case WM_IME_CONTROL :2278 // todo : IMC_GETSTATUSWINDOWPOS return POINTS structure2279 return !result;2280 2281 case WM_IME_REQUEST :2282 // todo2283 return 0;2284 }2285 }2286 return 0;2287 }2288 2211 2289 2212 default: -
trunk/src/user32/window.cpp
r10496 r21303 1391 1391 dprintf(("FlashWindow %x %d\n", hwnd, fFlash)); 1392 1392 // return OSLibWinFlashWindow(Win32ToOS2Handle(hwnd), fFlash); 1393 return 1; 1394 } 1395 //****************************************************************************** 1396 //****************************************************************************** 1397 BOOL WIN32API FlashWindowEx( PFLASHWINFO pfwi) 1398 { 1399 dprintf(("FlashWindow %p %d\n", pfwi)); 1393 1400 return 1; 1394 1401 } -
trunk/src/user32/windowclass.cpp
r9598 r21303 1 /* $Id: windowclass.cpp,v 1.27 2003 -01-03 16:35:58sandervl Exp $ */1 /* $Id: windowclass.cpp,v 1.27 2003/01/03 16:33:02 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Code for OS/2 … … 461 461 return ret; 462 462 } 463 464 /* 465 * @implemented 466 */ 467 INT 468 WINAPI 469 RealGetWindowClassW( 470 HWND hwnd, 471 LPWSTR pszType, 472 INT cchType) 473 { 474 /* FIXME: Implement correct functionality of RealGetWindowClass */ 475 return GetClassNameW(hwnd,pszType,cchType); 476 } 477 478 INT 479 WINAPI 480 RealGetWindowClassA( 481 HWND hwnd, 482 LPSTR pszType, 483 INT cchType) 484 { 485 /* FIXME: Implement correct functionality of RealGetWindowClass */ 486 return GetClassNameA(hwnd,pszType,cchType); 487 } 488 463 489 //****************************************************************************** 464 490 //****************************************************************************** -
trunk/src/user32/windowmsg.cpp
r10607 r21303 34 34 #define INCL_TIMERWIN32 35 35 #include "timer.h" 36 #include "callwrap.h" 36 37 37 38 #define DBG_LOCALLOG DBG_windowmsg … … 326 327 * @author knut st. osmundsen <bird-srcspam@anduin.net> 327 328 * @remark One cannot attach a threads input queue to it self. 329 * @remark This implemenation requires the thread which input is 'forwarded' to 330 * process it's message queue. Window (and wine) will not bother that thread 331 * at all with the messages. (DEADLOCK WARNING) 328 332 * @todo Not sure if all this is 100% ok according to the windows reality. 329 333 * I'm sure some error cases aren't caught. … … 562 566 case WM_IME_CHAR: 563 567 { 568 // always DBCS char 564 569 CHAR charA[ 2 ]; 565 INT lenA = 1; 566 567 if( IsDBCSLeadByte(( CHAR )( *pwparam >> 8 ))) 568 { 570 569 571 charA[ 0 ] = ( CHAR )( *pwparam >> 8 ); 570 572 charA[ 1 ] = ( CHAR )*pwparam; 571 lenA = 2; 572 } 573 else 574 charA[ 0 ] = ( CHAR )*pwparam; 575 576 MultiByteToWideChar( CP_ACP, 0, ( LPSTR )charA, lenA, ( LPWSTR )pwparam, 1); 573 574 MultiByteToWideChar( CP_ACP, 0, ( LPSTR )charA, 2, ( LPWSTR )pwparam, 1); 577 575 578 576 return 0; … … 859 857 #ifdef __WIN32OS2__ 860 858 case WM_IME_CHAR: 861 { 859 { // always DBCS char 862 860 CHAR charA[ 2 ]; 863 INT lenA; 864 865 lenA = WideCharToMultiByte( CP_ACP, 0, ( LPWSTR )pwparam, 1, ( LPSTR )charA, 2, 0, 0 ); 866 if( lenA > 1 ) 861 862 WideCharToMultiByte( CP_ACP, 0, ( LPWSTR )pwparam, 1, ( LPSTR )charA, 2, 0, 0 ); 867 863 *pwparam = ( charA[ 0 ] << 8 ) | charA[ 1 ]; 868 else869 *pwparam = charA[ 0 ];870 864 871 865 return 0; … … 1009 1003 { 1010 1004 LRESULT result; 1011 LPARAM old = lParam;1012 1005 1013 1006 if (WINPROC_MapMsg32ATo32W( hwnd, msg, &wParam, &lParam ) == -1) return 0; 1014 1007 1015 result = func(hwnd, msg, wParam, lParam );1008 result = WrapCallback4(func, hwnd, msg, wParam, lParam ); 1016 1009 WINPROC_UnmapMsg32ATo32W( hwnd, msg, wParam, lParam ); 1017 1010 … … 1024 1017 { 1025 1018 LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR )); 1026 result = func(hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )ustr );1019 result = WrapCallback4(func, hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )ustr ); 1027 1020 result = lstrlenWtoA( ustr, result ); 1028 1021 HeapFree( GetProcessHeap(), 0, ustr ); … … 1033 1026 { 1034 1027 LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR )); 1035 result = func(hwnd, LB_GETTEXT, wParam, ( LPARAM )ustr );1028 result = WrapCallback4(func, hwnd, LB_GETTEXT, wParam, ( LPARAM )ustr ); 1036 1029 if( result != LB_ERR ) 1037 1030 result = lstrlenWtoA( ustr, result ); … … 1045 1038 { 1046 1039 LPWSTR ustr = ( LPWSTR )HeapAlloc( GetProcessHeap(), 0, ( result + 1 ) * sizeof( WCHAR )); 1047 result = func(hwnd, CB_GETLBTEXT, wParam, ( LPARAM )ustr );1040 result = WrapCallback4(func, hwnd, CB_GETLBTEXT, wParam, ( LPARAM )ustr ); 1048 1041 if( result != CB_ERR ) 1049 1042 result = lstrlenWtoA( ustr, result ); … … 1071 1064 if (WINPROC_MapMsg32WTo32A( hwnd, msg, &wParam, &lParam ) == -1) return 0; 1072 1065 1073 result = func(hwnd, msg, wParam, lParam );1066 result = WrapCallback4(func, hwnd, msg, wParam, lParam ); 1074 1067 WINPROC_UnmapMsg32WTo32A( hwnd, msg, wParam, lParam ); 1075 1068 … … 1082 1075 { 1083 1076 LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 ); 1084 result = func(hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )astr );1077 result = WrapCallback4(func, hwnd, WM_GETTEXT, ( WPARAM )( result + 1 ), ( LPARAM )astr ); 1085 1078 result = lstrlenAtoW( astr, result ); 1086 1079 HeapFree( GetProcessHeap(), 0, astr ); … … 1091 1084 { 1092 1085 LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 ); 1093 result = func(hwnd, LB_GETTEXT, wParam, ( LPARAM )astr );1086 result = WrapCallback4(func, hwnd, LB_GETTEXT, wParam, ( LPARAM )astr ); 1094 1087 if( result != LB_ERR ) 1095 1088 result = lstrlenAtoW( astr, result ); … … 1103 1096 { 1104 1097 LPSTR astr = ( LPSTR )HeapAlloc( GetProcessHeap(), 0, result + 1 ); 1105 result = func(hwnd, CB_GETLBTEXT, wParam, ( LPARAM )astr );1098 result = WrapCallback4(func, hwnd, CB_GETLBTEXT, wParam, ( LPARAM )astr ); 1106 1099 if( result != CB_ERR ) 1107 1100 result = lstrlenAtoW( astr, result ); -
trunk/src/user32/winkeyboard.cpp
r10552 r21303 1334 1334 return (0); 1335 1335 } 1336 1337 int WINAPI ToUnicodeEx(UINT virtKey, UINT scanCode, const BYTE *lpKeyState, 1338 LPWSTR lpwStr, int size, UINT flags, HKL hkl) 1339 { 1340 dprintf(("ToUnicodeEx not implemented.\n")); 1341 return (0); 1342 } 1343 1336 1344 /***************************************************************************** 1337 1345 * Name : UINT WIN32API GetKBCodePage
Note:
See TracChangeset
for help on using the changeset viewer.