MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / EndFileX

Function EndFileX

xdevice.cpp:1335–1393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1333// file as were already writing while creating the chart.
1334
1335void EndFileX()
1336{
1337 if (gi.file == NULL)
1338 return;
1339 if (gs.ft == ftBmp) {
1340 PrintProgress("Writing chart bitmap to file.");
1341 if (gs.chBmpMode == 'B') {
1342 if (!gi.fBmp)
1343 WriteBmp(gi.file);
1344 else
1345 WriteBmp2(&gi.bmp, gi.file);
1346 } else if (gs.chBmpMode == 'A')
1347 WriteAscii(gi.file);
1348 else if (gs.chBmpMode == 'P')
1349 WritePNG(&gi.bmp, gi.file);
1350 else
1351 WriteXBitmap(gi.file, gi.szFileOut, gs.chBmpMode);
1352 }
1353#ifdef PS
1354 else if (gs.ft == ftPS)
1355 PsEnd();
1356#endif
1357#ifdef META
1358 else if (gs.ft == ftWmf) {
1359 PrintProgress("Writing metafile to file.");
1360 WriteMeta(gi.file);
1361 }
1362#endif
1363#ifdef SVG
1364 else if (gs.ft == ftSVG) {
1365 if (gi.kiSvgAct != kMax)
1366 fprintf(gi.file, "</g>\n");
1367 fprintf(gi.file, "</g>\n</svg>\n");
1368 }
1369#endif
1370#ifdef WIRE
1371 else if (gs.ft == ftWire) {
1372 PrintProgress("Writing wireframe to file.");
1373 WriteWire(gi.file);
1374 }
1375#endif
1376 fclose(gi.file);
1377#ifdef WIN
1378 if (wi.fAutoSave && wi.hMutex != NULL)
1379 ReleaseMutex(wi.hMutex);
1380 if (wi.wCmd == cmdSaveWallTile || wi.wCmd == cmdSaveWallCenter ||
1381 wi.wCmd == cmdSaveWallStretch || wi.wCmd == cmdSaveWallFit ||
1382 wi.wCmd == cmdSaveWallFill) {
1383 WriteProfileString("Desktop", "TileWallpaper",
1384 wi.wCmd == cmdSaveWallTile ? "1" : "0");
1385 WriteProfileString("Desktop", "WallpaperStyle",
1386 wi.wCmd == cmdSaveWallStretch ? "2" : (wi.wCmd == cmdSaveWallFit ? "6" :
1387 (wi.wCmd == cmdSaveWallFill ? "10" : "0")));
1388 SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, gi.szFileOut,
1389 SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE);
1390 wi.wCmd = 0;
1391 }
1392#endif

Callers 1

xscreen.cppFile · 0.85

Calls 9

PrintProgressFunction · 0.85
WriteBmpFunction · 0.85
WriteBmp2Function · 0.85
WriteAsciiFunction · 0.85
WritePNGFunction · 0.85
WriteXBitmapFunction · 0.85
PsEndFunction · 0.85
WriteMetaFunction · 0.85
WriteWireFunction · 0.85

Tested by

no test coverage detected