Changeset 4573 for trunk/src/user32/oslibres.cpp
- Timestamp:
- Nov 9, 2000, 7:15:23 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibres.cpp
r3101 r4573 1 /* $Id: oslibres.cpp,v 1.1 0 2000-03-13 13:10:47sandervl Exp $ */1 /* $Id: oslibres.cpp,v 1.11 2000-11-09 18:15:18 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 24 24 #include "pmwindow.h" 25 25 26 #define DBG_LOCALLOG 26 #define DBG_LOCALLOG DBG_oslibres 27 27 #include "dbglocal.h" 28 28 … … 46 46 } 47 47 //****************************************************************************** 48 //****************************************************************************** 49 HANDLE OSLibWinCreateIcon(PVOID iconbitmap) 48 //TODO: change search method for icon array (cxDesired, cyDesired) 49 //TODO: PM rescales the icon internally!!! ($W(#*&$(*%&) 50 //****************************************************************************** 51 HANDLE OSLibWinCreateIcon(PVOID iconbitmap, ULONG cxDesired, ULONG cyDesired) 50 52 { 51 53 POINTERINFO pointerInfo = {0}; … … 102 104 hps = WinGetScreenPS(HWND_DESKTOP); 103 105 104 hbmColor = GpiCreateBitmap(hps, &bfhColor->bmp2, CBM_INIT, 105 (char *)bafh + bfhColor->offBits, 106 (BITMAPINFO2 *)&bfhColor->bmp2); 106 //Resize icon bitmap if requested size is different 107 if(cxDesired != bfhColor->bmp2.cx|| cyDesired != bfhColor->bmp2.cy) 108 { 109 BITMAPINFOHEADER2 infohdr = bfhColor->bmp2; 110 111 infohdr.cx = cxDesired; 112 infohdr.cy = cyDesired; 113 hbmColor = GpiCreateBitmap(hps, &infohdr, CBM_INIT, 114 (char *)bafh + bfhColor->offBits, 115 (BITMAPINFO2 *)&bfhColor->bmp2); 116 } 117 else { 118 hbmColor = GpiCreateBitmap(hps, &bfhColor->bmp2, CBM_INIT, 119 (char *)bafh + bfhColor->offBits, 120 (BITMAPINFO2 *)&bfhColor->bmp2); 121 } 107 122 if(hbmColor == GPI_ERROR) { 108 123 dprintf(("OSLibWinCreateIcon: GpiCreateBitmap failed!")); … … 110 125 return 0; 111 126 } 112 hbmMask = GpiCreateBitmap(hps, &bfhBW->bmp2, CBM_INIT, 113 (char *)bafh + bfhBW->offBits, 114 (BITMAPINFO2 *)&bfhBW->bmp2); 127 //Resize icon mask if requested size is different 128 if(cxDesired != bfhBW->bmp2.cx|| cyDesired*2 != bfhBW->bmp2.cy) 129 { 130 BITMAPINFOHEADER2 infohdr = bfhBW->bmp2; 131 132 infohdr.cx = cxDesired; 133 infohdr.cy = cyDesired; 134 hbmMask = GpiCreateBitmap(hps, &infohdr, CBM_INIT, 135 (char *)bafh + bfhBW->offBits, 136 (BITMAPINFO2 *)&bfhBW->bmp2); 137 } 138 else { 139 hbmMask = GpiCreateBitmap(hps, &bfhBW->bmp2, CBM_INIT, 140 (char *)bafh + bfhBW->offBits, 141 (BITMAPINFO2 *)&bfhBW->bmp2); 142 } 115 143 if(hbmMask == GPI_ERROR) { 116 144 dprintf(("OSLibWinCreateIcon: GpiCreateBitmap hbmMask failed!")); … … 132 160 GpiDeleteBitmap(hbmColor); 133 161 WinReleasePS(hps); 162 134 163 return hIcon; 135 164 } 136 165 //****************************************************************************** 137 //****************************************************************************** 138 HANDLE OSLibWinCreatePointer(PVOID cursorbitmap) 166 //TODO: change cursor size if required!! (cxDesired, cyDesired) 167 //****************************************************************************** 168 HANDLE OSLibWinCreatePointer(PVOID cursorbitmap, ULONG cxDesired, ULONG cyDesired) 139 169 { 140 170 POINTERINFO pointerInfo = {0};
Note:
See TracChangeset
for help on using the changeset viewer.