// C++ code Copyright (C) David R. Evans G4AMJ/NQ0I // MIDAS encapsulation #define REV_NR 17.00 #include #ifdef MSDOS #include #include #endif #include #include #include #include // the Mac doesn't put some files in the usual places #ifndef MAC #include #include #endif #ifdef MAC #include #include #endif // SunView mode #ifdef SUNVIEW #include // SunView batch mode #ifdef BATCH #include #endif #endif // VGA mode #ifdef IBMVGA #include #include #endif // MAC mode #ifdef MAC #include #endif // Windows mode #ifdef MSWINDOWS #include // Windows batch mode #ifdef BATCH #include #endif #endif const float rev_nr = REV_NR; operating_mode *mode; #ifdef IBMVGA extern vga_mode* vmode; int _fmode = O_BINARY; #endif #ifdef MSWINDOWS #define MAIN OwlMain #else #define MAIN main #endif /****************************** Main **********************************/ MAIN(int argc, char** argv) { #ifndef MSWINDOWS if (argc > 2) then { cerr << "Usage : " << argv[0] << " [batch file]\n"; exit(-1); } #endif #ifdef SUNVIEW #ifdef BATCH if (argc == 2) then // read from batch file { sunbmode = new sun_batch_mode(argv[1], rev_nr); mode = sunbmode; sunbmode->execute(); } else #endif { imode = new sunview_mode(rev_nr); mode = imode; window_main_loop((Frame)(imode->base())); exit(0); } #endif #ifdef IBMVGA vmode = new vga_mode(rev_nr); mode = vmode; vmode->execute(); delete vmode; #endif #ifdef MSWINDOWS #ifdef BATCH if (argc == 2) then // read from batch file { winbmode = new windows_batch_mode(argv[1], rev_nr); mode = winbmode; winbmode->execute(); delete winbmode; } else #endif // check that the system meets our minimum requirements { if (!mouse_present()) then fatal_error("No mouse detected"); if ((screen_width() < 800) || (screen_height() < 600)) then fatal_error("Screen has resolution < 800x600"); // OK. Go ahead. wmode = new windows_mode(REV_NR); mode = wmode; wmode->execute(); delete wmode; } #endif #ifdef MAC mmode = new mac_mode(rev_nr); mode = mmode; mmode->execute(); delete mmode; #endif return 0; }