/**** * * WARNING: This file should be identical (below this warning) with main.C. It * used to be a sym link, but now it's a copy for CVS check in. The existence * of this copy under a different name is for use in the Makefile to generate a * .o file with a different root name, which is built with different -D * settings. I.e., main.o and nmain.o are different object files, built from a * common source with different -D settings. It may be unnecessary to do it * this way, but don't worry about it. * */ /* * Top-level of the RSL browser. Call the translator on the given command-line * files and then fire up the browser. */ #include #include #include "std-macros++.h" #include "exception.h" #include "browser.h" /* #include "windowaccess.h" */ #ifdef GRAPHICS #include "drawingview.h" #endif #include "main.h" main(int argc, char** argv) { /* * Do this first so that that IV args are automatically handled (and * removed). See description of World::World in World man page. */ World* world = new World("RSL Browser", argc, argv); TransInterface* ti = new TransInterface(argc, argv); int result; if ((result = ti->Translate(argc, argv)) == 1) { // ti->GetAllSyms(); // ti->DebugPrint(ti->SortSyms()->objs); // exit(0); CallBrowser(ti, argc, argv, world); } else if (result == 0) { /* * For the now, call the browser anyway. We'll see how to do it * just right in a bit. E.g., we'll put up dialog asking for * continuation. */ CallBrowser(ti, argc, argv, world); } else SoSorry(ti); } void CallBrowser( TransInterface* ti, int argc, char** argv, World* world) { #ifdef GRAPHICS char** dummyargv; /* Needed because World::ParseArgs is bogus */ dummyargv = new char*[1]; dummyargv[0] = new char[1]; #endif exception exitExc; /* Thrown by any function that wants to exit all the * way out. */ /* * Now done above * World* world = new World( #ifdef GRAPHICS "rbrowse", GetIdrawProperties(), GetIdrawOptions(), 0, dummyargv #endif ); */ RSLBrowser* browser = new RSLBrowser(ti, world, argc, argv, &exitExc); #ifdef GRAPHICS Idraw* idraw; #endif ti->SetBrowser(browser); /* world->InsertApplication(browser, 10,10); */ /* world->InsertToplevel(browser, browser); */ browser->LayoutScreen(); #ifdef GRAPHICS idraw = ridraw(0, null, world, browser, ti); Interactor* tools = (Interactor*) idraw->GetTools(); Interactor* canvas = idraw->GetDrawingView()->GetDrawWindow(); /* * Open any initial graphics files. */ browser->OpenInitGraphicsFiles(); #endif if (not catch(exitExc)) browser->Run(); } void SoSorry(TransInterface* ti) { fprintf(stderr, "\nExecution of the browser was supressed due to RSL translation errors.\n"); }