Changeset 11
- Timestamp:
- Feb 21, 2018, 1:01:16 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bitmap.cpp
r2 r11 18 18 ***/ 19 19 20 // ** CaptureWindow ******************************************************* /* fold00*/20 // ** CaptureWindow ******************************************************* /*FOLD00*/ 21 21 22 22 #define MAX_WAIT 15 … … 42 42 for (USHORT i = 0; i < MAX_WAIT; i++) 43 43 { 44 _sleep2(100);44 DosSleep (100); 45 45 WinQueryWindowPos (hwndParent, &swp); 46 46 if ((swp.hwndInsertBehind == HWND_TOP) || … … 149 149 sizeof (aptl) / sizeof (POINTL), /* Number of points in aptl */ 150 150 aptl, ROP_SRCCOPY, BBO_IGNORE); 151 SaveBitmap (hbm, hpsMem );151 SaveBitmap (hbm, hpsMem, sWidth, sHeight, bmp.cBitCount); 152 152 153 153 // re-associate the previous bit map and the memory presentation space -
trunk/english/gotresen.rc
r5 r11 20 20 21 21 /* Please do NOT try to translate the following statement :-) */ 22 RCINCLUDE " src\common.rc"22 RCINCLUDE "..\common.rc" 23 23 24 24 /* Please adjust the name of the language (but leave the number alone :-) … … 80 80 FS_NOBYTEALIGN | FS_DLGBORDER | NOT WS_VISIBLE, 81 81 FCF_TITLEBAR | FCF_SYSMENU | FCF_AUTOICON | FCF_TASKLIST | FCF_MINBUTTON 82 BEGIN / / Please do NOT try to translate the "thth.wc..." ;-)82 BEGIN /* Please do NOT try to translate the "thth.wc..." ;-)*/ 83 83 WINDOW "", FID_CLIENT, 0, 0, 200, 70, "thth.wc.gotcha.main", 84 84 FS_NOBYTEALIGN | NOT WS_VISIBLE … … 272 272 IDS_PAGELANGUAGE "Language" 273 273 274 IDS_B ITMAP12INTERNAL "Bitmap 1.2 (Saved using Gotcha! internal routine)"275 IDS_B ITMAP16INTERNAL "Bitmap 1.6 (Saved using Gotcha! internal routine)"276 IDS_B ITMAP20INTERNAL "Bitmap 2.0 (Saved using Gotcha! internal routine)"277 IDS_B ITMAP13MMOS2 "Bitmap 1.3 (Saved using OS/2 Multimedia)"278 IDS_B ITMAP20MMOS2 "Bitmap 2.0 (Saved using OS/2 Multimedia)"279 IDS_ TIFFCOMPRESSED "TIFF compressed"280 IDS_ TIFFUNCOMPRESSED "TIFF uncompressed"281 IDS_ TGA "TGA"282 IDS_ PCX "PCX"283 IDS_ GIF "GIF"284 IDS_ JPEG "Jpeg (Probably won't work, reason unknown)"285 IDS_ DIB "DIB (Device Independent Bitmap)"274 IDS_BMF_JPG "JPEG Interchange File Format (jpg)" 275 IDS_BMF_PNG "Portable Network Graphics (png)" 276 IDS_BMF_OS20 "OS/2 Bitmap 2.0 (bmp)" 277 IDS_BMF_TIF "Microsoft/Aldus Tagged Image File Format (tif)" 278 IDS_BMF_TGA "Truevision Targa/Vista (tga)" 279 IDS_BMF_PCX "ZSoft PC Paintbrush Image Format (pcx)" 280 IDS_BMF_GIF "Portable Anymap (pnm)" 281 IDS_BMF_PBM "Portable Pixel-map (ppm)" 282 IDS_BMF_JP2 "Jpeg 2000 (provided by the Open Source OpenJPEG library) (jp2)" 283 IDS_BMF_JBG "JBIG Joint Bi-level Image experts Group (jbg)" 284 IDS_BMF_RAW "Camera RAW Image Format (raw)" 285 IDS_BMF_DIB "Device Independent Bitmap (dib)" 286 286 287 287 IDS_SNAPLABEL "Snap!" -
trunk/id.h
r2 r11 148 148 #define IDS_PAGEMISC 20 149 149 #define IDS_PAGELANGUAGE 21 150 #define IDS_B ITMAP12INTERNAL22151 #define IDS_B ITMAP16INTERNAL23152 #define IDS_B ITMAP20INTERNAL24153 #define IDS_B ITMAP13MMOS225154 #define IDS_B ITMAP20MMOS226155 #define IDS_ TIFFCOMPRESSED27156 #define IDS_ TIFFUNCOMPRESSED28157 #define IDS_ TGA29158 #define IDS_ PCX30159 #define IDS_ GIF31160 #define IDS_ JPEG32161 #define IDS_ DIB33150 #define IDS_BMF_JPG 22 151 #define IDS_BMF_PNG 23 152 #define IDS_BMF_OS20 24 153 #define IDS_BMF_TIF 25 154 #define IDS_BMF_TGA 26 155 #define IDS_BMF_PCX 27 156 #define IDS_BMF_GIF 28 157 #define IDS_BMF_PBM 29 158 #define IDS_BMF_JP2 30 159 #define IDS_BMF_JBG 31 160 #define IDS_BMF_RAW 32 161 #define IDS_BMF_DIB 33 162 162 #define IDS_SNAPLABEL 34 163 163 #define IDS_GENERALHELP 35 -
trunk/savebmp.cpp
r2 r11 20 20 #include <time.h> 21 21 22 // ** SaveBitmap ********************************************************** /*fold00*/ 23 24 VOID SaveBitmap (HBITMAP hbm, HPS hps) 22 #include "gbm\gbm.h" 23 #include "gbm\gbmmem.h" 24 #include "model.h" 25 26 #define __PMPRINTF__ 27 #include "PMPRINTF.H" 28 29 /* ------------------------------ */ 30 static int StrideOf(const MOD *mod) 25 31 { 32 DebugHereIAm(); 33 return ( ( mod->gbm.w * mod->gbm.bpp + 31 ) / 32 ) * 4; 34 } 35 /*...e*/ 36 37 /*...sAllocateData:0:*/ 38 static BOOL AllocateData(MOD *mod) 39 { 40 const unsigned long stride = StrideOf(mod); 41 if ( (mod->pbData = (UCHAR*) gbmmem_malloc(stride * mod->gbm.h)) == NULL ) 42 return FALSE; 43 DebugHereIAm(); 44 return TRUE; 45 } 46 /*...e*/ 47 48 /*...sModCreate:0:*/ 49 MOD_ERR ModCreate( 50 int w, int h, int bpp, const GBMRGB gbmrgb[], 51 MOD *modNew 52 ) 53 { 54 modNew->gbm.w = w; 55 modNew->gbm.h = h; 56 modNew->gbm.bpp = bpp; 57 if ( gbmrgb != NULL && bpp != 24 ) 58 memcpy(&(modNew->gbmrgb), gbmrgb, sizeof(GBMRGB) << bpp); 59 if ( !AllocateData(modNew) ) 60 return MOD_ERR_MEM; 61 DebugHereIAm(); 62 return MOD_ERR_OK; 63 } 64 /*...e*/ 65 66 /*MOD_ERR ModCreateFromHPS( 67 HPS hps, int w, int h, int bpp, //lBitCountScreen > 8 ) ? 24 : lBitCountScreen 68 MOD *modNew 69 )*/ 70 /*...sModCreateFromHPS:0:*/ 71 MOD_ERR ModCreateFromHPS( 72 HPS hps, int w, int h, int bpp, 73 MOD *modNew 74 ) 75 { 76 MOD_ERR mrc; 77 78 #pragma pack(2) 79 struct 80 { 81 BITMAPINFOHEADER2 bmp2; 82 RGB2 argb2Color[0x100]; 83 } bm; 84 #pragma pack() 85 86 if ( (mrc = ModCreate(w, h, bpp, NULL, modNew)) != MOD_ERR_OK ) 87 return mrc; 88 DebugHereIAm(); 89 memset(&(bm.bmp2), 0, sizeof(bm.bmp2)); 90 bm.bmp2.cbFix = sizeof(BITMAPINFOHEADER2); 91 bm.bmp2.cx = w; 92 bm.bmp2.cy = h; 93 bm.bmp2.cBitCount = bpp; 94 bm.bmp2.cPlanes = 1; 95 GpiQueryBitmapBits(hps, 0L, h, modNew->pbData, (BITMAPINFO2 *) &bm); 96 97 if ( bpp != 24 ) 98 { 99 int i; 100 for ( i = 0; i < (1<<bpp); i++ ) 101 { 102 modNew->gbmrgb[i].r = bm.argb2Color[i].bRed ; 103 modNew->gbmrgb[i].g = bm.argb2Color[i].bGreen; 104 modNew->gbmrgb[i].b = bm.argb2Color[i].bBlue ; 105 } 106 } 107 DebugHereIAm(); 108 return MOD_ERR_OK; 109 } 110 /*...e*/ 111 112 /*MOD_ERR ModWriteToFile( 113 const MOD *mod, 114 const CHAR *szFn, const CHAR *szOpt // "" 115 )*/ 116 /*...sModWriteToFile:0:*/ 117 MOD_ERR ModWriteToFile( 118 const MOD *mod, 119 const CHAR *szFn, const CHAR *szOpt 120 ) 121 { 122 GBM_ERR grc; 123 int fd, ft, flag = 0; 124 GBMFT gbmft; 125 126 if ( (grc = gbm_guess_filetype(szFn, &ft)) != GBM_ERR_OK ) { 127 return grc; 128 } 129 PmpfF(( "file type %i", ft )); 130 DebugHereIAm(); 131 gbm_query_filetype(ft, &gbmft); 132 PmpfF(( "file type %i name %s flags %i bpp %i", ft, gbmft.short_name, 133 gbmft.flags, mod->gbm.bpp)); 134 switch ( mod->gbm.bpp ) 135 { 136 case 1: flag = GBM_FT_W1; break; 137 case 4: flag = GBM_FT_W4; break; 138 case 8: flag = GBM_FT_W8; break; 139 case 24: flag = GBM_FT_W24; break; 140 default: flag = 0; break; 141 } 142 143 if ( (gbmft.flags & flag) == 0 ) 144 return MOD_ERR_SUPPORT; 145 DebugHereIAm(); 146 if ( (fd = gbm_io_create(szFn, GBM_O_WRONLY)) == -1 ) 147 return MOD_ERR_CREATE; 148 DebugHereIAm(); 149 if ( (grc = gbm_write(szFn, fd, ft, &(mod->gbm), mod->gbmrgb, mod->pbData, szOpt)) != GBM_ERR_OK ) 150 { 151 gbm_io_close(fd); 152 unlink(szFn); 153 return MOD_ERR_GBM(grc); 154 } 155 DebugHereIAm(); 156 gbm_io_close(fd); 157 DebugHereIAm(); 158 return MOD_ERR_OK; 159 } 160 /*...e*/ 161 // ** SaveBitmap ********************************************************** /*FOLD00*/ 162 163 VOID SaveBitmap (HBITMAP hbm, HPS hps, int width, int height, int bitCount) 164 { 26 165 #ifdef _DOLOGMEM_ 27 166 LogMem("SaveBitmap", TRUE); 28 167 #endif 168 MOD newmod; 29 169 30 170 if( pset->QueryFileSaveStyle () == FSS_FORCEFILE ) … … 32 172 PSZ psz = pset->QueryForceSaveFile(); 33 173 psz = AddExtensionToFilename( psz ); 34 SaveBitmapToFile( hbm, psz, hps ); 174 // 175 /*if( ( pset->QueryFileFormat() == BMF_12 ) || 176 ( pset->QueryFileFormat() == BMF_16 ) || 177 ( pset->QueryFileFormat() == BMF_20 ) ) { 178 SaveBitmapToFile( hbm, psz, hps ); 179 DebugHereIAm(); 180 } 181 else { */ 182 ModCreateFromHPS( hps, width, height, 183 (bitCount > 8 ) ? 24 : bitCount, 184 &newmod ); 185 ModWriteToFile(&newmod, psz, "" ); 186 //} 35 187 #ifdef _DOLOGMEM_ 36 188 LogMem( "SaveBitmap-1", FALSE ); … … 60 212 LogDebug( "Before call to SaveBitmapToFile()" ); 61 213 #endif 62 SaveBitmapToFile (hbm, pset->QuerySaveFile (), hps); 214 //DebugHereIAm(); 215 /*if( ( pset->QueryFileFormat() == BMF_12 ) || 216 ( pset->QueryFileFormat() == BMF_16 ) || 217 ( pset->QueryFileFormat() == BMF_20 ) ) { 218 DebugHereIAm(); 219 SaveBitmapToFile( hbm, pset->QuerySaveFile (), hps ); 220 DebugHereIAm(); 221 } 222 else {*/ 223 ModCreateFromHPS( hps, width, height, 224 (bitCount > 8 ) ? 24 : bitCount, 225 &newmod ); 226 ModWriteToFile(&newmod, pset->QuerySaveFile (), "" ); 227 //} 63 228 #ifdef _DOLOGDEBUG_ 64 229 LogDebug( "After call to SaveBitmapToFile()" ); … … 96 261 #define CB_20HEADER sizeof (BITMAPINFOHEADER2) // == 64 97 262 263 #if 0 98 264 VOID SaveBitmapToFile (HBITMAP hbm, PSZ psz, HPS hps) 99 265 { … … 274 440 fwrite (pb, cbBits, 1, pf); 275 441 fclose (pf); 276 } else { 442 } 443 444 /*else { 277 445 #ifdef _DOLOGDEBUG_ 278 446 LogDebug( "SaveBitmapToFile(): Starting 'else' path." ); … … 304 472 // Open target file. 305 473 HMMIO hmmioTarget; 306 if( ! ( hmmioTarget = pset->GetMMIO()->pfmmioOpen( psz,474 if( ! ( hmmioTarget = mmioOpen( psz, 307 475 &mmioinfoTarget, 308 476 MMIO_CREATE | MMIO_WRITE | 309 MMIO_DENYWRITE | MMIO_NOIDENTIFY ) )) {477 MMIO_DENYWRITE | MMIO_NOIDENTIFY ))) { 310 478 DisplayError ("mmioOpen()-Error", 311 479 "mmioOpen()-Error %ld", mmioinfoTarget.ulErrorRet ); … … 319 487 ULONG ulImageHeaderLength; 320 488 321 xmmioQueryHeaderLength( hmmioTarget, (PLONG)&ulImageHeaderLength, 0L, 0L );489 mmioQueryHeaderLength( hmmioTarget, (PLONG)&ulImageHeaderLength, 0L, 0L ); 322 490 if( ulImageHeaderLength != sizeof( MMIMAGEHEADER ) ) 323 491 { 324 492 // We have a problem.....possibly incompatible versions. 325 xmmioClose( hmmioTarget, 0L );493 mmioClose( hmmioTarget, 0L ); 326 494 DisplayError ("mmioQueryHeaderLength()-Error", 327 495 "mmioQueryHeaderLength()-Error", … … 355 523 #endif 356 524 ULONG ulBytesRead; 357 if( ( rc = (LONG) xmmioSetHeader( hmmioTarget, (MMIMAGEHEADER*)&mmImgHdr,525 if( ( rc = (LONG)mmioSetHeader( hmmioTarget, (MMIMAGEHEADER*)&mmImgHdr, 358 526 (LONG)sizeof( MMIMAGEHEADER ), (PLONG)&ulBytesRead, 359 527 0L, 0L ) ) != MMIO_SUCCESS ) 360 528 { 361 529 // Header unavailable. 362 xmmioClose( hmmioTarget, 0L );530 mmioClose( hmmioTarget, 0L ); 363 531 DisplayError ("mmioSetHeader()-Error", 364 532 "mmioSetHeader()-Error %ld", rc ); … … 370 538 371 539 // write the actual bitmap data bits 372 if( ( rc = xmmioWrite( hmmioTarget,pb, cbBits ) ) == MMIO_ERROR )540 if( ( rc = mmioWrite( hmmioTarget, (CHAR *) pb, cbBits ) ) == MMIO_ERROR ) 373 541 DisplayError ("mmioWrite()-Error", 374 542 "mmioWrite()-Error %ld", rc ); … … 377 545 #endif 378 546 379 if( ( rc = xmmioClose( hmmioTarget, 0 ) ) != MMIO_SUCCESS )547 if( ( rc = mmioClose( hmmioTarget, 0 ) ) != MMIO_SUCCESS ) 380 548 DisplayError ("mmioClose()-Error", 381 549 "mmioClose()-Error %ld", rc ); … … 383 551 LogDebug( "SaveBitmapToFile(): xmmioClose ok." ); 384 552 #endif 385 } 553 } */ 386 554 387 555 #ifdef _DOLOGDEBUG_ … … 399 567 #endif 400 568 } 401 569 #endif 402 570 // ** SetEAs ************************************************************** /*FOLD00*/ 403 571 … … 620 788 } 621 789 622 // ** AddExtensionToFilename ********************************************** /* fold00*/790 // ** AddExtensionToFilename ********************************************** /*FOLD00*/ 623 791 624 792 PSZ AddExtensionToFilename( PSZ psz ) … … 629 797 PSZ pszExtension; 630 798 631 PSZ apszValidExtensions[10] = 632 { "bmp", "tif", "tiff", "tga", "targa", "pcx", "gif", "jpg", "jpeg", "dib" }; 799 PSZ apszValidExtensions[16] = 800 { "bmp", "tif", "tiff", "tga", "targa", "pcx", "pnm", "jpg", "jpeg", 801 "jpg2", "jbg", "jbig", "png", "ppm", "raw", "dib" }; 633 802 634 803 if( ! ( pszExtension = strrchr( psz, '.' ) ) ) { … … 641 810 // Some extension, but not the correct one - change or append. 642 811 BOOL fValidExtension = FALSE; 643 for( int i = 0; i < 1 0; i++ ) {812 for( int i = 0; i < 16; i++ ) { 644 813 if( stricmp( pszExtension+1, apszValidExtensions[i] ) == 0 ) { 645 814 fValidExtension = TRUE; -
trunk/settings.cpp
r2 r11 17 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 ***/ 19 19 #include <direct.h> 20 20 #include "settings.h" 21 21 #include "ctype.h" … … 32 32 USHORT ausDefSSW[7] = { 0 }; 33 33 34 #if 0 34 35 ImageFormatInfo Settings::ifi[BMF_INVALID] = 35 36 { … … 48 49 }; 49 50 51 #else 52 // pbm and gif don't save anything 53 ImageFormatInfo Settings::ifi[BMF_INVALID] = 54 { 55 { TRUE, BMF_JPG, 0L, "JPEG Interchange File Format (jpg)", "jpg", "JPG" }, 56 { TRUE, BMF_PNG, 0L, "Portable Network Graphics (png)", "png", "PNG" }, 57 { TRUE, BMF_OS20, 0L, "OS/2 Bitmap 2.0 (bmp)", "bmp", "Bitmap" }, 58 { TRUE, BMF_TIF, 0L, "Microsoft/Aldus Tagged Image File Format (tif)", "tif", "TIFF" }, 59 { TRUE, BMF_TGA, 0L, "Truevision Targa/Vista (tga)", "tga", "Targa" }, 60 { TRUE, BMF_PCX, 0L, "ZSoft PC Paintbrush Image Format (pcx)", "pcx", "PCX" }, 61 { TRUE, BMF_GIF, 0L, "Portable Anymap (pnm)", "pnm", "PNM" }, 62 { TRUE, BMF_PBM, 0L, "Portable Pixel-map (ppm)", "ppm", "PPM" }, 63 { TRUE, BMF_JP2, 0L, "Jpeg 2000 (provided by the Open Source OpenJPEG library) (jp2)", "jp2", "JP2" }, 64 { TRUE, BMF_JBG, 0L, "JBIG Joint Bi-level Image experts Group (jbg)", "jbg", "JBG" }, 65 { TRUE, BMF_RAW, 0L, "Camera RAW Image Format (raw)", "raw", "RAW" }, 66 { TRUE, BMF_DIB, 0L, "Device Independent Bitmap (dib)", "dib", "DIB" } 67 }; 68 #endif 69 50 70 PTHTH_SE apse[] = 51 71 { 52 new THTH_SES (SEI_SAVEFILE, "Save", "Filename", "gotcha. bmp"),53 new THTH_SES (SEI_FORCESAVEFILE, "Save", "ForceSaveFilename", "force. bmp"),54 new THTH_SEL (SEI_SAVESTYLE, "Save", "Style", SAVESTYLE_ CLIPBOARD),55 new THTH_SEL (SEI_FILEFORMAT, "Save", "FileFormat", BMF_ 16),72 new THTH_SES (SEI_SAVEFILE, "Save", "Filename", "gotcha.png"), 73 new THTH_SES (SEI_FORCESAVEFILE, "Save", "ForceSaveFilename", "force.png"), 74 new THTH_SEL (SEI_SAVESTYLE, "Save", "Style", SAVESTYLE_FILE), 75 new THTH_SEL (SEI_FILEFORMAT, "Save", "FileFormat", BMF_PNG), 56 76 new THTH_SEL (SEI_FILESAVESTYLE, "Save", "FileSaveStyle", FSS_PROMPT), 57 77 … … 133 153 134 154 if( pv ) { 135 if( mmio ->pfmmioGetFormats( &mmfi, lNumFormats, pv, &lReturned, 0, 0 )155 if( mmioGetFormats( &mmfi, lNumFormats, pv, &lReturned, 0, 0 ) 136 156 != MMIO_SUCCESS ) { 137 157 DisplayError( "MMIO-Error", … … 440 460 } 441 461 442 // ** Page1Procedure ****************************************************** /* fold00*/462 // ** Page1Procedure ****************************************************** /*FOLD00*/ 443 463 444 464 MRESULT EXPENTRY … … 494 514 MPFROM2SHORT (0, _MAX_PATH), (MPARAM)0); 495 515 496 /* switch (pset->QueryFileFormat ())497 {498 case BMF_20:499 WinSendDlgItemMsg (hwnd, WID_RB_BMF20, BM_CLICK,500 MPFROMSHORT(TRUE), 0);501 break;502 case BMF_12:503 WinSendDlgItemMsg (hwnd, WID_RB_BMF12, BM_CLICK,504 MPFROMSHORT(TRUE), 0);505 break;506 default:507 WinSendDlgItemMsg (hwnd, WID_RB_BMF16, BM_CLICK,508 MPFROMSHORT(TRUE), 0);509 break;510 } */511 512 516 // Select the appropriate entry in the fileformat-listbox. 513 517 HWND hwndLB = WinWindowFromID( hwnd, WID_LB_FILEFORMAT ); … … 584 588 MPFROMLONG( ul ), NULL ) ); 585 589 pset->SetFileFormat( SHORT( ul ) ); 586 /* if (WinSendMsg (WinWindowFromID (hwnd, WID_RB_BMF12), 587 BM_QUERYCHECK, 0,0)) 588 pset->SetFileFormat (BMF_12); 589 else if (WinSendMsg (WinWindowFromID (hwnd, WID_RB_BMF20), 590 BM_QUERYCHECK, 0,0)) 591 pset->SetFileFormat (BMF_20); 592 else 593 pset->SetFileFormat (BMF_16); */ 590 591 pset->SetSaveFile(AddExtensionToFilename(pset->QuerySaveFile())); 592 594 593 #ifdef _DOLOGDEBUG_ 595 594 LogDebug( "Page1Procedure: checkpoint 2" ); … … 912 911 LogDebug( "Page4Procedure: WM_INITDLG: Doing '%s' ...", findbuf.achName ); 913 912 #endif 914 if ((psz = _getext (findbuf.achName)))913 if ((psz = strchr (findbuf.achName, '.'))) 915 914 *psz = '\0'; 916 915 findbuf.achName[0] = toupper (findbuf.achName[0]); … … 1071 1070 } 1072 1071 1073 // ** ReloadResources ***************************************************** /* fold00*/1072 // ** ReloadResources ***************************************************** /*FOLD00*/ 1074 1073 1075 1074 BOOL Settings :: ReloadResources (PSZ psz) … … 1080 1079 APIRET rc; 1081 1080 1082 if ((rc = DosLoadModule(PSZ(NULL), 0, psz, &g_hmod)))1081 if ((rc = DosLoadModule(PSZ(NULL), 0, "gotresen.dll", &g_hmod))) 1083 1082 { 1084 1083 DisplayError("ERROR", "Could not (re)load Gotcha! resource module " … … 1097 1096 1098 1097 for( int i = 0; i < BMF_INVALID; i++ ) { 1099 ifi[ i ].label = RSTR ( IDS_B ITMAP12INTERNAL+i ); }1098 ifi[ i ].label = RSTR ( IDS_BMF_JPG+i ); } 1100 1099 1101 1100 return TRUE; … … 1117 1116 } 1118 1117 1119 // ** GetLanguages ******************************************************** /* fold00*/1118 // ** GetLanguages ******************************************************** /*FOLD00*/ 1120 1119 1121 1120 USHORT Settings :: GetLanguages (HWND hwnd) … … 1137 1136 { 1138 1137 // we don't want the extension 1139 if ((psz = _getext (findbuf.achName)))1138 if ((psz = strchr (findbuf.achName, '.'))) 1140 1139 *psz = '\0'; 1141 1140 // try opening the dll and read the version etc. data … … 1161 1160 } 1162 1161 1163 // ** GetFileExtension **************************************************** /* fold00*/1164 1165 PSZ Settings :: GetFileExtension( SHORT type = BMF_INVALID)1162 // ** GetFileExtension **************************************************** /*FOLD00*/ 1163 1164 PSZ Settings :: GetFileExtension( SHORT type ) 1166 1165 { 1167 1166 if( type == BMF_INVALID ) 1168 1167 type = SHORT( QueryFileFormat() ); 1169 if( ( type >= BMF_ 12) && ( type < BMF_INVALID ) )1168 if( ( type >= BMF_JPG ) && ( type < BMF_INVALID ) ) 1170 1169 return ifi[ type ].extension; 1171 1170 return ""; 1172 1171 } 1173 1172 1174 // ** GetFOURCC *********************************************************** /* fold00*/1175 1176 FOURCC Settings :: GetFOURCC( SHORT type = BMF_INVALID)1173 // ** GetFOURCC *********************************************************** /*FOLD00*/ 1174 1175 FOURCC Settings :: GetFOURCC( SHORT type ) 1177 1176 { 1178 1177 if( type == BMF_INVALID ) 1179 1178 type = SHORT( QueryFileFormat() ); 1180 if( ( type >= BMF_ 12) && ( type < BMF_INVALID ) )1179 if( ( type >= BMF_JPG ) && ( type < BMF_INVALID ) ) 1181 1180 return ifi[ type ].fourcc; 1182 1181 return 0L; 1183 1182 } 1184 1183 1185 // ** GetFileEAType ******************************************************* /* fold00*/1186 1187 PSZ Settings :: GetFileEAType( SHORT type = BMF_INVALID)1184 // ** GetFileEAType ******************************************************* /*FOLD00*/ 1185 1186 PSZ Settings :: GetFileEAType( SHORT type ) 1188 1187 { 1189 1188 if( type == BMF_INVALID ) 1190 1189 type = SHORT( QueryFileFormat() ); 1191 if( ( type >= BMF_ 12) && ( type < BMF_INVALID ) )1190 if( ( type >= BMF_JPG ) && ( type < BMF_INVALID ) ) 1192 1191 return ifi[ type ].eaType; 1193 1192 return ""; -
trunk/settings.h
r2 r11 35 35 36 36 enum { SAVESTYLE_CLIPBOARD, SAVESTYLE_FILE, }; 37 #if 0 37 38 enum { 38 39 BMF_12, BMF_16, BMF_20, BMF_OS13, BMF_OS20, BMF_TIF, BMF_TIFU, … … 40 41 BMF_INVALID 41 42 }; 43 #else 44 enum { 45 BMF_JPG, BMF_PNG, BMF_OS20, BMF_TIF, BMF_TGA, BMF_PCX, BMF_GIF, 46 BMF_PBM, BMF_JP2, BMF_JBG, BMF_RAW, BMF_DIB, 47 BMF_INVALID 48 }; 49 #endif 42 50 enum { FSS_PROMPT, FSS_NUMFILES, FSS_FORCEFILE, }; 43 51 … … 180 188 // ** inline funcs ******************************************************** /*FOLD00*/ 181 189 182 inline VOID Settings :: SetWindowData (SWP *pswp, BOOL f = TRUE)190 inline VOID Settings :: SetWindowData (SWP *pswp, BOOL f) 183 191 { 184 192 // FIXME puke, yukk, choke! get this flag thing away! do it better! … … 196 204 } 197 205 198 inlinethth_MMIO *Settings :: GetMMIO( VOID ) { return mmio; }206 thth_MMIO *Settings :: GetMMIO( VOID ) { return mmio; } 199 207 200 208 // ************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.