- Timestamp:
- Aug 8, 2001, 12:07:19 PM (24 years ago)
- Location:
- trunk/src
- Files:
-
- 3 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.DEF
r6482 r6487 1 ; $Id: KERNEL32.DEF,v 1.12 0 2001-08-07 21:34:15sandervl Exp $1 ; $Id: KERNEL32.DEF,v 1.121 2001-08-08 10:06:52 sandervl Exp $ 2 2 3 3 ;Basis is Windows95 KERNEL32 … … 1190 1190 strncmpiW @2022 NONAME 1191 1191 1192 _ConvertIconGroup@12 @2023 NONAME1193 1194 1192 GetDisplayCodepage__Fv @3000 NONAME 1195 1193 GetWindowsCodepage__Fv @3001 NONAME -
trunk/src/kernel32/kernel32.mak
r6482 r6487 1 # $Id: kernel32.mak,v 1.1 2 2001-08-07 21:34:16sandervl Exp $1 # $Id: kernel32.mak,v 1.13 2001-08-08 10:06:53 sandervl Exp $ 2 2 3 3 # … … 132 132 $(OBJDIR)\hmdisk.obj \ 133 133 $(OBJDIR)\version.obj \ 134 $(OBJDIR)\cvticon.obj \135 $(OBJDIR)\cvticongrp.obj \136 $(OBJDIR)\winres.obj \137 134 !ifdef DEBUG 138 135 $(OBJDIR)\exceptstackdump.obj \ -
trunk/src/kernel32/kernel32lib.mak
r6482 r6487 1 # $Id: kernel32lib.mak,v 1. 4 2001-08-07 21:34:16sandervl Exp $1 # $Id: kernel32lib.mak,v 1.5 2001-08-08 10:06:53 sandervl Exp $ 2 2 3 3 # … … 119 119 $(OBJDIR)\hmdisk.obj \ 120 120 $(OBJDIR)\version.obj \ 121 $(OBJDIR)\cvticon.obj \122 $(OBJDIR)\cvticongrp.obj \123 $(OBJDIR)\winres.obj \124 121 !ifdef DEBUG 125 122 $(OBJDIR)\exceptstackdump.obj \ -
trunk/src/user32/USER32.DEF
r6483 r6487 1 ; $Id: USER32.DEF,v 1.6 4 2001-08-07 21:35:35sandervl Exp $1 ; $Id: USER32.DEF,v 1.65 2001-08-08 10:07:18 sandervl Exp $ 2 2 3 3 LIBRARY USER32 INITINSTANCE TERMINSTANCE … … 703 703 704 704 _OSLibWinCreateObject@32 @2031 NONAME 705 _ConvertIconGroup@12 @2032 NONAME -
trunk/src/user32/icon.cpp
r2804 r6487 1 /* $Id: icon.cpp,v 1.1 0 2000-02-16 14:34:19sandervl Exp $ */1 /* $Id: icon.cpp,v 1.11 2001-08-08 10:07:18 sandervl Exp $ */ 2 2 3 3 /* … … 24 24 #include <string.h> 25 25 26 #include <win32api.h> 26 27 #include <win32type.h> 27 28 #include "dib.h" 28 29 #include <winicon.h> 29 30 #include <misc.h> … … 32 33 #include "dbglocal.h" 33 34 35 #define DIB_RGB_COLORS_W 0 36 #define DIB_PAL_COLORS_W 1 37 #define CBM_INIT_W 4 38 39 #if 0 34 40 //****************************************************************************** 35 41 //****************************************************************************** … … 150 156 //****************************************************************************** 151 157 //****************************************************************************** 158 #endif 159 160 //****************************************************************************** 161 //****************************************************************************** 162 ULONG QueryConvertedIconSize(WINBITMAPINFOHEADER *bmpHdr, int size) 163 { 164 int bwsize, colorsize, rgbsize, iconsize; 165 166 bwsize = DIB_GetDIBImageBytes(bmpHdr->biWidth, (bmpHdr->biHeight/2), 1); 167 colorsize = DIB_GetDIBImageBytes(bmpHdr->biWidth, (bmpHdr->biHeight/2), bmpHdr->biBitCount); 168 169 //SvL: 28-09-'98: only for <= 8 170 if(bmpHdr->biBitCount <= 8) 171 rgbsize = (1<<bmpHdr->biBitCount)*sizeof(RGB2); 172 else rgbsize = 0; 173 174 if(bmpHdr->biSizeImage == 0 && bmpHdr->biCompression == 0) { 175 bmpHdr->biSizeImage = bwsize + colorsize; 176 } 177 178 //SvL: 28-09-'98: cllngenu.dll has an incorrect size in the header 179 if(bmpHdr->biSizeImage < colorsize) { 180 bmpHdr->biSizeImage = colorsize; 181 } 182 //bitmapfileheader for AndXor mask + 2 RGB structs + bitmapfileheader 183 //for color bitmap + RGB structs for all the colors 184 //SvL, 3-3-98: 2*bwsize 185 iconsize = 2*sizeof(BITMAPFILEHEADER2) + 2*sizeof(RGB2) + 186 rgbsize + 2*bwsize + bmpHdr->biSizeImage; 187 188 return iconsize; 189 } 190 //****************************************************************************** 191 //NOTE: offsetBits is the value added to the offBits bitmap structure members 192 // (handy for converting icon groups) 193 //****************************************************************************** 194 void *ConvertIcon(WINBITMAPINFOHEADER *bmpHdr, int size, int *os2size, int offsetBits) 195 { 196 RGBQUAD *rgb; 197 RGB2 *os2rgb; 198 int bwsize, i, colorsize, rgbsize, iconsize; 199 BITMAPFILEHEADER2 *iconhdr; 200 BITMAPFILEHEADER2 *iconhdr2; 201 char *pAnd, *pXor; 202 203 bwsize = DIB_GetDIBImageBytes(bmpHdr->biWidth, (bmpHdr->biHeight/2), 1); 204 colorsize = DIB_GetDIBImageBytes(bmpHdr->biWidth, (bmpHdr->biHeight/2), bmpHdr->biBitCount); 205 //SvL: 28-09-'98: only for <= 8 206 if(bmpHdr->biBitCount <= 8) 207 rgbsize = (1<<bmpHdr->biBitCount)*sizeof(RGB2); 208 else rgbsize = 0; 209 210 if(bmpHdr->biSizeImage == 0 && bmpHdr->biCompression == 0) { 211 bmpHdr->biSizeImage = bwsize + colorsize; 212 } 213 dprintf(("Icon size : %d", bmpHdr->biSizeImage)); 214 dprintf(("Icon Width : %d", bmpHdr->biWidth)); 215 //height for both the XOR and AND bitmap (color & BW) 216 dprintf(("Height : %d", bmpHdr->biHeight)); 217 dprintf(("Icon Bitcount: %d", bmpHdr->biBitCount)); 218 dprintf(("Icon Compress: %d", bmpHdr->biCompression)); 219 220 //SvL: 28-09-'98: cllngenu.dll has an incorrect size in the header 221 if(bmpHdr->biSizeImage < colorsize) { 222 bmpHdr->biSizeImage = colorsize; 223 } 224 //bitmapfileheader for AndXor mask + 2 RGB structs + bitmapfileheader 225 //for color bitmap + RGB structs for all the colors 226 //SvL, 3-3-98: 2*bwsize 227 iconsize = 2*sizeof(BITMAPFILEHEADER2) + 2*sizeof(RGB2) + 228 rgbsize + 2*bwsize + bmpHdr->biSizeImage; 229 230 iconhdr = (BITMAPFILEHEADER2 *)malloc(iconsize); 231 memset(iconhdr, 0, iconsize); 232 iconhdr->usType = BFT_COLORICON; 233 iconhdr->cbSize = sizeof(BITMAPFILEHEADER2); 234 iconhdr->xHotspot = 0; 235 iconhdr->yHotspot = 0; 236 iconhdr->offBits = 2*sizeof(BITMAPFILEHEADER2) + 237 2*sizeof(RGB2) + rgbsize + offsetBits; 238 iconhdr->bmp2.cbFix = sizeof(BITMAPINFOHEADER2); 239 iconhdr->bmp2.cx = (USHORT)bmpHdr->biWidth; 240 iconhdr->bmp2.cy = (USHORT)bmpHdr->biHeight; 241 iconhdr->bmp2.cPlanes = 1; 242 iconhdr->bmp2.cBitCount= 1; 243 iconhdr->bmp2.ulCompression = BCA_UNCOMP; 244 iconhdr->bmp2.ulColorEncoding = BCE_RGB; 245 os2rgb = (RGB2 *)(iconhdr+1); 246 memset(os2rgb, 0, sizeof(RGB2)); 247 memset(os2rgb+1, 0xff, sizeof(RGB)); //not reserved byte! 248 iconhdr2 = (BITMAPFILEHEADER2 *)(os2rgb+2); 249 iconhdr2->usType = BFT_COLORICON; 250 iconhdr2->cbSize = sizeof(BITMAPFILEHEADER2); 251 iconhdr2->xHotspot = 0; 252 iconhdr2->yHotspot = 0; 253 iconhdr2->offBits = 2*sizeof(BITMAPFILEHEADER2) + 254 2*sizeof(RGB2) + rgbsize + 2*bwsize + offsetBits; 255 iconhdr2->bmp2.cbFix = sizeof(BITMAPINFOHEADER2); 256 iconhdr2->bmp2.cx = (USHORT)bmpHdr->biWidth; 257 iconhdr2->bmp2.cy = (USHORT)(bmpHdr->biHeight/2); 258 iconhdr2->bmp2.cPlanes = bmpHdr->biPlanes; 259 iconhdr2->bmp2.cBitCount= bmpHdr->biBitCount; 260 iconhdr2->bmp2.ulCompression = BCA_UNCOMP; 261 iconhdr2->bmp2.ulColorEncoding = BCE_RGB; 262 os2rgb = (RGB2 *)(iconhdr2+1); 263 rgb = (RGBQUAD *)(bmpHdr+1); 264 if(bmpHdr->biBitCount <= 8) { 265 for(i=0;i<(1<<bmpHdr->biBitCount);i++) { 266 os2rgb->bRed = rgb->red; 267 os2rgb->bBlue = rgb->blue; 268 os2rgb->bGreen = rgb->green; 269 os2rgb++; 270 rgb++; 271 } 272 } 273 274 pXor = (char *)os2rgb; 275 pAnd = (char *)os2rgb + bwsize; 276 277 if ((size - (bmpHdr->biSize + rgbsize + colorsize + bwsize)) == bwsize) 278 {//this means an AND and XOR mask is present (interleaved; and/xor) 279 char *q; 280 int i, linesize; 281 282 linesize = bmpHdr->biWidth / 8; 283 q = (char *)rgb + colorsize; 284 for (i = 0; i < (bmpHdr->biHeight/2); i++) { 285 memcpy (pAnd, q, linesize); 286 pAnd += linesize; 287 q += linesize; 288 289 memcpy (pXor, q, linesize); 290 pXor += linesize; 291 q += linesize; 292 } 293 } else { 294 memcpy (pAnd, (char *)rgb + colorsize, bwsize); 295 memset (pXor, 0, bwsize); 296 } 297 memcpy((char *)os2rgb+2*bwsize, (char *)rgb, colorsize); 298 299 *os2size = iconsize; 300 return (void *)iconhdr; 301 } 302 //****************************************************************************** 303 //****************************************************************************** 304 void * WIN32API ConvertIconGroup(void *hdr, HINSTANCE hInstance, DWORD *ressize) 305 { 306 IconHeader *ihdr = (IconHeader *)hdr; 307 ResourceDirectory *rdir = (ResourceDirectory *)(ihdr + 1); 308 int i, groupsize = 0, os2iconsize; 309 BITMAPARRAYFILEHEADER2 *bafh, *orgbafh; 310 WINBITMAPINFOHEADER *iconhdr; 311 void *os2icon; 312 HRSRC hRes; 313 314 dprintf(("Icon Group type :%d", ihdr->wType)); 315 dprintf(("Icon Group count:%d", ihdr->wCount)); 316 for(i=0;i<ihdr->wCount;i++) { 317 dprintf2(("Icon : %d", rdir->wNameOrdinal)); 318 dprintf2(("Width : %d", (int)rdir->bWidth)); 319 dprintf2(("Height : %d", (int)rdir->bHeight)); 320 dprintf2(("Colors : %d", (int)rdir->bColorCount)); 321 dprintf2(("Bits : %d", rdir->wBitCount)); 322 dprintf2(("ResBytes: %d", rdir->lBytesInRes)); 323 hRes = FindResourceA(hInstance, 324 (LPCSTR)rdir->wNameOrdinal, (LPSTR)NTRT_ICON); 325 326 groupsize += QueryConvertedIconSize((WINBITMAPINFOHEADER *)LockResource(LoadResource(hInstance, hRes)), 327 SizeofResource(hInstance, hRes)); 328 rdir++; 329 } 330 groupsize = groupsize+ihdr->wCount*sizeof(BITMAPARRAYFILEHEADER2); 331 bafh = (BITMAPARRAYFILEHEADER2 *)malloc(groupsize); 332 memset(bafh, 0, groupsize); 333 orgbafh = bafh; 334 335 rdir = (ResourceDirectory *)(ihdr + 1); 336 for(i=0;i<ihdr->wCount;i++) { 337 bafh->usType = BFT_BITMAPARRAY; 338 bafh->cbSize = sizeof(BITMAPARRAYFILEHEADER2); 339 bafh->cxDisplay = 0; 340 bafh->cyDisplay = 0; 341 hRes = FindResourceA(hInstance, 342 (LPCSTR)rdir->wNameOrdinal, (LPSTR)NTRT_ICON); 343 if(hRes == NULL) { 344 dprintf(("Can't find icon!")); 345 rdir++; 346 continue; 347 } 348 iconhdr = (WINBITMAPINFOHEADER *)LockResource(LoadResource(hInstance, hRes)); 349 os2icon = ConvertIcon(iconhdr, SizeofResource(hInstance, hRes), &os2iconsize, (ULONG)bafh - (ULONG)orgbafh + sizeof(BITMAPARRAYFILEHEADER2)-sizeof(BITMAPFILEHEADER2)); 350 if(os2icon == NULL) { 351 dprintf(("Can't convert icon!")); 352 rdir++; 353 continue; 354 } 355 356 if(i != ihdr->wCount -1) { 357 bafh->offNext = (ULONG)&bafh->bfh2 - (ULONG)orgbafh + os2iconsize; 358 } 359 else bafh->offNext = 0; 360 361 memcpy((char *)&bafh->bfh2, os2icon, os2iconsize); 362 free(os2icon); 363 364 bafh = (BITMAPARRAYFILEHEADER2 *)((ULONG)&bafh->bfh2 + os2iconsize); 365 366 rdir++; 367 } 368 *ressize = groupsize; 369 return (void *)orgbafh; 370 } 371 //****************************************************************************** 372 //****************************************************************************** -
trunk/src/user32/winicon.cpp
r6241 r6487 1 /* $Id: winicon.cpp,v 1.2 7 2001-07-08 07:15:10sandervl Exp $ */1 /* $Id: winicon.cpp,v 1.28 2001-08-08 10:07:19 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Icon Code for OS/2 … … 836 836 hotspot.y = ICON_HOTSPOT; 837 837 838 //testestest 839 dprintf(("CURSORICON_CreateFromResource %x %x %x %x %d", hInstance, dwResGroupId, hObj, bits, cbSize)); 838 dprintf2(("CURSORICON_CreateFromResource %x %x %x %x %d", hInstance, dwResGroupId, hObj, bits, cbSize)); 840 839 841 840 if (dwVersion == 0x00020000)
Note:
See TracChangeset
for help on using the changeset viewer.