Changeset 996 for trunk/src/user32
- Timestamp:
- Sep 21, 1999, 10:24:05 AM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 6 edited
-
Makefile (modified) (2 diffs)
-
oslibres.cpp (modified) (6 diffs)
-
pmwindow.cpp (modified) (2 diffs)
-
win32wbase.cpp (modified) (4 diffs)
-
win32wbase.h (modified) (2 diffs)
-
window.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/Makefile
r949 r996 1 # $Id: Makefile,v 1.1 8 1999-09-15 23:18:52sandervl Exp $1 # $Id: Makefile,v 1.19 1999-09-21 08:24:04 sandervl Exp $ 2 2 3 3 # … … 127 127 128 128 clean: 129 $(RM) *.obj *.lib *.dll * ~ *.map *.pch129 $(RM) *.obj *.lib *.dll *.map *.pch *.res 130 130 $(RM) $(PDWIN32_BIN)\$(TARGET).dll 131 131 $(RM) $(PDWIN32_LIB)\$(TARGET).lib -
trunk/src/user32/oslibres.cpp
r949 r996 1 /* $Id: oslibres.cpp,v 1. 1 1999-09-15 23:18:54 sandervl Exp $ */1 /* $Id: oslibres.cpp,v 1.2 1999-09-21 08:24:04 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 57 57 58 58 if(iconbitmap == NULL) { 59 dprintf(("OSLibWinCreateIcon iconbitmap == NULL!!"));60 return 0;59 dprintf(("OSLibWinCreateIcon iconbitmap == NULL!!")); 60 return 0; 61 61 } 62 62 if(bafh->usType == BFT_BITMAPARRAY && bafh->cbSize == sizeof(BITMAPARRAYFILEHEADER2)) { 63 bfhBW = &bafh->bfh2; 64 bfhColor = (BITMAPFILEHEADER2 *)((char *)&bafh->bfh2 + sizeof(RGB2)*2 + sizeof(BITMAPFILEHEADER2)); 63 // search best icon for the current screen, 64 // TODO: maybe compare icon size with screen size. 65 // Some bugs with black/white Icons ? 66 BITMAPARRAYFILEHEADER2 *next, *found; 67 LONG bitcountScreen, bitcountIcon=-1, cxIcon=-1, cyIcon=-1; 68 69 HPS hps = WinGetPS(HWND_DESKTOP); 70 HDC hdc = GpiQueryDevice(hps); 71 DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1, &bitcountScreen); 72 WinReleasePS(hps); 73 74 next = found = bafh; 75 while(TRUE) 76 { 77 bfhColor = (BITMAPFILEHEADER2 *)((char *)&next->bfh2 + sizeof(RGB2)*2 + sizeof(BITMAPFILEHEADER2)); 78 if(bfhColor->bmp2.cBitCount <= bitcountScreen && 79 bfhColor->bmp2.cBitCount > bitcountIcon || 80 (bfhColor->bmp2.cBitCount == bitcountIcon && 81 (cxIcon < bfhColor->bmp2.cx || cyIcon < bfhColor->bmp2.cy))) 82 { 83 found = next; 84 bitcountIcon = bfhColor->bmp2.cBitCount; 85 cxIcon = bfhColor->bmp2.cx; 86 cyIcon = bfhColor->bmp2.cy; 87 } 88 if(next->offNext != 0) 89 next = (BITMAPARRAYFILEHEADER2 *) ((char *)bafh + next->offNext); 90 else 91 break; 92 } 93 bfhBW = &found->bfh2; 94 bfhColor = (BITMAPFILEHEADER2 *)((char *)bfhBW + sizeof(RGB2)*2 + sizeof(BITMAPFILEHEADER2)); 65 95 } 66 96 else {//single icon 67 bfhBW = (BITMAPFILEHEADER2 *)iconbitmap;68 bfhColor = (BITMAPFILEHEADER2 *)((char *)bfhBW + sizeof(RGB2)*2 + sizeof(BITMAPFILEHEADER2));69 bafh = (BITMAPARRAYFILEHEADER2 *)bfhBW; //for calculation bitmap offset97 bfhBW = (BITMAPFILEHEADER2 *)iconbitmap; 98 bfhColor = (BITMAPFILEHEADER2 *)((char *)bfhBW + sizeof(RGB2)*2 + sizeof(BITMAPFILEHEADER2)); 99 bafh = (BITMAPARRAYFILEHEADER2 *)bfhBW; //for calculation bitmap offset 70 100 } 71 101 hps = WinGetScreenPS(HWND_DESKTOP); 72 102 73 hbmColor = GpiCreateBitmap(hps, &bfhColor->bmp2, CBM_INIT, 74 (char *)bafh + bfhColor->offBits,103 hbmColor = GpiCreateBitmap(hps, &bfhColor->bmp2, CBM_INIT, 104 (char *)bafh + bfhColor->offBits, 75 105 (BITMAPINFO2 *)&bfhColor->bmp2); 76 106 if(hbmColor == GPI_ERROR) { … … 79 109 return 0; 80 110 } 81 hbmMask = GpiCreateBitmap(hps, &bfhBW->bmp2, CBM_INIT, 82 (char *)bafh + bfhBW->offBits,111 hbmMask = GpiCreateBitmap(hps, &bfhBW->bmp2, CBM_INIT, 112 (char *)bafh + bfhBW->offBits, 83 113 (BITMAPINFO2 *)&bfhBW->bmp2); 84 114 if(hbmMask == GPI_ERROR) { … … 114 144 115 145 if(cursorbitmap == NULL) { 116 dprintf(("OSLibWinCreatePointer cursorbitmap == NULL!!"));117 return 0;146 dprintf(("OSLibWinCreatePointer cursorbitmap == NULL!!")); 147 return 0; 118 148 } 119 149 //skip xor/and mask 120 150 hps = WinGetScreenPS(HWND_DESKTOP); 121 hbmColor = GpiCreateBitmap(hps, &bfh->bmp2, CBM_INIT, 122 (char *)bfh + bfh->offBits,151 hbmColor = GpiCreateBitmap(hps, &bfh->bmp2, CBM_INIT, 152 (char *)bfh + bfh->offBits, 123 153 (BITMAPINFO2 *)&bfh->bmp2); 124 154 if(hbmColor == GPI_ERROR) { … … 148 178 149 179 switch(type) { 150 case IDI_APPLICATION_W:151 os2type = SPTR_PROGRAM;152 break;153 case IDI_HAND_W:154 os2type = SPTR_ICONWARNING;155 break;156 case IDI_QUESTION_W:157 os2type = SPTR_ICONQUESTION;158 break;159 case IDI_EXCLAMATION_W:160 os2type = SPTR_ICONWARNING;161 break;162 case IDI_ASTERISK_W:163 os2type = SPTR_ICONINFORMATION;164 break;165 default:166 return 0;180 case IDI_APPLICATION_W: 181 os2type = SPTR_PROGRAM; 182 break; 183 case IDI_HAND_W: 184 os2type = SPTR_ICONWARNING; 185 break; 186 case IDI_QUESTION_W: 187 os2type = SPTR_ICONQUESTION; 188 break; 189 case IDI_EXCLAMATION_W: 190 os2type = SPTR_ICONWARNING; 191 break; 192 case IDI_ASTERISK_W: 193 os2type = SPTR_ICONINFORMATION; 194 break; 195 default: 196 return 0; 167 197 } 168 198 … … 176 206 177 207 switch(type) { 178 case IDC_ARROW_W:179 os2type = SPTR_ARROW;180 break;181 case IDC_UPARROW_W:182 os2type = SPTR_ARROW;183 break;184 case IDC_IBEAM_W:185 os2type = SPTR_TEXT;186 break;187 case IDC_ICON_W:188 os2type = SPTR_PROGRAM;189 break;190 case IDC_NO_W:191 os2type = SPTR_ILLEGAL;192 break;193 case IDC_CROSS_W:194 os2type = SPTR_MOVE;195 break;196 case IDC_SIZE_W:197 os2type = SPTR_MOVE;198 break;199 case IDC_SIZEALL_W:200 os2type = SPTR_MOVE;201 break;202 case IDC_SIZENESW_W:203 os2type = SPTR_SIZENESW;204 break;205 case IDC_SIZENS_W:206 os2type = SPTR_SIZENS;207 break;208 case IDC_SIZENWSE_W:209 os2type = SPTR_SIZENWSE;210 break;211 case IDC_SIZEWE_W:212 os2type = SPTR_SIZEWE;213 break;214 case IDC_WAIT_W:215 os2type = SPTR_WAIT;216 break;217 case IDC_APPSTARTING_W:218 os2type = SPTR_WAIT;219 break;220 case IDC_HELP_W: //TODO: Create a cursor for this one221 os2type = SPTR_WAIT;222 break;223 default:224 return 0;208 case IDC_ARROW_W: 209 os2type = SPTR_ARROW; 210 break; 211 case IDC_UPARROW_W: 212 os2type = SPTR_ARROW; 213 break; 214 case IDC_IBEAM_W: 215 os2type = SPTR_TEXT; 216 break; 217 case IDC_ICON_W: 218 os2type = SPTR_PROGRAM; 219 break; 220 case IDC_NO_W: 221 os2type = SPTR_ILLEGAL; 222 break; 223 case IDC_CROSS_W: 224 os2type = SPTR_MOVE; 225 break; 226 case IDC_SIZE_W: 227 os2type = SPTR_MOVE; 228 break; 229 case IDC_SIZEALL_W: 230 os2type = SPTR_MOVE; 231 break; 232 case IDC_SIZENESW_W: 233 os2type = SPTR_SIZENESW; 234 break; 235 case IDC_SIZENS_W: 236 os2type = SPTR_SIZENS; 237 break; 238 case IDC_SIZENWSE_W: 239 os2type = SPTR_SIZENWSE; 240 break; 241 case IDC_SIZEWE_W: 242 os2type = SPTR_SIZEWE; 243 break; 244 case IDC_WAIT_W: 245 os2type = SPTR_WAIT; 246 break; 247 case IDC_APPSTARTING_W: 248 os2type = SPTR_WAIT; 249 break; 250 case IDC_HELP_W: //TODO: Create a cursor for this one 251 os2type = SPTR_WAIT; 252 break; 253 default: 254 return 0; 225 255 } 226 256 return WinQuerySysPointer(HWND_DESKTOP, os2type, TRUE); -
trunk/src/user32/pmwindow.cpp
r985 r996 1 /* $Id: pmwindow.cpp,v 1. 2 1999-09-19 18:33:31sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.3 1999-09-21 08:24:04 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 558 558 559 559 case WM_TIMER: 560 win32wnd->MsgTimer((ULONG)mp1); 560 561 goto RunDefWndProc; 561 562 -
trunk/src/user32/win32wbase.cpp
r992 r996 1 /* $Id: win32wbase.cpp,v 1. 4 1999-09-20 19:17:58sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.5 1999-09-21 08:24:05 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 801 801 802 802 return SendInternalMessageA(WM_MOVE, 0, MAKELONG((USHORT)x, (USHORT)y)); 803 } 804 //****************************************************************************** 805 //****************************************************************************** 806 ULONG Win32BaseWindow::MsgTimer(ULONG TimerID) 807 { 808 // TODO: call TIMERPROC if not NULL 809 return SendInternalMessageA(WM_TIMER, TimerID, 0); 803 810 } 804 811 //****************************************************************************** … … 1089 1096 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 1090 1097 return GetSysColorBrush(COLOR_BTNFACE); 1091 1098 1092 1099 //SvL: Set background color to default dialog color if window is dialog 1093 1100 case WM_CTLCOLORDLG: 1094 1101 case WM_CTLCOLORSTATIC: 1095 if(IsDialog()) {1096 SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE));1097 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));1098 return GetSysColorBrush(COLOR_BTNFACE);1099 }1100 //no break1102 if(IsDialog()) { 1103 SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE)); 1104 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT)); 1105 return GetSysColorBrush(COLOR_BTNFACE); 1106 } 1107 //no break 1101 1108 1102 1109 case WM_CTLCOLORMSGBOX: … … 1479 1486 dprintf(("Win32BaseWindow::SetIcon %x", hIcon)); 1480 1487 if(OSLibWinSetIcon(OS2HwndFrame, hIcon) == TRUE) { 1481 SendInternalMessageA(WM_SETICON, hIcon, 0);1482 return TRUE;1488 SendInternalMessageA(WM_SETICON, hIcon, 0); 1489 return TRUE; 1483 1490 } 1484 1491 return FALSE; -
trunk/src/user32/win32wbase.h
r949 r996 1 /* $Id: win32wbase.h,v 1. 1 1999-09-15 23:19:01sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.2 1999-09-21 08:24:05 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 74 74 ULONG MsgSetFocus(HWND hwnd); 75 75 ULONG MsgKillFocus(HWND hwnd); 76 ULONG MsgTimer(ULONG TimerID); 76 77 ULONG MsgCommand(ULONG cmd, ULONG Id, HWND hwnd); 77 78 ULONG MsgSysCommand(ULONG win32sc, ULONG x, ULONG y); -
trunk/src/user32/window.cpp
r963 r996 1 /* $Id: window.cpp,v 1. 3 1999-09-17 18:49:53 dengertExp $ */1 /* $Id: window.cpp,v 1.4 1999-09-21 08:24:05 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 690 690 { 691 691 dprintf(("USER32: GetDesktopWindow\n")); 692 return OSLIB_HWND_DESKTOP;692 return 0; 693 693 } 694 694 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.
