home *** CD-ROM | disk | FTP | other *** search
- /**
- GRAB Graph Layout and Browser System
-
- Copyright (c) 1989, Tera Computer Company
- **/
-
- /* C++ routines that the C routines call */
-
- #include <InterViews/graphic.h>
- #include <InterViews/Graphic/lines.h>
- #include "att.h"
- #include "graph.h"
- #include "gmain.h"
- #include "dialogbox.h"
- #include "bview.h"
- #include "gframe.h"
- #include "helper.h"
-
- extern "C" void IChangeGraphName (char* s)
- {
- g->ChangeGraphName (s);
- }
-
- extern "C" void IChangeFileName (char* s)
- {
- g->ChangeFileName (s);
- }
-
- extern "C" void IChangeStatusLine (char* s, boolean now = false)
- {
- g->ChangeStatusLine (s, now);
- }
-
- extern "C" char* IGetText ()
- {
- Namer *n = new Namer(g);
- return n->Edit("\0");
- }
-
- extern "C" void IPrintHelp ()
- {
- Point* t = new Point(0, 0);
- Helper* h = new Helper(g, t);
- h->DoHelp();
- delete h;
- delete t;
- }
-
- extern "C" void IShowNAttr(char** attr)
- {
- av->ShowNAttr(attr);
- }
-
- extern "C" void IShowEAttr(char** attr)
- {
- av->ShowEAttr(attr);
- }
-
- extern "C" void ISetAttrNames(char** nattr, char** eattr, int numna, int numea)
- {
- av->SetAttrNames(nattr, eattr, numna, numea);
- }
-
- extern "C" void IEraseAttrBox()
- {
- av->EraseAttrBox();
- }
-
- extern "C" void ISetDisplayed()
- {
- if (av->SetDisplayed() != true)
- {
- g->ChangeStatusLine("Attributes window already opened!");
- }
- }
-
- extern "C" char IConfirm(char* s)
- {
- Confirmer *c = new Confirmer(g, s);
- return c->Confirm();
- }
-
- extern "C" void IChangeToggles (char b[numopts])
- {
- g->ChangeToggles(b);
- }
-
- extern "C" void IAddNode (Coord x0, Coord y0, Coord x1, Coord y1, NShape n, char* s,
- boolean d, char* gp, char* ups, char* downs, BType brush,
- CType color, boolean draw, int ord = -1)
- {
- gr->AddNode (x0, y0, x1, y1, n, s, d, gp, ups, downs, brush,
- color, draw, ord);
- }
-
- extern "C" void IAddEdge (Coord x0, Coord y0, Coord x1, Coord y1, boolean arr, char* gp,
- char* s, BType brush, CType color, boolean draw, int ord = -1)
- {
- gr->AddEdge (x0, y0, x1, y1, arr, gp, s, brush, color, draw, ord);
- }
-
- extern "C" void IAddLine (Coord x0, Coord y0, Coord x1, Coord y1, BType brush,
- CType color, boolean draw)
- {
- gr->AddLine (x0, y0, x1, y1, brush, color, draw);
- }
-
- extern "C" void IEraseGraph ()
- {
- gv->Erase ();
- }
-
- extern "C" void ISetCursor (Curs c)
- {
- g->SetCurs(c);
- }
-
- extern "C" void IUnsetCursor ()
- {
- g->UnsetCurs();
- }
-
- extern "C" void ICenterGraph()
- {
- gv->CenterGraph();
- }
-
- extern "C" void IUpdateG()
- {
- gv->UpdateG();
- }
-
- extern "C" void IUpdateP()
- {
- gv->UpdateP();
- }
-
- extern "C" void IChangeZGrad(double zg)
- {
- g->ChangeZGrad(zg);
- }
-
- extern "C" void IChangePGrad(int x, int y)
- {
- gv->ChangePGrad(x,y);
- }
-
- extern "C" void IRedrawWorld()
- {
- g->Draw();
- }
-
- extern "C" void IGetBounds(int* x0, int* y0, int* width, int* height,
- int* curx, int* cury, int* curwidth, int* curheight)
- {
- gv->GetBounds(x0, y0, width, height, curx, cury, curwidth, curheight);
- }
-
- extern "C" void IInitFonts()
- {
- g->InitFonts();
- }
-
- extern "C" void ISetFont(int x, int y)
- {
- g->SetFont(x, y);
- }
-
- extern "C" int ITextFits()
- {
- return g->TextFits();
- }
-
- extern "C" int IOnNonDummyNode()
- {
- return gv->CurOnNonDummyNode();
- }
-
- extern "C" int IOnNode()
- {
- return gv->CurOnNode();
- }
-
- extern "C" int IOnEdge()
- {
- return gv->CurOnEdge();
- }
-
- extern "C" char *ICurNode()
- {
- return gv->CurNode();
- }
-
- extern "C" char *ICurEdge()
- {
- return gv->CurEdge();
- }
-
- extern "C" void IForceNL()
- {
- g->ForceNL();
- }
-
- extern "C" void INoForceNL()
- {
- g->NoForceNL();
- }
-
- extern "C" void IForceEL()
- {
- g->ForceEL();
- }
-
- extern "C" void INoForceEL()
- {
- g->NoForceEL();
- }
-
- extern "C" void IChangeMarkDummy()
- {
- gv->ChangeMarkDummy();
- }
-
- extern "C" void IChangeForceNL()
- {
- gv->ChangeForceNL();
- }
-
- extern "C" void IChangeForceEL()
- {
- gv->ChangeForceEL();
- }
-
- extern "C" void IChangePA()
- {
- gv->ChangePA();
- }
-
- extern "C" void IChangeLabels()
- {
- gr->ChangeLabels();
- }
-
- extern "C" void IFindSmallestFont(int* x, int* y)
- {
- g->SmallestFont(x, y);
- }
-
- extern "C" void IFocusGraph(int x, int y, double m)
- {
- gv->FocusGraph(x, y, m);
- }
-
- extern "C" void IChangeNodeText(char* s)
- {
- gv->ChangeCurNodeLabel(s);
- }
-
- extern "C" void IChangeEdgeLabel(char* p, char* n, int ord, char* s)
- {
- gr->ChangeEdgeLabel(p, n, ord, s);
- }
-
- extern "C" void IDelNode(char* n, int ord = -1)
- {
- if (ord == -1)
- {
- gr->DelAllNodes(n);
- }
- else
- {
- gr->DelNode(n, ord);
- }
- }
-
- extern "C" void IDelEdge(char* p, char* n, int ord)
- {
- gr->DelEdge(p, n, ord);
- }
-
- extern "C" void IChangeNode(char* n, NShape s, BType b, CType c)
- {
- gr->ChangeNode(n, s, b, c);
- }
-
- extern "C" void IChangeEdge(char* p, char* n, int ord, BType b, CType c)
- {
- gr->ChangeEdge(p, n, ord, b, c);
- }
-
- extern "C" void IGetCurPos(int* x, int* y)
- {
- gv->GetCurPos(x, y);
- }
-
- extern "C" void ISetupMove(char* mnode, char* prevNode[], char* nextNode[],
- int numprev, int numnext)
- {
- gv->SetupMove(mnode, prevNode, nextNode, numprev, numnext);
- }
-
- extern "C" void IChangeBC()
- {
- gv->ChangeBC();
- }
-
- extern "C" void IResetCurrent()
- {
- gv->ResetCurrent();
- }
-
- extern "C" boolean IShapeSet()
- {
- return g->ShapeSet();
- }
-
- extern "C" boolean IColorSet()
- {
- return g->ColorSet();
- }
-
- extern "C" boolean IBrushSet()
- {
- return g->BrushSet();
- }
-
- extern "C" NShape ICurShape()
- {
- return g->CurShape();
- }
-
- extern "C" CType ICurColor()
- {
- return g->CurColor();
- }
-
- extern "C" BType ICurBrush()
- {
- return g->CurBrush();
- }
-
- extern "C" NShape INextShape(NShape s)
- {
- return NextShape(s);
- }
-
- extern "C" BType INextBrush(BType b)
- {
- return NextBrush(b);
- }
-
- extern "C" CType INextColor(CType c)
- {
- return NextColor(c);
- }
-
- extern "C" void ISetPS(char* fs)
- {
- g->SetPS(fs);
- }
-
- extern "C" int IWidthPS(char* s)
- {
- return g->WidthPS(s);
- }
-