void DrealPromptModifyRectangle()

{
  char StaticLayer;

  rdsbegin();

  DrealDisplayMessage( DREAL_MESSAGE_MODE, "Modify Rectangle" );

  StaticLayer = RDS_STATIC_LAYER[ DrealRectangleMLayer ];

  if ( DrealRectangleMName == (char *)NULL )
  {
    sprintf( MessageBuffer, "Layer: %s   Name: none",
             DREAL_RDS_LAYER_NAME_TABLE[ StaticLayer ][0] );
  }
  else
  {   
    sprintf( MessageBuffer, "Layer: %s   Name: %s",
             DREAL_RDS_LAYER_NAME_TABLE[ StaticLayer ][0] ,
             DrealRectangleMName );
  }

  DrealDisplayMessage( DREAL_MESSAGE_INFO, MessageBuffer );
  DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter new properties for this rectangle" );

  rdsend();
}
Example #2
0
void GraalBuildEditDialog()

{
  rdsbegin();

  GraalBuildDialog( GraalMainWindow, &GraalSearchConnectorDialog        );
  GraalBuildDialog( GraalMainWindow, &GraalSearchInstanceDialog         );
  GraalBuildDialog( GraalMainWindow, &GraalSearchReferenceDialog        );
  GraalBuildDialog( GraalMainWindow, &GraalSearchSegmentDialog          );
  GraalBuildDialog( GraalMainWindow, &GraalModifySegmentWidthDialog     );
  GraalBuildDialog( GraalMainWindow, &GraalModifySegmentNameDialog      );
  GraalBuildDialog( GraalMainWindow, &GraalModifyViaNameDialog          );
  GraalBuildDialog( GraalMainWindow, &GraalModifyBigViaNameDialog       );
  GraalBuildDialog( GraalMainWindow, &GraalModifyTransistorWidthDialog  );
  GraalBuildDialog( GraalMainWindow, &GraalModifyTransistorNameDialog   );
  GraalBuildDialog( GraalMainWindow, &GraalModifyConnectorWidthDialog   );
  GraalBuildDialog( GraalMainWindow, &GraalModifyConnectorNameDialog    );
  GraalBuildDialog( GraalMainWindow, &GraalModifyReferenceNameDialog    );
  GraalBuildDialog( GraalMainWindow, &GraalModifyInstanceNameDialog     );
  GraalBuildDialog( GraalMainWindow, &GraalModifyInstanceModelDialog    );
  GraalBuildDialog( GraalMainWindow, &GraalSearchConnectorDialog        );
  GraalBuildDialog( GraalMainWindow, &GraalSearchInstanceDialog         );
  GraalBuildDialog( GraalMainWindow, &GraalSearchReferenceDialog        );
  GraalBuildDialog( GraalMainWindow, &GraalSearchSegmentDialog          );
  GraalBuildDialog( GraalMainWindow, &GraalSearchViaDialog              );

  rdsend();
}
Example #3
0
void DrealInitializePanel()

{
  rdsbegin();

  DrealBuildPanelLayer();
  DrealBuildPanelModify();
  DrealBuildPanelCreate();

  DrealBuildPanel( DrealMainWindow, &DrealToolsMessagePanel     );

  DrealBuildPanel( DrealMainWindow, &DrealViewArrowsPanel       );
  DrealBuildPanel( DrealMainWindow, &DrealViewZoomPanel         );
  DrealBuildPanel( DrealMainWindow, &DrealViewLayerPanel        );
  DrealBuildPanel( DrealMainWindow, &DrealViewGridPanel         );

  DrealBuildPanel( DrealMainWindow, &DrealCreateRectanglePanel );

  DrealBuildPanel( DrealMainWindow, &DrealEditGlobalPanel        );
  DrealBuildPanel( DrealMainWindow, &DrealWindowGlobalPanel      );
  DrealBuildPanel( DrealMainWindow, &DrealEditSelectPanel        );
  DrealBuildPanel( DrealMainWindow, &DrealEditSearchPanel        );
  DrealBuildPanel( DrealMainWindow, &DrealEditSearchViewPanel    );
  DrealBuildPanel( DrealMainWindow, &DrealEditIdentifyPanel      );

  DrealBuildPanel( DrealMainWindow, &DrealModifyRectanglePanel   );

  DrealBuildPanel( DrealMainWindow, &DrealSetupInformationsPanel );

  DrealBuildPresentPanel();

  rdsend();
}
void DrealComputeLambdaGrid()

{
  float StepX;
  float StepY;

  rdsbegin();

  StepX = (float)(DrealGraphicDx) / (float)(DrealLambdaGridDx);
  StepY = (float)(DrealGraphicDy) / (float)(DrealLambdaGridDy);

  if ( StepX < StepY )
  {
    DrealLambdaGridStep = StepX;
    DrealLambdaGridDy   = 1 + ( DrealGraphicDy / StepX );
  }
  else
  {
    DrealLambdaGridStep = StepY;
    DrealLambdaGridDx   = 1 + ( DrealGraphicDx / StepY );
  }

  DrealPixelGridX = (float)(DrealLambdaGridX) * DrealLambdaGridStep;
  DrealPixelGridY = (float)(DrealLambdaGridY) * DrealLambdaGridStep;

  rdsend();
}
void DrealExitCloseStream()
{
  rdsbegin();

  if ( DrealStreamErr != (FILE *)0 )
  {
    fclose( DrealStreamErr );
    unlink( DrealErrFileName );
  }

  if ( DrealStreamAll != (FILE *)0 )
  {
    fclose( DrealStreamAll );
    unlink( DrealAllFileName );
  }

  if ( ( DrealNormalMode             ) &&
       ( DrealStreamOut != (FILE *)0 ) )
  {
    fclose( DrealStreamOut );
    unlink( DrealOutFileName ); 
  }

  rdsend();
}
void DrealResizeLambdaGrid()

{
  rdsbegin();

  DrealLambdaGridDx = 1 + ( DrealGraphicDx / DrealLambdaGridStep );
  DrealLambdaGridDy = 1 + ( DrealGraphicDy / DrealLambdaGridStep );

  rdsend();
}
void DrealPromptSelectPointIdentify()

{
  rdsbegin();

  DrealDisplayMessage( DREAL_MESSAGE_MODE  , "Identify" );
  DrealDisplayMessage( DREAL_MESSAGE_INFO  , "Select object" );
  DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter select point" );

  rdsend();
}
void GraalPromptToolsHierarchyDown()

{
  rdsbegin();

  GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Go down" );
  GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select instance" );
  GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter select point" );

  rdsend();
}
void GraalPromptToolsHierarchyShow()

{
  rdsbegin();

  GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Show path" );
  GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select root point" );
  GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter point" );

  rdsend();
}
void GraalPromptToolsEqui()

{
  rdsbegin();

  GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Equi" );
  GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select object" );
  GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter select point" );

  rdsend();
}
void GraalBuildViewDialog()

{
  rdsbegin();

  GraalBuildDialog( GraalMainWindow, &GraalViewZoomSetDialog  );
  GraalBuildDialog( GraalMainWindow, &GraalViewZoomGotoDialog );
  GraalBuildDialog( GraalMainWindow, &GraalViewMoveSetDialog  );
  GraalBuildDialog( GraalMainWindow, &GraalViewGridXDialog    );
  GraalBuildDialog( GraalMainWindow, &GraalViewGridYDialog    );

  rdsend();
}
Example #12
0
void GraalEnterPresentPanel()

{
  rdsbegin();

  GraalEnterPanel( &GraalHelpPresentPanel );

  GraalLimitedLoop( GraalHelpPresentPanel.PANEL );

  GraalExitPanel( &GraalHelpPresentPanel );

  rdsend();
}
void GraalInitializePanel()

{
  rdsbegin();

  GraalBuildPanelLayer();
  GraalBuildPanelModify();
  GraalBuildPanelCreate();

  GraalBuildPanel( GraalMainWindow, &GraalToolsGlobalPanel        );
  GraalBuildPanel( GraalMainWindow, &GraalToolsMessagePanel       );
  GraalBuildPanel( GraalMainWindow, &GraalToolsDrucPanel          );
  GraalBuildPanel( GraalMainWindow, &GraalToolsHierarchyPanel     );
  GraalBuildPanel( GraalMainWindow, &GraalToolsHierarchyShowPanel );

  GraalBuildPanel( GraalMainWindow, &GraalViewArrowsPanel        );
  GraalBuildPanel( GraalMainWindow, &GraalViewZoomPanel          );
  GraalBuildPanel( GraalMainWindow, &GraalViewLayerPanel         );
  GraalBuildPanel( GraalMainWindow, &GraalViewGridPanel          );

  GraalBuildPanel( GraalMainWindow, &GraalCreateSegmentPanel     );
  GraalBuildPanel( GraalMainWindow, &GraalCreateViaPanel         );
  GraalBuildPanel( GraalMainWindow, &GraalCreateBigViaPanel      );
  GraalBuildPanel( GraalMainWindow, &GraalCreateTransistorPanel  );
  GraalBuildPanel( GraalMainWindow, &GraalCreateConnectorPanel   );
  GraalBuildPanel( GraalMainWindow, &GraalCreateReferencePanel   );
  GraalBuildPanel( GraalMainWindow, &GraalCreateInstancePanel    );

  GraalBuildPanel( GraalMainWindow, &GraalEditGlobalPanel        );
  GraalBuildPanel( GraalMainWindow, &GraalWindowGlobalPanel      );
  GraalBuildPanel( GraalMainWindow, &GraalEditSelectPanel        );
  GraalBuildPanel( GraalMainWindow, &GraalEditSearchPanel        );
  GraalBuildPanel( GraalMainWindow, &GraalEditSearchViewPanel    );
  GraalBuildPanel( GraalMainWindow, &GraalEditIdentifyPanel      );

  GraalBuildPanel( GraalMainWindow, &GraalModifySegmentPanel     );
  GraalBuildPanel( GraalMainWindow, &GraalModifyConnectorPanel   );
  GraalBuildPanel( GraalMainWindow, &GraalModifyTransistorPanel  );
  GraalBuildPanel( GraalMainWindow, &GraalModifyReferencePanel   );
  GraalBuildPanel( GraalMainWindow, &GraalModifyViaPanel         );
  GraalBuildPanel( GraalMainWindow, &GraalModifyBigViaPanel      );
  GraalBuildPanel( GraalMainWindow, &GraalModifyInstancePanel    );

  GraalBuildPanel( GraalMainWindow, &GraalSetupInformationsPanel );

  GraalBuildPresentPanel();

  rdsend();
}
void DrealExitFatalError()
{
  rdsbegin();

  DrealExitCloseStream();

  if ( DrealHeadUndo != (drealundo *)NULL )
  {
    DrealFigureRds->NAME = namealloc( "dreal_dump" );
    DrealSaveFigure();
  }

  exit( 2 );

  rdsend();
}
void DrealInitializeLambdaGrid()

{
  rdsbegin();

  DrealLambdaGridX      = DREAL_DEFAULT_GRID_X;
  DrealLambdaGridY      = DREAL_DEFAULT_GRID_Y;
  DrealLambdaGridDx     = DREAL_DEFAULT_GRID_DX;
  DrealLambdaGridDy     = DREAL_DEFAULT_GRID_DY;
  DrealLambdaUserGridDx = 4;
  DrealLambdaUserGridDy = 4;
  DrealLambdaUserGrid   = DREAL_FALSE;

  DrealComputeLambdaGrid();

  rdsend();
}
void DrealDisplayInformations()

{
  char *Message;

  rdsbegin();

  Message = DrealGetInformations();

  XmTextSetString( DrealSetupInformationsButton[0].BUTTON, Message );

  DrealEnterPanel( &DrealSetupInformationsPanel );

  DrealLimitedLoop( DrealSetupInformationsPanel.PANEL );

  DrealExitPanel( &DrealSetupInformationsPanel );

  rdsend();
}
void GraalPromptToolsPeek()

{
  rdsbegin();

  GraalDisplayMessage( GRAAL_MESSAGE_MODE, "Peek" );
  GraalDisplayMessage( GRAAL_MESSAGE_INFO, "Select window" );

  switch ( GraalCountEventEdit )
  {
    case 0 :

      GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter first corner" );

    break;

    case 1 :

      GraalDisplayMessage( GRAAL_MESSAGE_PROMPT, "Enter next corner" );
  }

  rdsend();
}
void DrealPromptSelectWindowModify()

{
  rdsbegin();

  DrealDisplayMessage( DREAL_MESSAGE_MODE, "Modify" );
  DrealDisplayMessage( DREAL_MESSAGE_INFO, "Select window" );

  switch ( DrealCountEventEdit )
  {
    case 0 :

      DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter first corner" );

    break;

    case 1 :

      DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter next corner" );
  }

  rdsend();
}
void DrealPromptEditStretch()

{
  rdsbegin();

  DrealDisplayMessage( DREAL_MESSAGE_MODE, "Stretch" );
  DrealDisplayMessage( DREAL_MESSAGE_INFO, "Select vector" );

  switch ( DrealCountEventEdit )
  {
    case 0 :

      DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter source point" );

    break;

    case 1 :

      DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter target point" );
  }

  rdsend();
}
rdsfig_list *GraalAddFigure()

{
  void        *Pointer;
  void        *Previous;
  rdsrec_list *Abox;

  rdsbegin();

  GraalFigureRds = addrdsfig( GraalFigureMbk->NAME, GRAAL_SIZE );

  Abox = aboxmbkrds( GraalFigureMbk, GraalFigureRds );

  if ( Abox != (rdsrec_list *)NULL )
  {
    GraalCheckWindow( Abox->X           , Abox->Y, 
                      Abox->X + Abox->DX, Abox->Y + Abox->DY );

    delrdsfigrec( GraalFigureRds, Abox );
  }

  GraalAddAbox();

  Previous = (void *)(&(GraalFigureMbk->PHSEG));

  for ( Pointer  = (void *)(GraalFigureMbk->PHSEG);
        Pointer != (void *)NULL;
        Pointer  = (void *)(((phseg_list *)Pointer)->NEXT))
  {
    ((phseg_list *)Pointer)->USER = Previous;
    Previous = (void *)(&((phseg_list *)Pointer)->NEXT);

    GraalAddSegment( (phseg_list *)Pointer );
  }

  Previous = (void *)(&(GraalFigureMbk->PHCON));

  for ( Pointer  = (void *)(GraalFigureMbk->PHCON);
        Pointer != (void *)NULL;
        Pointer  = (void *)(((phcon_list *)Pointer)->NEXT))
  {
    ((phcon_list *)Pointer)->USER = Previous;
    Previous = (void *)(&((phcon_list *)Pointer)->NEXT);

    GraalAddConnector( (phcon_list *)Pointer );
  }

  Previous = (void *)(&(GraalFigureMbk->PHREF));
 
  for ( Pointer  = (void *)(GraalFigureMbk->PHREF);
        Pointer != (void *)NULL;
        Pointer  = (void *)(((phref_list *)Pointer)->NEXT))
  {
    ((phref_list *)Pointer)->USER = Previous;
    Previous = (void *)(&((phref_list *)Pointer)->NEXT);

    GraalAddReference( (phref_list *)Pointer );
  }
 
  Previous = (void *)(&(GraalFigureMbk->PHVIA));
 
  for ( Pointer  = (void *)(GraalFigureMbk->PHVIA);
        Pointer != (void *)NULL;
        Pointer  = (void *)(((phvia_list *)Pointer)->NEXT))
  {
    ((phvia_list *)Pointer)->USER = Previous;
    Previous = (void *)(&((phvia_list *)Pointer)->NEXT);

    GraalAddVia( (phvia_list *)Pointer );
  }
 
  Previous = (void *)(&(GraalFigureMbk->PHINS));
 
  for ( Pointer  = (void *)(GraalFigureMbk->PHINS);
        Pointer != (void *)NULL;
        Pointer  = (void *)(((phins_list *)Pointer)->NEXT))
  {
    ((phins_list *)Pointer)->USER = Previous;
    Previous = (void *)(&((phins_list *)Pointer)->NEXT);

    GraalAddInstance( (phins_list *)Pointer );
  }

  rdsend();
  return( GraalFigureRds );
}
Example #21
0
void GraalBuildPresentPanel()

{
  Widget       PanelLabel;
  Widget       PanelButton;
  Pixmap       PanelPixmap;
  XmString     PanelString;
  XmString     PanelString1;
  XmString     PanelString2;
  XmFontList   PanelFontList;
  XFontStruct *PanelFont;
  Display     *PanelDisplay;
  char         Buffer[ 64 ];
  Arg          Args[3];

  rdsbegin();
  
  PanelDisplay  = XtDisplay( GraalMainWindow );
  PanelFont     = XLoadQueryFont( PanelDisplay, "-*-helvetica-bold-o-*--24-*" );
  PanelFontList = XmFontListCreate( PanelFont, "Panel_charset1" );
  PanelFont     = XLoadQueryFont( PanelDisplay, "-*-helvetica-bold-r-*--18-*" );
  PanelFontList = XmFontListAdd( PanelFontList, PanelFont, "Panel_charset2" );
  PanelFont     = XLoadQueryFont( PanelDisplay, "-*-helvetica-bold-r-*--12-*" );
  PanelFontList = XmFontListAdd( PanelFontList, PanelFont, "Panel_charset4" );

  XtSetArg( Args[0], XmNshadowType    , XmSHADOW_ETCHED_IN );
  XtSetArg( Args[1], XmNdeleteResponse, XmDO_NOTHING       );
  XtSetArg( Args[2], XmNtitle         , "Graal present"    );

  GraalHelpPresentPanel.PANEL = 

    XmCreateFormDialog( GraalMainWindow, GraalHelpPresentPanel.TITLE, Args, 3);

  XtAddCallback( GraalHelpPresentPanel.PANEL, XmNdestroyCallback,
                 GraalDestroyDialogCallback, NULL );

  GraalHelpPresentPanel.PANEL_FORM = 

     XtVaCreateManagedWidget( "",
                              xmFormWidgetClass,
                              GraalHelpPresentPanel.PANEL,
                              XmNtopAttachment    , XmATTACH_FORM,
                              XmNbottomAttachment , XmATTACH_FORM,
                              XmNleftAttachment   , XmATTACH_FORM,
                              XmNrightAttachment  , XmATTACH_FORM,
                              NULL
                            );

  GraalHelpPresentPanel.FRAME = 

     XtVaCreateManagedWidget( "",
                              xmFrameWidgetClass,
                              GraalHelpPresentPanel.PANEL_FORM,
                              XmNtopAttachment   , XmATTACH_POSITION,
                              XmNtopPosition     , 05,
                              XmNbottomAttachment, XmATTACH_POSITION,
                              XmNbottomPosition  , 95,
                              XmNleftAttachment  , XmATTACH_POSITION,
                              XmNleftPosition    , 05,
                              XmNrightAttachment , XmATTACH_POSITION,
                              XmNrightPosition   , 95,
                              NULL
                            );

  GraalHelpPresentPanel.FORM = 

    XtVaCreateManagedWidget( "",
                             xmFormWidgetClass,
                             GraalHelpPresentPanel.FRAME,
                             XmNtopAttachment   , XmATTACH_POSITION,
                             XmNtopPosition     , 05,
                             XmNbottomAttachment, XmATTACH_POSITION,
                             XmNbottomPosition  , 95,
                             XmNleftAttachment  , XmATTACH_POSITION,
                             XmNleftPosition    , 05,
                             XmNrightAttachment , XmATTACH_POSITION,
                             XmNrightPosition   , 95,
                             NULL
                           );

  PanelPixmap = GraalCreatePixmap( GraalMainWindow,
                                    LIP6bw_bits,
                                    LIP6bw_width,
                                    LIP6bw_height);


  PanelLabel = XtVaCreateManagedWidget( "",
                                         xmLabelGadgetClass, 
                                         GraalHelpPresentPanel.FORM,
			                   XmNlabelType   , XmPIXMAP,
			                   XmNlabelPixmap , PanelPixmap,
			                   NULL
                                       );

  sprintf( Buffer, "ALLIANCE CAD SYSTEM  %s\n", ALLIANCE_VERSION );

  PanelString = XmStringCreateLtoR( Buffer, "Panel_charset2" );

  PanelLabel = XtVaCreateManagedWidget( "",
                                        xmLabelWidgetClass,
                                        GraalHelpPresentPanel.FORM,
                                        XmNfontList        , PanelFontList,
                                        XmNlabelString     , PanelString,
                                        XmNtopAttachment   , XmATTACH_POSITION,
                                        XmNtopPosition     , 15,
                                        XmNrightAttachment , XmATTACH_POSITION,
                                        XmNrightPosition   , 75,
                                        XmNleftAttachment  , XmATTACH_POSITION,
                                        XmNleftPosition    , 25,
                                        NULL
                                      );
  XmStringFree( PanelString );

  PanelString1 = XmStringCreateLtoR( "Graal"         , "Panel_charset1" );
  PanelString2 = XmStringCreateLtoR( "\n( Click On IT )", "Panel_charset4" );
  PanelString  = XmStringConcat( PanelString1, PanelString2 );

  PanelButton = XtVaCreateManagedWidget( "",
                                          xmPushButtonWidgetClass, 
                                          GraalHelpPresentPanel.FORM,
                                          XmNfontList        , PanelFontList,
                                          XmNlabelString     , PanelString,
                                          XmNshadowThickness , 3,
                                          XmNtopAttachment   , XmATTACH_WIDGET,
                                          XmNtopWidget       , PanelLabel,
                                          XmNtopOffset       , 5,
                                          XmNrightAttachment , XmATTACH_POSITION,
                                          XmNrightPosition   , 60,
                                          XmNleftAttachment  , XmATTACH_POSITION,
                                          XmNleftPosition    , 40,
                                          NULL
                                        );
  XmStringFree( PanelString  );
  XmStringFree( PanelString1 );
  XmStringFree( PanelString2 );

  XtAddCallback( PanelButton, 
                 XmNactivateCallback,
                 GraalExitDialogCallback, NULL );

  sprintf( Buffer, "\nGraphic layout editor\nVersion %s", VERSION );

  PanelString = XmStringCreateLtoR( Buffer, "Panel_charset2" );

  PanelLabel = XtVaCreateManagedWidget( "",
                                         xmLabelWidgetClass,
                                         GraalHelpPresentPanel.FORM,
                                         XmNfontList        , PanelFontList,
                                         XmNlabelString     , PanelString,
                                         XmNtopAttachment   , XmATTACH_WIDGET,
                                         XmNtopWidget       , PanelButton,
                                         XmNtopOffset       , 5,
                                         XmNrightAttachment , XmATTACH_POSITION,
                                         XmNrightPosition   , 75,
                                         XmNleftAttachment  , XmATTACH_POSITION,
                                         XmNleftPosition    , 25,
                                         NULL
                                       );
  XmStringFree( PanelString );

  PanelString = XmStringCreateLtoR( "copyright \251 1996-2004 ASIM, \
CAO-VLSI Team\nWritten by Ludovic Jacomme and Frederic Venot\nE-mail        :  [email protected]", "Panel_charset4" );

  PanelLabel = XtVaCreateManagedWidget( "",
                                         xmLabelWidgetClass,
                                         GraalHelpPresentPanel.FORM,
                                         XmNfontList        , PanelFontList,
                                         XmNlabelString     , PanelString,
                                         XmNtopAttachment   , XmATTACH_WIDGET,
                                         XmNtopWidget       , PanelLabel,
                                         XmNtopOffset       , 5,
                                         XmNrightAttachment , XmATTACH_FORM,
                                         XmNleftAttachment  , XmATTACH_FORM,
                                         NULL
                                       );
  XmStringFree( PanelString );

  rdsend();
}
Example #22
0
void GraalTreatEventEdit()

{ 
  long DeltaX;
  long DeltaY;
  long X1;
  long X2;
  long Y1;
  long Y2;

  rdsbegin();

  X1 = GraalLambdaEventEditX[0];
  X2 = GraalLambdaEventEditX[1];
  Y1 = GraalLambdaEventEditY[0];
  Y2 = GraalLambdaEventEditY[1];

  if ( ( GraalInputMode == GRAAL_INPUT_LSTRING ) || 
       ( GraalInputMode == GRAAL_INPUT_ORTHO   ) ||
       ( GraalInputMode == GRAAL_INPUT_SORTHO  ) )
  {
    DeltaX = X1 - X2;
    DeltaY = Y1 - Y2;

    if ( DeltaX < 0 ) DeltaX = - DeltaX;
    if ( DeltaY < 0 ) DeltaY = - DeltaY;

    if ( DeltaX > DeltaY )
    {
      Y2 = Y1;

      GraalLambdaEventEditX[0] = X2;
      GraalLambdaEventEditY[0] = Y2;
    }  
    else
    {   
      X2 = X1;

      GraalLambdaEventEditX[0] = X2;
      GraalLambdaEventEditY[0] = Y2;
    }
  }

  if ( GraalInputMode == GRAAL_INPUT_LSTRING )
  {   
    GraalChangeCursorType( GraalLambdaEventEditX,
                           GraalLambdaEventEditY,
                           1, GraalInputMode );
 
    GraalCountEventEdit = 1;
  }
  else
  {
    GraalChangeCursorType( NULL, NULL, 0,
                           GraalInputMode );

    GraalCountEventEdit = 0;
  }

  switch ( GraalEditMode )
  {
    case GRAAL_EDIT_MEASURE           :

      break;

    case GRAAL_CREATE_SEGMENT         :
    case GRAAL_CREATE_SEGMENT_WIRE    :

      GraalCreateSegmentMbk( X1, Y1, X2, Y2 );

      break;

    case GRAAL_CREATE_VIA             :

      GraalCreateViaMbk( X1, Y1 );

      break;

    case GRAAL_CREATE_BIGVIA          :

      GraalCreateBigViaMbk( X1, Y1, X2, Y2 );

      break;
 
    case GRAAL_CREATE_TRANSISTOR      :
    case GRAAL_CREATE_TRANSISTOR_WIRE :

      GraalCreateTransistorMbk( X1, Y1, X2, Y2 );

      break;

    case GRAAL_CREATE_CONNECTOR       :

      GraalCreateConnectorMbk( X1, Y1 );

      break;

    case GRAAL_CREATE_REFERENCE       :

      GraalCreateReferenceMbk( X1, Y1 );

      break;

    case GRAAL_CREATE_INSTANCE        :

      GraalCreateInstanceMbk( X1, Y1 );

      break;

    case GRAAL_CREATE_ABUTMENTBOX  :

     GraalCreateAbutmentBoxMbk( X1, Y1, X2, Y2 );

    break;

    case GRAAL_SELECT_POINT_IDENTIFY :
 
      GraalEditSelectPoint( X1, Y1 );
      GraalEditIdentify();

    break;

    case GRAAL_SELECT_WINDOW_IDENTIFY :

      GraalEditSelectFence( X1, Y1, X2, Y2 );
      GraalEditIdentify();

    break;

    case GRAAL_SELECT_POINT_COPY :

      GraalEditSelectPointCopy( X1, Y1 );

    break;

    case GRAAL_SELECT_WINDOW_COPY :

      GraalEditSelectWindowCopy( X1, Y1, X2, Y2 );

    break;

    case GRAAL_EDIT_COPY_POINT :

      GraalEditCopy( X1, Y1, X2, Y2, 0 );

    break;

    case GRAAL_EDIT_COPY_WINDOW :
 
      GraalEditCopy( X1, Y1, X2, Y2, 1 );

    break;

    case GRAAL_SELECT_POINT_MOVE :

      GraalEditSelectPointMove( X1, Y1 );

    break;

    case GRAAL_SELECT_WINDOW_MOVE :

      GraalEditSelectWindowMove( X1, Y1, X2, Y2 );

    break;

    case GRAAL_EDIT_MOVE_POINT :

      GraalEditMove( X1, Y1, X2, Y2, 0 );

    break;

    case GRAAL_EDIT_MOVE_WINDOW :

      GraalEditMove( X1, Y1, X2, Y2, 1 );

    break;

    case GRAAL_SELECT_POINT_DELETE :

      GraalEditSelectPointDelete( X1, Y1 );

    break;

    case GRAAL_SELECT_WINDOW_DELETE :

      GraalEditSelectWindowDelete( X1, Y1, X2, Y2 );

    break;

    case GRAAL_SELECT_POINT_STRETCH :

      GraalEditSelectPointStretch( X1, Y1 );

    break;

    case GRAAL_SELECT_WINDOW_STRETCH :

      GraalEditSelectWindowStretch( X1, Y1, X2, Y2 );

    break;

    case GRAAL_EDIT_STRETCH_POINT :

      GraalEditStretch( X1, Y1, X2, Y2, 0 );

    break;

    case GRAAL_EDIT_STRETCH_WINDOW :

      GraalEditStretch( X1, Y1, X2, Y2, 1 );

    break;

    case GRAAL_SELECT_POINT_MODIFY :

      GraalEditSelectPointModify( X1, Y1 );

    break;

    case GRAAL_SELECT_WINDOW_MODIFY :

      GraalEditSelectWindowModify( X1, Y1, X2, Y2 );

    break;

    case GRAAL_TOOLS_EQUI :

      GraalToolsSelectEqui( X1, Y1 );

    break;

    case GRAAL_TOOLS_PEEK :

       GraalToolsPeek( X1, Y1, X2, Y2 );

    break;

    case GRAAL_TOOLS_FLATTEN :

      GraalToolsSelectFlatten( X1, Y1, X2, Y2 );

    break;

    case GRAAL_TOOLS_UNFLATTEN :

      GraalToolsSelectUnflatten( X1, Y1, X2, Y2 );

    break;

    case GRAAL_TOOLS_DRUC :

      GraalToolsDruc( X1, Y1, X2, Y2 );

    break;

    case GRAAL_TOOLS_REAL_FLATTEN :

      GraalToolsSelectRealFlatten( X1, Y1, X2, Y2 );

    break;

    case GRAAL_TOOLS_HIERARCHY_DOWN :

      GraalToolsSelectHierarchyDown( X1, Y1 );

    break;

    case GRAAL_TOOLS_HIERARCHY_SHOW :

      GraalEditSelectPoint( X1, Y1 );
      GraalToolsHierarchyShow( X1, Y1 );

    break;
  }

  rdsend();
}