- Timestamp:
- Feb 2, 2001, 8:04:03 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/uitools.cpp
r4931 r5056 1 /* $Id: uitools.cpp,v 1.2 8 2001-01-11 18:04:19sandervl Exp $ */1 /* $Id: uitools.cpp,v 1.29 2001-02-02 19:04:02 sandervl Exp $ */ 2 2 /* 3 3 * User Interface Functions … … 24 24 * UITOOLS_DrawRectEdge() 25 25 */ 26 static const charLTInnerNormal[] = {26 static const signed LTInnerNormal[] = { 27 27 -1, -1, -1, -1, 28 28 -1, COLOR_BTNHIGHLIGHT, COLOR_BTNHIGHLIGHT, -1, … … 31 31 }; 32 32 33 static const char LTOuterNormal[] = {33 static const signed char LTOuterNormal[] = { 34 34 -1, COLOR_3DLIGHT, COLOR_BTNSHADOW, -1, 35 35 COLOR_BTNHIGHLIGHT, COLOR_3DLIGHT, COLOR_BTNSHADOW, -1, … … 38 38 }; 39 39 40 static const char RBInnerNormal[] = {40 static const signed char RBInnerNormal[] = { 41 41 -1, -1, -1, -1, 42 42 -1, COLOR_BTNSHADOW, COLOR_BTNSHADOW, -1, … … 45 45 }; 46 46 47 static const char RBOuterNormal[] = {47 static const signed char RBOuterNormal[] = { 48 48 -1, COLOR_3DDKSHADOW, COLOR_BTNHIGHLIGHT, -1, 49 49 COLOR_BTNSHADOW, COLOR_3DDKSHADOW, COLOR_BTNHIGHLIGHT, -1, … … 52 52 }; 53 53 54 static const char LTInnerSoft[] = {54 static const signed char LTInnerSoft[] = { 55 55 -1, -1, -1, -1, 56 56 -1, COLOR_3DLIGHT, COLOR_3DLIGHT, -1, … … 59 59 }; 60 60 61 static const char LTOuterSoft[] = {61 static const signed char LTOuterSoft[] = { 62 62 -1, COLOR_BTNHIGHLIGHT, COLOR_3DDKSHADOW, -1, 63 63 COLOR_3DLIGHT, COLOR_BTNHIGHLIGHT, COLOR_3DDKSHADOW, -1, … … 69 69 #define RBOuterSoft RBOuterNormal 70 70 71 static const char LTRBOuterMono[] = {71 static const signed char LTRBOuterMono[] = { 72 72 -1, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, 73 73 COLOR_WINDOW, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, … … 76 76 }; 77 77 78 static const char LTRBInnerMono[] = {78 static const signed char LTRBInnerMono[] = { 79 79 -1, -1, -1, -1, 80 80 -1, COLOR_WINDOW, COLOR_WINDOW, COLOR_WINDOW, … … 83 83 }; 84 84 85 static const char LTRBOuterFlat[] = {85 static const signed char LTRBOuterFlat[] = { 86 86 -1, COLOR_BTNSHADOW, COLOR_BTNSHADOW, COLOR_BTNSHADOW, 87 87 COLOR_WINDOWFRAME, COLOR_BTNSHADOW, COLOR_BTNSHADOW, COLOR_BTNSHADOW, … … 90 90 }; 91 91 92 static const char LTRBInnerFlat[] = {92 static const signed char LTRBInnerFlat[] = { 93 93 -1, -1, -1, -1, 94 94 -1, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, … … 110 110 { 111 111 POINT Points[4]; 112 char InnerI, OuterI;112 signed char InnerI, OuterI; 113 113 HPEN InnerPen, OuterPen; 114 114 POINT SavePoint; … … 424 424 UINT uType, UINT uFlags) 425 425 { 426 char LTInnerI, LTOuterI;427 char RBInnerI, RBOuterI;426 signed char LTInnerI, LTOuterI; 427 signed char RBInnerI, RBOuterI; 428 428 HPEN LTInnerPen, LTOuterPen; 429 429 HPEN RBInnerPen, RBOuterPen; -
trunk/src/user32/win32class.cpp
r4585 r5056 1 /* $Id: win32class.cpp,v 1. 19 2000-11-11 18:39:30sandervl Exp $ */1 /* $Id: win32class.cpp,v 1.20 2001-02-02 19:04:02 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Managment Code for OS/2 … … 520 520 //FIXME: Windows that still exists with this class 521 521 //****************************************************************************** 522 voidWin32WndClass::UnregisterClassA(HINSTANCE hinst, LPSTR id)522 BOOL Win32WndClass::UnregisterClassA(HINSTANCE hinst, LPSTR id) 523 523 { 524 524 Win32WndClass *wndclass; 525 526 if(HIWORD(id)) { 527 dprintf(("Win32WndClass::UnregisterClassA class %s, instance %x!!", id, hinst)); 528 } 529 else dprintf(("Win32WndClass::UnregisterClassA class %x, instance %x!!", id, hinst)); 525 530 526 531 wndclass = FindClass(hinst, id); 527 532 if(wndclass) { 533 if(wndclass->GetWindowCount() != 0) { 534 dprintf2(("Win32WndClass::UnregisterClassA class %x still has windows!!", id)); 535 SetLastError(ERROR_CLASS_HAS_WINDOWS); 536 return FALSE; 537 } 528 538 delete wndclass; 529 return; 539 SetLastError(ERROR_SUCCESS); 540 return TRUE; 530 541 } 531 542 dprintf(("::UnregisterClass, couldn't find class %X!!\n", id)); 543 SetLastError(ERROR_CLASS_DOES_NOT_EXIST); 544 return FALSE; 532 545 } 533 546 //****************************************************************************** -
trunk/src/user32/win32class.h
r3702 r5056 1 /* $Id: win32class.h,v 1.1 2 2000-06-13 21:26:30sandervl Exp $ */1 /* $Id: win32class.h,v 1.13 2001-02-02 19:04:02 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Managment Code for OS/2 … … 65 65 BOOL isAppClass(ULONG curProcessId); 66 66 67 static voidUnregisterClassA(HINSTANCE hinst, LPSTR id);67 static BOOL UnregisterClassA(HINSTANCE hinst, LPSTR id); 68 68 69 69 static Win32WndClass *FindClass(HINSTANCE hinst, LPSTR id); -
trunk/src/user32/win32dlg.cpp
r4686 r5056 1 /* $Id: win32dlg.cpp,v 1.5 4 2000-11-24 10:30:36sandervl Exp $ */1 /* $Id: win32dlg.cpp,v 1.55 2001-02-02 19:04:02 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Dialog Code for OS/2 … … 24 24 #include "controls.h" 25 25 #include "syscolor.h" 26 #include <math.h> 26 27 27 28 #define DBG_LOCALLOG DBG_win32dlg … … 400 401 { 401 402 BOOL Success = FALSE; 402 HFONT h UserFontPrev = 0;403 HFONT hFontPrev = 0; 403 404 pSize->cx = xBaseUnit; 404 405 pSize->cy = yBaseUnit; … … 409 410 TEXTMETRICA tm; 410 411 memset(&tm,0,sizeof(tm)); 411 if (hUserFont) h UserFontPrev = SelectFont(hDC,hUserFont);412 if (hUserFont) hFontPrev = SelectFont(hDC,hUserFont); 412 413 if (GetTextMetricsA(hDC,&tm)) 413 414 { … … 441 442 442 443 /* select the original font */ 443 if (h UserFontPrev) SelectFont(hDC,hUserFontPrev);444 if (hFontPrev) SelectFont(hDC,hFontPrev); 444 445 } 445 446 return (Success); … … 657 658 658 659 dprintf(("Create CONTROL %d", info.id)); 659 char *classNameA = NULL; 660 char *windowNameA = NULL; 661 662 if(HIWORD(info.className)) { 663 classNameA = UnicodeToAsciiString((LPWSTR)info.className); 664 } 665 else classNameA = (char *)info.className; 666 667 if(HIWORD(info.windowName)) { 668 windowNameA = UnicodeToAsciiString((LPWSTR)info.windowName); 669 } 670 else windowNameA = (char *)info.windowName; 671 672 hwndCtrl = ::CreateWindowExA( info.exStyle | WS_EX_NOPARENTNOTIFY, 673 classNameA, 674 windowNameA, 660 661 hwndCtrl = ::CreateWindowExW( info.exStyle | WS_EX_NOPARENTNOTIFY, 662 (LPCWSTR)info.className, 663 (LPCWSTR)info.windowName, 675 664 info.style | WS_CHILD, 676 info.x * xUnit / 4,677 info.y * yUnit / 8,678 info.cx * xUnit / 4,679 info.cy * yUnit / 8,665 MulDiv(info.x, xUnit, 4), 666 MulDiv(info.y, yUnit, 8), 667 MulDiv(info.cx, xUnit, 4), 668 MulDiv(info.cy, yUnit, 8), 680 669 getWindowHandle(), (HMENU)info.id, 681 670 hInst, info.data ); 682 if(HIWORD(classNameA)) {683 FreeAsciiString(classNameA);684 }685 if(HIWORD(windowNameA)) {686 FreeAsciiString(windowNameA);687 }688 671 689 672 if (!hwndCtrl) return FALSE; -
trunk/src/user32/win32wbase.cpp
r4976 r5056 1 /* $Id: win32wbase.cpp,v 1.23 0 2001-01-19 23:03:45sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.231 2001-02-02 19:04:03 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 2221 2221 RECT oldClientRect = rectClient; 2222 2222 2223 if(getWindowHandle() == 0x68000010) {2224 hParent = 0;2225 }2226 2223 if (fuFlags & 2227 2224 ~(SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | … … 2397 2394 } 2398 2395 2399 if(rectClient.left != oldClientRect->left || 2396 if(rectClient.left != oldClientRect->left || 2400 2397 rectClient.top != oldClientRect->top) 2401 2398 { … … 3231 3228 3232 3229 if(dwExStyle == value) { 3233 oldval = value;3230 oldval = value; 3234 3231 break; 3235 }3232 } 3236 3233 ss.styleOld = dwExStyle; 3237 3234 ss.styleNew = value; … … 3241 3238 SendInternalMessageA(WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss); 3242 3239 oldval = ss.styleOld; 3243 break;3240 break; 3244 3241 } 3245 3242 case GWL_STYLE: … … 3250 3247 3251 3248 if(dwStyle == value) { 3252 oldval = value;3249 oldval = value; 3253 3250 break; 3254 3251 } … … 3270 3267 case GWL_WNDPROC: 3271 3268 { 3272 //Note: Type of SetWindowLong determines new window proc type3269 //Note: Type of SetWindowLong determines new window proc type 3273 3270 // UNLESS the new window proc has already been registered 3274 3271 // (use the old type in that case) 3275 3272 // (VERIFIED in NT 4, SP6) 3276 3273 WINDOWPROCTYPE type = WINPROC_GetProcType((HWINDOWPROC)value); 3277 if(type == WIN_PROC_INVALID) {3278 type = (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A;3279 }3280 oldval = (LONG)WINPROC_GetProc(win32wndproc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A);3274 if(type == WIN_PROC_INVALID) { 3275 type = (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A; 3276 } 3277 oldval = (LONG)WINPROC_GetProc(win32wndproc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A); 3281 3278 WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, (WNDPROC)value, type, WIN_PROC_WINDOW); 3282 3279 break; … … 3304 3301 if(index >= 0 && index/4 < nrUserWindowLong) 3305 3302 { 3306 3307 3303 oldval = userWindowLong[index/4]; 3304 userWindowLong[index/4] = value; 3308 3305 break; 3309 3306 } 3310 dprintf(("WARNING: SetWindowLong%c %x %d %x returned %x INVALID index!", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value));3307 dprintf(("WARNING: SetWindowLong%c %x %d %x returned %x INVALID index!", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value)); 3311 3308 SetLastError(ERROR_INVALID_PARAMETER); 3312 3309 return 0; … … 3336 3333 break; 3337 3334 case GWL_HWNDPARENT: 3338 value = GetParent();3335 value = GetParent(); 3339 3336 break; 3340 3337 case GWL_ID: … … 3362 3359 WORD oldval; 3363 3360 3364 if(index >= 0 && index/4 < nrUserWindowLong)3365 {3361 if(index >= 0 && index/4 < nrUserWindowLong) 3362 { 3366 3363 oldval = ((WORD *)userWindowLong)[index/2]; 3367 3364 ((WORD *)userWindowLong)[index/2] = value; 3368 3365 return oldval; 3369 }3370 SetLastError(ERROR_INVALID_PARAMETER);3371 return 0;3372 }3373 //******************************************************************************3374 //******************************************************************************3375 WORD Win32BaseWindow::GetWindowWord(int index)3376 {3377 if(index >= 0 && index/4 < nrUserWindowLong)3378 {3379 return ((WORD *)userWindowLong)[index/2];3380 3366 } 3381 3367 SetLastError(ERROR_INVALID_PARAMETER); … … 3384 3370 //****************************************************************************** 3385 3371 //****************************************************************************** 3372 WORD Win32BaseWindow::GetWindowWord(int index) 3373 { 3374 if(index >= 0 && index/4 < nrUserWindowLong) 3375 { 3376 return ((WORD *)userWindowLong)[index/2]; 3377 } 3378 SetLastError(ERROR_INVALID_PARAMETER); 3379 return 0; 3380 } 3381 //****************************************************************************** 3382 //****************************************************************************** 3386 3383 void Win32BaseWindow::setWindowId(DWORD id) 3387 3384 { … … 3407 3404 DWORD magic; 3408 3405 3409 if(hwnd == OSLIB_HWND_DESKTOP)3410 {3411 return windowDesktop;3412 }3413 3414 win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwnd, OFFSET_WIN32WNDPTR);3415 magic = OSLibWinGetWindowULong(hwnd, OFFSET_WIN32PM_MAGIC);3416 3417 if(win32wnd && CheckMagicDword(magic)) {3406 if(hwnd == OSLIB_HWND_DESKTOP) 3407 { 3408 return windowDesktop; 3409 } 3410 3411 win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwnd, OFFSET_WIN32WNDPTR); 3412 magic = OSLibWinGetWindowULong(hwnd, OFFSET_WIN32PM_MAGIC); 3413 3414 if(win32wnd && CheckMagicDword(magic)) { 3418 3415 return win32wnd; 3419 }3416 } 3420 3417 // dprintf2(("Win32BaseWindow::GetWindowFromOS2Handle: not an Odin os2 window %x", hwnd)); 3421 return 0;3418 return 0; 3422 3419 } 3423 3420 //****************************************************************************** -
trunk/src/user32/windowclass.cpp
r4866 r5056 1 /* $Id: windowclass.cpp,v 1.1 4 2001-01-02 18:14:59sandervl Exp $ */1 /* $Id: windowclass.cpp,v 1.15 2001-02-02 19:04:03 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Code for OS/2 … … 157 157 BOOL WIN32API UnregisterClassA(LPCSTR lpszClassName, HINSTANCE hinst) 158 158 { 159 Win32WndClass::UnregisterClassA(hinst, (LPSTR)lpszClassName); 160 161 //Spintest returns FALSE in dll termination, so pretend it succeeded 162 return(TRUE); 159 BOOL ret; 160 161 ret = Win32WndClass::UnregisterClassA(hinst, (LPSTR)lpszClassName); 162 #if 1 163 return ret; 164 #else 165 //Spintest returns FALSE in dll termination, so pretend it succeeded 166 // return(TRUE); 167 #endif 163 168 } 164 169 //****************************************************************************** … … 167 172 { 168 173 char *astring = NULL; 174 BOOL ret; 169 175 170 176 dprintf(("USER32: UnregisterClassW\n")); … … 174 180 else astring = (char *)lpszClassName; 175 181 176 Win32WndClass::UnregisterClassA(hinst, (LPSTR)astring);182 ret = Win32WndClass::UnregisterClassA(hinst, (LPSTR)astring); 177 183 if(HIWORD(astring) != 0) 178 184 FreeAsciiString((char *)astring); 179 185 186 #if 1 187 return ret; 188 #else 180 189 //Spintest returns FALSE in dll termination, so pretend it succeeded 181 return(TRUE); 190 // return(TRUE); 191 #endif 182 192 } 183 193 //****************************************************************************** … … 198 208 wndclass->getClassInfo(&wc); 199 209 memcpy(lpwc, &wc.style, sizeof(WNDCLASSA)); 210 SetLastError(ERROR_SUCCESS); 200 211 return(TRUE); 201 212 } 213 SetLastError(ERROR_CLASS_DOES_NOT_EXIST); 202 214 return(FALSE); 203 215 } … … 225 237 wndclass->getClassInfo(&wc); 226 238 memcpy(lpwc, &wc.style, sizeof(WNDCLASSW)); 227 return(TRUE); 228 } 239 SetLastError(ERROR_SUCCESS); 240 return(TRUE); 241 } 242 SetLastError(ERROR_CLASS_DOES_NOT_EXIST); 229 243 return(FALSE); 230 244 } … … 262 276 wndclass->getClassInfo(lpwcx); 263 277 lpwcx->cbSize = sizeof(WNDCLASSEXA); 278 SetLastError(ERROR_SUCCESS); 264 279 return(TRUE); 265 280 } 281 SetLastError(ERROR_CLASS_DOES_NOT_EXIST); 266 282 return(FALSE); 267 283 } … … 304 320 wndclass->getClassInfo(lpwcx); 305 321 lpwcx->cbSize = sizeof(WNDCLASSEXW); 322 SetLastError(ERROR_SUCCESS); 306 323 return(TRUE); 307 324 } 325 SetLastError(ERROR_CLASS_DOES_NOT_EXIST); 308 326 return(FALSE); 309 327 }
Note:
See TracChangeset
for help on using the changeset viewer.