home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / intrvews / xgrab.lha / xgrab / ui / gmain.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-20  |  1.4 KB  |  69 lines

  1. /**
  2.    GRAB Graph Layout and Browser System
  3.  
  4.    Copyright (c) 1989, Tera Computer Company
  5.  **/
  6.  
  7.   /**
  8.      the top-level routine for the InterViews/C++ stuff.  First call
  9.      ginit.  Then grun.  Then it never comes back.
  10.    **/
  11.  
  12. #include "gframe.h"
  13. #include "graph.h"
  14. #include "gview.h"
  15. #include "tview.h"
  16. #include "aview.h"
  17. #include <InterViews/sensor.h>
  18. #include <InterViews/world.h>
  19. #include <InterViews/graphic.h>
  20. #include <InterViews/brush.h>
  21. #include <InterViews/Graphic/persistent.h>
  22. #include <InterViews/Graphic/lines.h>
  23. #include <InterViews/Graphic/ellipses.h>
  24. #include <InterViews/Graphic/polygons.h>
  25.  
  26. static Graph* MakeInitialGraph();
  27. static GView* MakeInitialGView();
  28. static TextView* MakeInitialTView();
  29.  
  30. GraphFrame *g;
  31. Graph *gr;
  32. GView *gv;
  33. AView *av;
  34. World* world;
  35.  
  36. extern "C" void ginit (int argc, char* argv[]) 
  37. {
  38.     world = new World("graph", argc, argv);
  39.     InitPPaint();                
  40.     gv = MakeInitialGView();
  41.     g = new GraphFrame(gv, MakeInitialTView());    /* xgrab window */
  42.     av = new AView(g, g->GetNoframe());        /* graph attributes window */
  43.     world->Insert(g);
  44. }
  45.  
  46. extern "C" void grun () 
  47. {
  48.     g->drawside();  /* draw the side window.  Otherwise, it never gets done */
  49.     world->Run();
  50. }
  51.  
  52. static Graph* MakeInitialGraph () 
  53. {
  54.     Graph* s;
  55.     s = new Graph();
  56.     return s;
  57. }
  58.  
  59. static GView* MakeInitialGView () 
  60. {
  61.     gr = MakeInitialGraph();
  62.     return new GView(gr);
  63. }
  64.  
  65. static TextView* MakeInitialTView () 
  66. {
  67.     return new TextView("\0", "\0");
  68. }
  69.