Changeset 11 for trunk/settings.cpp
- Timestamp:
- Feb 21, 2018, 1:01:16 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 "";
Note:
See TracChangeset
for help on using the changeset viewer.