diff --git a/alliance/src/dreal/Makefile.am b/alliance/src/dreal/Makefile.am new file mode 100644 index 00000000..5fcaa0d3 --- /dev/null +++ b/alliance/src/dreal/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src man1 diff --git a/alliance/src/dreal/configure.in b/alliance/src/dreal/configure.in new file mode 100644 index 00000000..9d0dcf20 --- /dev/null +++ b/alliance/src/dreal/configure.in @@ -0,0 +1,36 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(src/dreal.c) + +DREAL_MAJOR_VERSION=1 +DREAL_MINOR_VERSION=14 +DREAL_VERSION=$DREAL_MAJOR_VERSION.$DREAL_MINOR_VERSION + +AC_SUBST(DREAL_MAJOR_VERSION) +AC_SUBST(DREAL_MINOR_VERSION) +AC_SUBST(DREAL_VERSION) + +# For automake. +VERSION=$DREAL_VERSION +PACKAGE=dreal + +dnl Initialize automake stuff +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) + +dnl Checks for programs. +AC_PROG_CC +AM_PROG_LEX +AC_PROG_YACC +AC_PROG_RANLIB +AC_PROG_MAKE_SET +AC_FIND_MOTIF + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST + +AM_ALLIANCE + +AC_OUTPUT([ +Makefile +src/Makefile +man1/Makefile +]) diff --git a/alliance/src/dreal/etc/cmos_7.dreal b/alliance/src/dreal/etc/cmos_7.dreal new file mode 100644 index 00000000..ca8a1f51 --- /dev/null +++ b/alliance/src/dreal/etc/cmos_7.dreal @@ -0,0 +1,120 @@ +# /*------------------------------------------------------------\ +# | | +# | Title : Parameters File for Dreal | +# | | +# | Technology : Cmos V7 | +# | | +# | Date : 02/08/95 | +# | | +# \------------------------------------------------------------*/ +# /*------------------------------------------------------------\ +# | | +# | Lower Grid Step in pixel | +# | | +# \------------------------------------------------------------*/ + +DEFINE DREAL_LOWER_GRID_STEP 10 + +# /*------------------------------------------------------------\ +# | | +# | Lower Figure Text Step in pixel | +# | | +# \------------------------------------------------------------*/ + +DEFINE DREAL_LOWER_FIGURE_STEP 0.1 + +# /*------------------------------------------------------------\ +# | | +# | Lower Instance Text Step in pixel | +# | | +# \------------------------------------------------------------*/ + +DEFINE DREAL_LOWER_INSTANCE_STEP 0.1 + +# /*------------------------------------------------------------\ +# | | +# | Lower Connector Text Step in pixel | +# | | +# \------------------------------------------------------------*/ + +DEFINE DREAL_LOWER_CONNECTOR_STEP 0.5 + +# /*------------------------------------------------------------\ +# | | +# | Lower Segment Text Step in pixel | +# | | +# \------------------------------------------------------------*/ + +DEFINE DREAL_LOWER_SEGMENT_STEP 0.7 + +# /*------------------------------------------------------------\ +# | | +# | Lower Reference Text Step in pixel | +# | | +# \------------------------------------------------------------*/ + +DEFINE DREAL_LOWER_REFERENCE_STEP 1.0 + +# /*------------------------------------------------------------\ +# | | +# | Dreal Cursor Color Name | +# | | +# \------------------------------------------------------------*/ + +DEFINE DREAL_CURSOR_COLOR_NAME Gray + +# /*------------------------------------------------------------\ +# | | +# | Dreal Cursor Size in pixel | +# | | +# \------------------------------------------------------------*/ + +DEFINE DREAL_CURSOR_SIZE 10 + +# /*------------------------------------------------------------\ +# | | +# | View Layer Panel Button Label, Foreground, Background Color | +# | | +# \------------------------------------------------------------*/ + +TABLE DREAL_RDS_LAYER_NAME + + RDS_NWELL Nwell tan Black + RDS_PWELL Pwell light_yellow Black + RDS_NIMP Nimp forest_green Black + RDS_PIMP Pimp goldenrod Black + RDS_ACTIV Activ brown Black + RDS_NDIF Ndif lawn_green Black + RDS_PDIF Pdif yellow Black + RDS_NTIE Ntie spring_green Black + RDS_PTIE Ptie light_goldenrod Black + RDS_POLY Poly red Black + RDS_VPOLY VPoly coral Black + RDS_GATE Gate orange Black + RDS_TPOLY Tpoly hot_pink Black + RDS_CONT Cont dark_violet Black + RDS_TCONT TCont orchid Black + RDS_ALU1 Alu1 royal_blue Black + RDS_VALU1 VAlu1 sky_blue Black + RDS_TALU1 Talu1 royal_blue Black + RDS_VIA1 Via1 deep_sky_blue Black + RDS_TVIA1 TVia1 dodger_blue Black + RDS_ALU2 Alu2 cyan Black + RDS_TALU2 Talu2 turquoise Black + RDS_VIA2 Via2 deep_pink Black + RDS_ALU3 Alu3 light_pink Black + RDS_TALU3 Talu3 light_pink Black + RDS_VIA3 Via3 sea_green Black + RDS_ALU4 Alu4 green Black + RDS_TALU4 Talu4 green Black + RDS_VIA4 Via4 gold Black + RDS_ALU5 Alu5 yellow Black + RDS_TALU5 Talu5 yellow Black + RDS_VIA5 Via5 violet_red Black + RDS_ALU6 Alu6 violet Black + RDS_TALU6 Talu6 violet Black + RDS_CPAS Cpas gray Black + RDS_REF Ref coral Black + RDS_ABOX Abox pink Black + +END diff --git a/alliance/src/dreal/man1/Makefile.am b/alliance/src/dreal/man1/Makefile.am new file mode 100644 index 00000000..8f642214 --- /dev/null +++ b/alliance/src/dreal/man1/Makefile.am @@ -0,0 +1,2 @@ +man_MANS = dreal.1 +EXTRA_DIST = $(man_MANS) diff --git a/alliance/src/dreal/man1/dreal.1 b/alliance/src/dreal/man1/dreal.1 new file mode 100644 index 00000000..6aa324dc --- /dev/null +++ b/alliance/src/dreal/man1/dreal.1 @@ -0,0 +1,77 @@ +.\" $Id: dreal.1,v 1.1 2002/03/29 17:40:13 ludo Exp $ +.\" @(#)dreal 1.07 94/10/10 UPMC/ASIM/LIP6/CAO-VLSI " +.TH DREAL 1 "October 1, 1997" "ASIM/LIP6" "ALLIANCE Reference Manual" +.SH NAME +dreal \- Graphic real layout viewer +.SH SYNOPSIS +.B dreal +[\-l file_name] +[\-xor] +[\-debug] +[\-install] +[\-force] +.br +.so man1/alc_origin.1 +.SH DESCRIPTION +.B Dreal +is a hierarchical real layout viewer. All functionnalities can be +accessed through different menus. +.B Dreal +works under Motif and X11r5. +When entering +.B Dreal, +the main window appears and shows 4 different +menus on the top bar.These menus can be entered by simply clicking on the +mouse left button. Here is the description of these menus. + +.TP 10 +.B File +\f4Open\fP : load an existing cell. +.br +\f4Quit\fP : quit dreal. + +.TP 10 +.B View +\f4Zoom\fP : perform zoom in, zoom out, center, fit, refresh on figure. +.br +\f4Layer\fP : select types of layers displayed. +.br +\f4Map\fP : show cursor position in the entire figure. +.br +\f4Arrows\fP : show arrows for moving at the grid step. +.br +\f4Grid\fP : Set the X,Y step of the grid if displayed. + +.TP 10 +.B Tools +\f4Flatten\fP : flatten the current figure. +.br +\f4Message\fP : display the last error messages. + +.TP 10 +.B Setup +Save or load a user defined configuration of default displayed menus. + +.SH ENVIRONMENT VARIABLES +.TP +.B MBK_CATA_LIB +indicates the path to the read only libraries to be used. +.TP +.B MBK_WORK_LIB +indicates the path to the read directory for the session. +.TP +.B RDS_IN +indicates the file format to be used for the cell. +.TP +.B DREAL_TECHNO_NAME (optionnal) +indicates the path to the techno name file used by Dreal. +.TP +.B RDS_TECHNO_NAME (optionnal) +indicates the path to the RDS configuration file used by Dreal. + +.SH SEE ALSO +mbk(1), MBK_CATA_LIB(8), RDS_IN(1), RDS_TECHNO_NAME(1) + +.so man1/alc_bug_report.1 + + diff --git a/alliance/src/dreal/motif.m4 b/alliance/src/dreal/motif.m4 new file mode 100644 index 00000000..ba265e10 --- /dev/null +++ b/alliance/src/dreal/motif.m4 @@ -0,0 +1,196 @@ +dnl +dnl +dnl AC_FIND_MOTIF : find OSF/Motif or LessTif, and provide variables +dnl to easily use them in a Makefile. +dnl +dnl Adapted from a macro by Andreas Zeller. +dnl +dnl The variables provided are : +dnl LINK_MOTIF (e.g. -L/usr/lesstif/lib -lXm) +dnl INCLUDE_MOTIF (e.g. -I/usr/lesstif/lib) +dnl MOTIF_LIBRARIES (e.g. /usr/lesstif/lib) +dnl MOTIF_INCLUDES (e.g. /usr/lesstif/include) +dnl +dnl The LINK_MOTIF and INCLUDE_MOTIF variables should be fit to put on +dnl your application's link line in your Makefile. +dnl +dnl Oleo CVS $Id: motif.m4,v 1.1 2002/03/29 17:40:13 ludo Exp $ +dnl +AC_DEFUN(AC_FIND_MOTIF, +[ + +AC_REQUIRE([AC_PATH_XTRA]) + +MOTIF_INCLUDES= +MOTIF_LIBRARIES= + +dnl AC_ARG_WITH(motif, +dnl [ --without-motif do not use Motif widgets]) +dnl Treat --without-motif like +dnl --without-motif-includes --without-motif-libraries. +dnl if test "$with_motif" = "no" +dnl then +dnl MOTIF_INCLUDES=none +dnl MOTIF_LIBRARIES=none +dnl fi + +AC_ARG_WITH(motif-includes, +[ --with-motif-includes=DIR Motif include files are in DIR], +MOTIF_INCLUDES="$withval") + +AC_ARG_WITH(motif-libraries, +[ --with-motif-libraries=DIR Motif libraries are in DIR], +MOTIF_LIBRARIES="$withval") + +AC_MSG_CHECKING(for Motif) + +# +# +# Search the include files. +# +if test "$MOTIF_INCLUDES" = ""; then +AC_CACHE_VAL(ac_cv_motif_includes, +[ +ac_motif_save_LIBS="$LIBS" +ac_motif_save_CFLAGS="$CFLAGS" +ac_motif_save_CPPFLAGS="$CPPFLAGS" +ac_motif_save_LDFLAGS="$LDFLAGS" +# +LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS" +CFLAGS="$X_CFLAGS $CFLAGS" +CPPFLAGS="$X_CFLAGS $CPPFLAGS" +LDFLAGS="$X_LIBS $LDFLAGS" +# +ac_cv_motif_includes="none" +AC_TRY_COMPILE([#include ],[int a;], +[ +# Xm/Xm.h is in the standard search path. +ac_cv_motif_includes= +], +[ +# Xm/Xm.h is not in the standard search path. +# Locate it and put its directory in `MOTIF_INCLUDES' +# +# /usr/include/Motif* are used on HP-UX (Motif). +# /usr/include/X11* are used on HP-UX (X and Athena). +# /usr/dt is used on Solaris (Motif). +# /usr/openwin is used on Solaris (X and Athena). +# Other directories are just guesses. +for dir in "$x_includes" "${prefix}/include" /usr/include /usr/local/include \ + /usr/include/Motif2.0 /usr/include/Motif1.2 /usr/include/Motif1.1 \ + /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 \ + /usr/dt/include /usr/openwin/include \ + /usr/dt/*/include /opt/*/include /usr/include/Motif* \ + "${prefix}"/*/include /usr/*/include /usr/local/*/include \ + "${prefix}"/include/* /usr/include/* /usr/local/include/*; do +if test -f "$dir/Xm/Xm.h"; then +ac_cv_motif_includes="$dir" +break +fi +done +]) +# +LIBS="$ac_motif_save_LIBS" +CFLAGS="$ac_motif_save_CFLAGS" +CPPFLAGS="$ac_motif_save_CPPFLAGS" +LDFLAGS="$ac_motif_save_LDFLAGS" +]) +MOTIF_INCLUDES="$ac_cv_motif_includes" +fi +# +# +# Now for the libraries. +# +if test "$MOTIF_LIBRARIES" = ""; then +AC_CACHE_VAL(ac_cv_motif_libraries, +[ +ac_motif_save_LIBS="$LIBS" +ac_motif_save_CFLAGS="$CFLAGS" +ac_motif_save_CPPFLAGS="$CPPFLAGS" +ac_motif_save_LDFLAGS="$LDFLAGS" +# +LIBS="$X_PRE_LIBS -lXm -lXt -lX11 $X_EXTRA_LIBS $LIBS" +CFLAGS="$X_CFLAGS $CFLAGS" +CPPFLAGS="$X_CFLAGS $CPPFLAGS" +LDFLAGS="$X_LIBS $LDFLAGS" +# +ac_cv_motif_libraries="none" +AC_TRY_LINK([#include ],[XtToolkitInitialize();], +[ +# libXm.a is in the standard search path. +ac_cv_motif_libraries= +], +[ +# libXm.a is not in the standard search path. +# Locate it and put its directory in `MOTIF_LIBRARIES' +# +# /usr/lib/Motif* are used on HP-UX (Motif). +# /usr/lib/X11* are used on HP-UX (X and Athena). +# /usr/dt is used on Solaris (Motif). +# /usr/lesstif is used on Linux (Lesstif). +# /usr/openwin is used on Solaris (X and Athena). +# Other directories are just guesses. +for dir in "$x_libraries" "${prefix}/lib" /usr/lib /usr/local/lib \ + /usr/lib/Motif2.0 /usr/lib/Motif1.2 /usr/lib/Motif1.1 \ + /usr/lib/X11R6 /usr/lib/X11R5 /usr/lib/X11R4 /usr/lib/X11 \ + /usr/dt/lib /usr/openwin/lib \ + /usr/dt/*/lib /opt/*/lib /usr/lib/Motif* \ + /usr/lesstif*/lib /usr/lib/Lesstif* \ + "${prefix}"/*/lib /usr/*/lib /usr/local/*/lib \ + "${prefix}"/lib/* /usr/lib/* /usr/local/lib/*; do +if test -d "$dir" && test "`ls $dir/libXm.* 2> /dev/null`" != ""; then +ac_cv_motif_libraries="$dir" +break +fi +done +]) +# +LIBS="$ac_motif_save_LIBS" +CFLAGS="$ac_motif_save_CFLAGS" +CPPFLAGS="$ac_motif_save_CPPFLAGS" +LDFLAGS="$ac_motif_save_LDFLAGS" +]) +# +MOTIF_LIBRARIES="$ac_cv_motif_libraries" +fi +# +# Provide an easier way to link +# +if test "$MOTIF_INCLUDES" = "none" -o "$MOTIF_LIBRARIES" = "none"; then + with_motif="no" +else + with_motif="yes" +fi + +if test "$with_motif" != "no"; then + if test "$MOTIF_LIBRARIES" = ""; then + LINK_MOTIF="-lXm" + MOTIF_LIBS="-lXm" + else + LINK_MOTIF="-L$MOTIF_LIBRARIES -lXm" + MOTIF_LIBS="-L$MOTIF_LIBRARIES -lXm" + fi + if test "$MOTIF_INCLUDES" != ""; then + INCLUDE_MOTIF="-I$MOTIF_INCLUDES" + MOTIF_CFLAGS="-I$MOTIF_INCLUDES" + fi + AC_DEFINE(HAVE_MOTIF) +else + with_motif="no" +fi +# +AC_SUBST(LINK_MOTIF) +AC_SUBST(INCLUDE_MOTIF) +# +# +# +motif_libraries_result="$MOTIF_LIBRARIES" +motif_includes_result="$MOTIF_INCLUDES" +test "$motif_libraries_result" = "" && motif_libraries_result="in default path" +test "$motif_includes_result" = "" && motif_includes_result="in default path" +test "$motif_libraries_result" = "none" && motif_libraries_result="(none)" +test "$motif_includes_result" = "none" && motif_includes_result="(none)" +AC_MSG_RESULT( + [libraries $motif_libraries_result, headers $motif_includes_result]) +])dnl + diff --git a/alliance/src/dreal/src/GMC.h b/alliance/src/dreal/src/GMC.h new file mode 100644 index 00000000..c9bee6ca --- /dev/null +++ b/alliance/src/dreal/src/GMC.h @@ -0,0 +1,79 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Create.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GMC +# define DREAL_GMC + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern DrealMenuItem DrealCreateMenu[]; + extern DrealPanelItem DrealCreateRectanglePanel; + + extern int DrealCreateRectangleDefaultValues[ 5 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealBuildPanelCreate(); + extern void DrealBuildCreateDialog(); + extern void DrealCreateRectangleRds(); + extern void DrealCreateAbutmentBoxRds(); + + extern void DrealChangeRectangleLayer(); + +# endif + diff --git a/alliance/src/dreal/src/GMC_create.c b/alliance/src/dreal/src/GMC_create.c new file mode 100644 index 00000000..d8ae878a --- /dev/null +++ b/alliance/src/dreal/src/GMC_create.c @@ -0,0 +1,225 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Create.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMC.h" + +# include "GMC_create.h" +# include "GMC_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rectangle | +| | +\------------------------------------------------------------*/ + + char DrealRectangleLayer = 0; + char *DrealRectangleName = (char *)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealCreateFigureRds | +| | +\------------------------------------------------------------*/ + +void DrealCreateFigureRds() + +{ + if ( DrealFigureRds == (rdsfig_list *)NULL ) + { + rdsbegin(); + + DrealNewFigure( DREAL_DEFAULT_FIGURE_NAME ); + + DrealChangeTopLevelTitle( DrealFigureRds->NAME ); + + rdsend(); + } +} + +/*------------------------------------------------------------\ +| | +| DrealCreateRectangleRds | +| | +\------------------------------------------------------------*/ + +void DrealCreateRectangleRds( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; +{ + rdsrec_list *Rectangle; + long Swap; + + rdsbegin(); + + if ( ( LambdaX1 != LambdaX2 ) && + ( LambdaY1 != LambdaY2 ) ) + { + if ( LambdaX1 > LambdaX2 ) + { + Swap = LambdaX1; LambdaX1 = LambdaX2; LambdaX2 = Swap; + } + + if ( LambdaY1 > LambdaY2 ) + { + Swap = LambdaY1; LambdaY1 = LambdaY2; LambdaY2 = Swap; + } + } + else + { + DrealErrorMessage( DrealMainWindow, "This rectangle is too small !" ); + + rdsend(); + return; + } + + DrealCreateFigureRds(); + + Rectangle = DrealAddRectangle( DrealRectangleName, + DrealRectangleLayer, + LambdaX1 * RDS_PHYSICAL_GRID, + LambdaY1 * RDS_PHYSICAL_GRID, + ( LambdaX2 - LambdaX1 ) * RDS_PHYSICAL_GRID, + ( LambdaY2 - LambdaY1 ) * RDS_PHYSICAL_GRID ); + + DrealAddUndo(); + DrealAddUndoRec( Rectangle ); + + DrealDisplayRectangle( Rectangle ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Dreal Create Abutmentbox | +| | +\------------------------------------------------------------*/ + +void DrealCreateAbutmentBoxRds( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; +{ + rdsrec_list *Rectangle; + long Swap; + + rdsbegin(); + + if ( ( LambdaX1 != LambdaX2 ) && + ( LambdaY1 != LambdaY2 ) ) + { + if ( LambdaX1 > LambdaX2 ) + { + Swap = LambdaX1; LambdaX1 = LambdaX2; LambdaX2 = Swap; + } + + if ( LambdaY1 > LambdaY2 ) + { + Swap = LambdaY1; LambdaY1 = LambdaY2; LambdaY2 = Swap; + } + } + else + { + DrealErrorMessage( DrealMainWindow, "The abutment box must be rectangular !" ); + + rdsend(); + return; + } + + DrealCreateFigureRds(); + + Rectangle = DrealAddAbox( LambdaX1 * RDS_PHYSICAL_GRID, + LambdaY1 * RDS_PHYSICAL_GRID, + ( LambdaX2 - LambdaX1 ) * RDS_PHYSICAL_GRID, + ( LambdaY2 - LambdaY1 ) * RDS_PHYSICAL_GRID ); + + DrealAddUndo(); + DrealAddUndoRec( Rectangle ); + + DrealDisplayRectangle( Rectangle ); + + DrealChangeEditMode( DREAL_EDIT_MEASURE, + DrealPromptEditMeasure ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMC_create.h b/alliance/src/dreal/src/GMC_create.h new file mode 100644 index 00000000..3e2de9f6 --- /dev/null +++ b/alliance/src/dreal/src/GMC_create.h @@ -0,0 +1,80 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Create.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_CREATE +# define DREAL_CREATE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rectangle & Wire | +| | +\------------------------------------------------------------*/ + + extern char DrealRectangleLayer; + extern char *DrealRectangleName; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GMC_dialog.c b/alliance/src/dreal/src/GMC_dialog.c new file mode 100644 index 00000000..4223546a --- /dev/null +++ b/alliance/src/dreal/src/GMC_dialog.c @@ -0,0 +1,192 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMC.h" + +# include "GMC_dialog.h" +# include "GMC_create.h" +# include "GMC_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + char DrealCreateDialogCancel = 1; + +/*------------------------------------------------------------\ +| | +| Create Dialog | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rectangle Dialog | +| | +\------------------------------------------------------------*/ + + DrealDialogItem DrealChangeRectangleNameDialog = + + { + "Rectangle name", + DREAL_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackChangeRectangleNameOk, + (XtPointer)NULL, + (void *)CallbackChangeRectangleNameCancel, + (XtPointer)NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealBuildCreateDialog | +| | +\------------------------------------------------------------*/ + +void DrealBuildCreateDialog() + +{ + rdsbegin(); + + DrealBuildDialog( DrealMainWindow, &DrealChangeRectangleNameDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Dialog | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackChangeRectangleNameOk | +| | +\------------------------------------------------------------*/ + +void CallbackChangeRectangleNameOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *NameSet; + + rdsbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &NameSet ); + + XtUnmanageChild( DrealChangeRectangleNameDialog.WIDGET ); + + DrealExitDialog(); + + DrealCreateDialogCancel = 0; + + NameSet = DrealPostTreatString( NameSet ); + + if ( NameSet != (char *)NULL ) + { + NameSet = namealloc( NameSet ); + } + + DrealRectangleName = NameSet; + + DrealChangeEditMode( DREAL_CREATE_RECTANGLE, + DrealPromptCreateRectangle ); + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackChangeRectangleNameCancel | +| | +\------------------------------------------------------------*/ + +void CallbackChangeRectangleNameCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + rdsbegin(); + + XtUnmanageChild( DrealChangeRectangleNameDialog.WIDGET ); + + DrealExitDialog(); + + DrealCreateDialogCancel = 1; + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMC_dialog.h b/alliance/src/dreal/src/GMC_dialog.h new file mode 100644 index 00000000..dbb3cd5f --- /dev/null +++ b/alliance/src/dreal/src/GMC_dialog.h @@ -0,0 +1,77 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_CREATE_DIALOG +# define DREAL_CREATE_DIALOG + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char DrealCreateDialogCancel; + extern DrealDialogItem DrealChangeRectangleNameDialog; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackChangeRectangleNameOk(); + extern void CallbackChangeRectangleNameCancel(); + +# endif diff --git a/alliance/src/dreal/src/GMC_menu.c b/alliance/src/dreal/src/GMC_menu.c new file mode 100644 index 00000000..9a1b0a3b --- /dev/null +++ b/alliance/src/dreal/src/GMC_menu.c @@ -0,0 +1,174 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GTB.h" +# include "GSB.h" +# include "GRD.h" +# include "GMX.h" +# include "GMC.h" + +# include "GMC_menu.h" +# include "GMC_create.h" +# include "GMC_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + DrealMenuItem DrealCreateMenu[] = + + { + { + "Abutment Box", + 'A', + "CtrlA", + "Ctrl A", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackCreateAbutmentBox, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Rectangle ", + 't', + "CtrlT", + "Ctrl T", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackCreateRectangle, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackCreateRectangle | +| | +\------------------------------------------------------------*/ + +void CallbackCreateRectangle( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealChangeEditMode( DREAL_CREATE_RECTANGLE, + DrealPromptCreateRectangle ); + + DrealEnterPanel( &DrealCreateRectanglePanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackCreateAbutmentBox | +| | +\------------------------------------------------------------*/ + +void CallbackCreateAbutmentBox( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ( DrealFigureRds != (rdsfig_list *)0 ) && + ( ( DrealFigureXAB1 != 0 ) || + ( DrealFigureXAB2 != 0 ) || + ( DrealFigureYAB1 != 0 ) || + ( DrealFigureYAB2 != 0 ) ) ) + { + DrealErrorMessage( DrealMainWindow, "There is already one abutment box !"); + } + else + { + DrealChangeEditMode( DREAL_CREATE_ABUTMENTBOX, + DrealPromptCreateAbutmentBox ); + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMC_menu.h b/alliance/src/dreal/src/GMC_menu.h new file mode 100644 index 00000000..341415e6 --- /dev/null +++ b/alliance/src/dreal/src/GMC_menu.h @@ -0,0 +1,73 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_CREATE_MENU +# define DREAL_CREATE_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackCreateRectangle(); + extern void CallbackCreateAbutmentBox(); + +# endif diff --git a/alliance/src/dreal/src/GMC_message.c b/alliance/src/dreal/src/GMC_message.c new file mode 100644 index 00000000..0a763b65 --- /dev/null +++ b/alliance/src/dreal/src/GMC_message.c @@ -0,0 +1,153 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Message.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMC.h" +# include "GMC_message.h" +# include "GMC_create.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static char MessageBuffer[ 512 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealPromptCreateRectangle | +| | +\------------------------------------------------------------*/ + +void DrealPromptCreateRectangle() + +{ + char StaticLayer; + + StaticLayer = RDS_STATIC_LAYER[ DrealRectangleLayer ]; + + DrealDisplayMessage( DREAL_MESSAGE_MODE, "Create Rectangle" ); + + if ( DrealRectangleName == (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] , + DrealRectangleName ); + } + + DrealDisplayMessage( DREAL_MESSAGE_INFO, MessageBuffer ); + + switch ( DrealCountEventEdit ) + { + case 0 : + + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter first point" ); + + break; + + case 1 : + + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter second point" ); + } +} + +/*------------------------------------------------------------\ +| | +| DrealPromptCreateAbutmentBox | +| | +\------------------------------------------------------------*/ + +void DrealPromptCreateAbutmentBox() + +{ + DrealDisplayMessage( DREAL_MESSAGE_MODE, "Create Abutmentbox" ); + 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 second corner" ); + } +} diff --git a/alliance/src/dreal/src/GMC_message.h b/alliance/src/dreal/src/GMC_message.h new file mode 100644 index 00000000..df960cbb --- /dev/null +++ b/alliance/src/dreal/src/GMC_message.h @@ -0,0 +1,73 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Message.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MESSAGE +# define DREAL_MESSAGE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealPromptCreateRectangle(); + extern void DrealPromptCreateAbutmentBox(); + +# endif diff --git a/alliance/src/dreal/src/GMC_panel.c b/alliance/src/dreal/src/GMC_panel.c new file mode 100644 index 00000000..f6e488f1 --- /dev/null +++ b/alliance/src/dreal/src/GMC_panel.c @@ -0,0 +1,1173 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GTB.h" +# include "GSB.h" +# include "GMX.h" +# include "GRD.h" +# include "GMC.h" + +# include "GMC_panel.h" +# include "GMC_dialog.h" +# include "GMC_create.h" +# include "GMC_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Create Panel | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rectangle Panel | +| | +\------------------------------------------------------------*/ + + static DrealPanelButtonItem DrealCreateRectangleButton[RDS_ALL_LAYER+2] = + + { + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackChangeRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + "Name", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 2, 1, + CallbackChangeRectangleName, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Close", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 2, 1, + CallbackChangeRectangleClose, + (XtPointer)NULL, + (Widget)NULL + } + }; + + DrealPanelItem DrealCreateRectanglePanel = + + { + "Rectangle", + 1, + 0, + DREAL_CREATE_RECTANGLE_X, + DREAL_CREATE_RECTANGLE_Y, + 100, + 300, + 2, + ( RDS_ALL_LAYER + 2 ) / 2, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + RDS_ALL_LAYER + 2, + DrealCreateRectangleButton + }; + + int DrealCreateRectangleDefaultValues[ 5 ] = + + { + DREAL_CREATE_RECTANGLE_X, + DREAL_CREATE_RECTANGLE_Y, + 100, 300, 0 + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealBuildPanelCreate | +| | +\------------------------------------------------------------*/ + +void DrealBuildPanelCreate() + +{ + DrealPanelButtonItem *Button; + long Layer; + long Index; + unsigned char X1; + unsigned char Y1; + + X1 = 0; + Y1 = 0; + Index = 0; + + for ( Layer = 0; Layer < RDS_LAYER_ABOX; Layer++ ) + { + if ( ( DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 0 ] != NULL ) && + ( RDS_DYNAMIC_LAYER[ Layer ] != RDS_LAYER_UNUSED ) ) + { + Button = &DrealCreateRectangleButton[ Index ]; + + Button->LABEL = DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 0 ]; + Button->FOREGROUND = DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 1 ]; + Button->BACKGROUND = DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 2 ]; + + Button->X = X1; + Button->Y = Y1; + Button->CALLDATA = (XtPointer)(long)RDS_DYNAMIC_LAYER[ Layer ]; + + if ( X1 == 1 ) + { + X1 = 0; Y1 = Y1 + 1; + } + else + { + X1 = X1 + 1; + } + + Index = Index + 1; + } + } + + if ( X1 == 1 ) Y1 = Y1 + 1; + + for ( Index = 0; Index < 2; Index++ ) + { + DrealCreateRectangleButton[ RDS_ALL_LAYER + Index ].Y = Y1; + Y1 = Y1 + 1; + } + + DrealCreateRectanglePanel.ROW = Y1; + DrealCreateRectangleDefaultValues[ 3 ] = Y1 * 25; +} + +/*------------------------------------------------------------\ +| | +| Callback For Rectangle | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackChangeRectangleLayer | +| | +\------------------------------------------------------------*/ + +void CallbackChangeRectangleLayer( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealRectangleLayer = (int)ClientData; + + DrealChangeEditMode( DREAL_CREATE_RECTANGLE, + DrealPromptCreateRectangle ); + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealChangeRectangleLayer | +| | +\------------------------------------------------------------*/ + +void DrealChangeRectangleLayer( LayerUp ) + + int LayerUp; +{ + int RdsLayer; + int Step; + long RdsWidth; + + if ( LayerUp ) Step = 1; + else Step = -1; + + RdsLayer = RDS_STATIC_LAYER[ DrealRectangleLayer ]; + + do + { + RdsLayer += Step; + + if ( RdsLayer >= RDS_LAYER_ABOX ) RdsLayer = 0; + else + if ( RdsLayer < 0 ) RdsLayer = RDS_LAYER_ABOX - 1; + } + while ( ( DREAL_RDS_LAYER_NAME_TABLE[ RdsLayer ][ 0 ] == (char *)0 ) || + ( RDS_DYNAMIC_LAYER[ RdsLayer ] == RDS_LAYER_UNUSED ) ); + + DrealRectangleLayer = RDS_DYNAMIC_LAYER[ RdsLayer ]; +} + +/*------------------------------------------------------------\ +| | +| CallbackChangeRectangleName | +| | +\------------------------------------------------------------*/ + +void CallbackChangeRectangleName( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterDialog( &DrealChangeRectangleNameDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackChangeRectangleClose | +| | +\------------------------------------------------------------*/ + +void CallbackChangeRectangleClose( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitPanel( &DrealCreateRectanglePanel ); + + DrealChangeEditMode( DREAL_EDIT_MEASURE, + DrealPromptEditMeasure ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMC_panel.h b/alliance/src/dreal/src/GMC_panel.h new file mode 100644 index 00000000..77688081 --- /dev/null +++ b/alliance/src/dreal/src/GMC_panel.h @@ -0,0 +1,78 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_CREATE_PANEL +# define DREAL_CREATE_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_CREATE_RECTANGLE_X 790 +# define DREAL_CREATE_RECTANGLE_Y 330 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackChangeRectangleLayer(); + extern void CallbackChangeRectangleName(); + extern void CallbackChangeRectangleClose(); + +# endif diff --git a/alliance/src/dreal/src/GME.h b/alliance/src/dreal/src/GME.h new file mode 100644 index 00000000..808efbf3 --- /dev/null +++ b/alliance/src/dreal/src/GME.h @@ -0,0 +1,111 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Gme101.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GME +# define DREAL_GME + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern DrealMenuItem DrealEditMenu[]; + extern DrealMenuItem DrealWindowMenu[]; + extern DrealPanelItem DrealEditGlobalPanel; + extern DrealPanelItem DrealWindowGlobalPanel; + extern DrealPanelItem DrealEditSearchPanel; + extern DrealPanelItem DrealEditSearchViewPanel; + extern DrealPanelItem DrealEditIdentifyPanel; + extern DrealPanelItem DrealEditSelectPanel; + extern DrealPanelItem DrealModifyRectanglePanel; + + extern int DrealEditGlobalDefaultValues[ 5 ]; + extern int DrealWindowGlobalDefaultValues[ 5 ]; + extern int DrealEditSearchDefaultValues[ 5 ]; + extern int DrealEditIdentifyDefaultValues[ 5 ]; + extern int DrealEditSelectDefaultValues[ 5 ]; + extern int DrealEditSearchViewDefaultValues[ 5 ]; + extern int DrealModifyRectangleDefaultValues[ 5 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealBuidlPanelModify(); + extern void DrealBuildEditDialog(); + + extern void DrealEditSelectPointDelete(); + extern void DrealEditSelectWindowDelete(); + extern void DrealEditSelectPointCopy(); + extern void DrealEditSelectWindowCopy(); + extern void DrealEditSelectPointMove(); + extern void DrealEditSelectWindowMove(); + extern void DrealEditSelectPointModify(); + extern void DrealEditSelectWindowModify(); + + extern void DrealEditIdentify(); + extern void DrealEditUnselectAll(); + + extern void DrealEditSelectPoint(); + extern void DrealEditSelectWindow(); + extern void DrealEditSelectFence(); + + extern void DrealEditUndo(); + extern void DrealEditRedo(); + extern void DrealEditCopy(); + extern void DrealEditMove(); + extern void DrealEditDelete(); + extern void DrealEditModify(); + extern void DrealEditStretch(); + +# endif diff --git a/alliance/src/dreal/src/GME_dialog.c b/alliance/src/dreal/src/GME_dialog.c new file mode 100644 index 00000000..2e262d50 --- /dev/null +++ b/alliance/src/dreal/src/GME_dialog.c @@ -0,0 +1,286 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GSB.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GME.h" + +# include "GME_dialog.h" +# include "GME_modify.h" +# include "GME_search.h" +# include "GME_edit.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Search Dialog | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Search Rectangle Dialog | +| | +\------------------------------------------------------------*/ + + DrealDialogItem DrealSearchRectangleDialog = + + { + "Rectangle name", + DREAL_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackSearchRectangleOk, + (XtPointer)NULL, + (void *)CallbackSearchRectangleCancel, + (XtPointer)NULL + }; + +/*------------------------------------------------------------\ +| | +| Modify Dialog | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rectangle Dialog | +| | +\------------------------------------------------------------*/ + + DrealDialogItem DrealModifyRectangleNameDialog = + + { + "Rectangle name", + DREAL_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackModifyRectangleNameOk, + (XtPointer)NULL, + (void *)CallbackModifyRectangleNameCancel, + (XtPointer)NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealBuildEditDialog | +| | +\------------------------------------------------------------*/ + +void DrealBuildEditDialog() + +{ + rdsbegin(); + + DrealBuildDialog( DrealMainWindow, &DrealSearchRectangleDialog ); + DrealBuildDialog( DrealMainWindow, &DrealModifyRectangleNameDialog ); + DrealBuildDialog( DrealMainWindow, &DrealSearchRectangleDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Dialog | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback For Modify | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackModifyRectangleNameOk | +| | +\------------------------------------------------------------*/ + +void CallbackModifyRectangleNameOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *NameSet; + + rdsbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &NameSet ); + + XtUnmanageChild( DrealModifyRectangleNameDialog.WIDGET ); + + DrealExitDialog(); + + NameSet = DrealPostTreatString( NameSet ); + + if ( NameSet != (char *)NULL ) + { + NameSet = namealloc( NameSet ); + } + + DrealRectangleMName = NameSet; + + DrealPromptModifyRectangle(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackModifyRectangleNameCancel | +| | +\------------------------------------------------------------*/ + +void CallbackModifyRectangleNameCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + rdsbegin(); + + XtUnmanageChild( DrealModifyRectangleNameDialog.WIDGET ); + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Search Callback | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback For Rectangle | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackSearchRectangleOk | +| | +\------------------------------------------------------------*/ + +void CallbackSearchRectangleOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *NameSet; + + rdsbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &NameSet ); + + XtUnmanageChild( DrealSearchRectangleDialog.WIDGET ); + + DrealExitDialog(); + + NameSet = DrealPostTreatString( NameSet ); + + if ( NameSet != (char *)NULL ) + { + NameSet = namealloc( NameSet ); + + DrealEditSearchRectangle( NameSet ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackSearchRectangleCancel | +| | +\------------------------------------------------------------*/ + +void CallbackSearchRectangleCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + rdsbegin(); + + XtUnmanageChild( DrealSearchRectangleDialog.WIDGET ); + + DrealExitDialog(); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GME_dialog.h b/alliance/src/dreal/src/GME_dialog.h new file mode 100644 index 00000000..1f3c9b32 --- /dev/null +++ b/alliance/src/dreal/src/GME_dialog.h @@ -0,0 +1,83 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_EDIT_DIALOG +# define DREAL_EDIT_DIALOG + + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern DrealDialogItem DrealSearchRectangleDialog; + + extern DrealDialogItem DrealModifyRectangleNameDialog; + extern DrealDialogItem DrealSearchRectangleDialog; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackModifyRectangleNameOk(); + extern void CallbackModifyRectangleNameCancel(); + + extern void CallbackSearchRectangleOk(); + extern void CallbackSearchRectangleCancel(); + +# endif diff --git a/alliance/src/dreal/src/GME_edit.c b/alliance/src/dreal/src/GME_edit.c new file mode 100644 index 00000000..06bc469b --- /dev/null +++ b/alliance/src/dreal/src/GME_edit.c @@ -0,0 +1,684 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Edit.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GME.h" + +# include "GME_edit.h" +# include "GME_panel.h" +# include "GME_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Identify Buffer | +| | +\------------------------------------------------------------*/ + + static char DrealIdentifyMessage[ DREAL_IDENTIFY_MESSAGE_SIZE ]; + static char DrealIdentifyBuffer [ DREAL_IDENTIFY_BUFFER_SIZE ]; + static char *DrealScanIdentify; + static long DrealIdentifyLength; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealEditTreatUndo | +| | +\------------------------------------------------------------*/ + +void DrealEditTreatUndo( HeadUndo ) + + drealundo *HeadUndo; +{ + rdsrec_list *Rec; + drealundorec *UndoRec; + char OneElement; + + if ( HeadUndo->UNDO->NEXT != (drealundorec *)NULL ) + { + OneElement = DREAL_FALSE; + } + else + { + OneElement = (DrealHeadSelect == (drealselect *)NULL); + } + + DrealDelSelect(); + DrealRecomputeBound = DREAL_TRUE; + + for ( UndoRec = HeadUndo->UNDO; + UndoRec != (drealundorec *)NULL; + UndoRec = UndoRec->NEXT ) + { + Rec = UndoRec->RECTANGLE; + + if ( IsRdsFigure( Rec ) ) + { + if ( IsDrealDeleted( Rec ) ) + { + ClearDrealDeleted( Rec ); + + DrealFigureXAB1 = Rec->X; + DrealFigureYAB1 = Rec->Y; + DrealFigureXAB2 = ( Rec->X + Rec->DX ); + DrealFigureYAB2 = ( Rec->Y + Rec->DY ); + } + else + { + DrealFigureXAB1 = 0; + DrealFigureXAB2 = 0; + DrealFigureYAB1 = 0; + DrealFigureYAB2 = 0; + + DrealDeleteRectangle( Rec ); + } + + OneElement = DREAL_FALSE; + } + else + { + if ( IsDrealDeleted( Rec ) ) + { + DrealUndeleteRectangle( Rec ); + if ( OneElement ) DrealDisplayRectangle( Rec ); + } + else + { + DrealDeleteRectangle( Rec ); + if ( OneElement ) DrealDisplayRectangle( Rec ); + } + } + } + + HeadUndo->UNDO = (drealundorec *)reverse( (chain_list *)HeadUndo->UNDO ); + + if ( ! OneElement ) + { + DrealZoomRefresh(); + } +} + +/*------------------------------------------------------------\ +| | +| DrealEditRedo | +| | +\------------------------------------------------------------*/ + +void DrealEditRedo() + +{ + drealundo *NewUndo; + + rdsbegin(); + + if ( DrealHeadRedo != (drealundo *)NULL ) + { + DrealEditTreatUndo( DrealHeadRedo ); + + NewUndo = DrealHeadRedo; + DrealHeadRedo = DrealHeadRedo->NEXT; + NewUndo->NEXT = DrealHeadUndo; + DrealHeadUndo = NewUndo; + } + else + { + DrealWarningMessage( DrealMainWindow, "Nothing to Redo !" ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditUndo | +| | +\------------------------------------------------------------*/ + +void DrealEditUndo() + +{ + drealundo *NewRedo; + + rdsbegin(); + + if ( DrealHeadUndo != (drealundo *)NULL ) + { + DrealEditTreatUndo( DrealHeadUndo ); + + NewRedo = DrealHeadUndo; + DrealHeadUndo = DrealHeadUndo->NEXT; + NewRedo->NEXT = DrealHeadRedo; + DrealHeadRedo = NewRedo; + } + else + { + DrealWarningMessage( DrealMainWindow, "Nothing to undo !" ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealAddIdentify | +| | +\------------------------------------------------------------*/ + +char DrealAddIdentify( Rectangle ) + + rdsrec_list *Rectangle; +{ + rdsins_list *Instance; + char StaticLayer; + long Length; + + rdsbegin(); + + DrealIdentifyBuffer[0] = '\0'; + + if ( IsRdsInstance( Rectangle ) ) + { + Instance = (rdsins_list *)DREAL_PREVIOUS( Rectangle ); + + sprintf( DrealIdentifyBuffer, + "INSTANCE :\n\n NAME : %s\n MODEL : %s\n TRANSF : %s\n X : %.3f\n Y : %.3f\n\n", + Instance->INSNAME, + Instance->FIGNAME, + RDS_TRANSF_NAME[ Instance->TRANSF ], + Instance->X * DREAL_RDS_UNIT_TO_MICRON, + Instance->Y * DREAL_RDS_UNIT_TO_MICRON ); + } + else + if ( IsRdsFigure( Rectangle ) ) + { + sprintf( DrealIdentifyBuffer, + "ABUTMENT BOX :\n\n NAME : %s\n X : %.3f\n Y : %.3f\n DX : %.3f\n DY : %.3f\n\n", + Rectangle->NAME, + Rectangle->X * DREAL_RDS_UNIT_TO_MICRON, + Rectangle->Y * DREAL_RDS_UNIT_TO_MICRON, + Rectangle->DX * DREAL_RDS_UNIT_TO_MICRON, + Rectangle->DY * DREAL_RDS_UNIT_TO_MICRON ); + } + else + { + StaticLayer = RDS_STATIC_LAYER[ GetRdsLayer( Rectangle ) ]; + + sprintf( DrealIdentifyBuffer, + "RECTANGLE :\n\n NAME : %s\n LAYER : %s\n X : %.3f\n Y : %.3f\n DX : %.3f\n DY : %.3f\n\n", + ( Rectangle->NAME != (char *)NULL ) ? Rectangle->NAME : "None", + DREAL_RDS_LAYER_NAME_TABLE[ StaticLayer ][0], + Rectangle->X * DREAL_RDS_UNIT_TO_MICRON, + Rectangle->Y * DREAL_RDS_UNIT_TO_MICRON, + Rectangle->DX * DREAL_RDS_UNIT_TO_MICRON, + Rectangle->DY * DREAL_RDS_UNIT_TO_MICRON ); + } + + Length = strlen( DrealIdentifyBuffer ); + + if ( ( DrealIdentifyLength + Length ) < ( DREAL_IDENTIFY_MESSAGE_SIZE - 1 ) ) + { + strcpy( DrealScanIdentify, DrealIdentifyBuffer ); + + DrealScanIdentify += Length; + DrealIdentifyLength += Length; + + rdsend(); + return( DREAL_TRUE ); + } + + strcpy( DrealScanIdentify, "#" ); + + rdsend(); + return( DREAL_FALSE ); +} + +/*------------------------------------------------------------\ +| | +| DrealEditIdentify | +| | +\------------------------------------------------------------*/ + +void DrealEditIdentify() +{ + drealselect *Select; + + rdsbegin(); + + strcpy( DrealIdentifyMessage, "No element found !" ); + DrealScanIdentify = DrealIdentifyMessage; + DrealIdentifyLength = 0; + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + if ( ! DrealAddIdentify( Select->RECTANGLE ) ) break; + } + + DrealDelSelect(); + + DrealDisplayIdentifyMessage( DrealIdentifyMessage ); + DrealEnterPanel( &DrealEditIdentifyPanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditCopy | +| | +\------------------------------------------------------------*/ + +void DrealEditCopy( LambdaX1, LambdaY1, LambdaX2, LambdaY2, Mode ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; + char Mode; +{ + drealselect *Select; + rdsrec_list *Rectangle; + rdsrec_list *NewRec; + char FirstUndo; + long DeltaX; + long DeltaY; + long X; + long Y; + long DX; + long DY; + + rdsbegin(); + + DeltaX = ( LambdaX2 - LambdaX1 ) * RDS_PHYSICAL_GRID; + DeltaY = ( LambdaY2 - LambdaY1 ) * RDS_PHYSICAL_GRID; + + FirstUndo = 1; + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + Rectangle = Select->RECTANGLE; + + if ( ! IsRdsFigure( Rectangle ) ) + { + if ( FirstUndo ) + { + DrealAddUndo(); + + FirstUndo = 0; + } + + X = Rectangle->X + DeltaX; + Y = Rectangle->Y + DeltaY; + DX = Rectangle->DX; + DY = Rectangle->DY; + + NewRec = DrealAddRectangle( Rectangle->NAME, + GetRdsLayer( Rectangle ), + X, Y, DX, DY ); + + DrealAddUndoRec( NewRec ); + } + } + + DrealDelSelect(); + DrealZoomRefresh(); + + if ( Mode == 0 ) + { + DrealChangeEditMode( DREAL_SELECT_POINT_COPY, + DrealPromptSelectPointCopy ); + } + else + { + DrealChangeEditMode( DREAL_SELECT_WINDOW_COPY, + DrealPromptSelectWindowCopy ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditMove | +| | +\------------------------------------------------------------*/ + +void DrealEditMove( LambdaX1, LambdaY1, LambdaX2, LambdaY2, Mode ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; + char Mode; +{ + drealselect *Select; + rdsrec_list *Rectangle; + rdsrec_list *NewRec; + char FirstUndo; + long DeltaX; + long DeltaY; + long X; + long Y; + long DX; + long DY; + + rdsbegin(); + + DeltaX = ( LambdaX2 - LambdaX1 ) * RDS_PHYSICAL_GRID; + DeltaY = ( LambdaY2 - LambdaY1 ) * RDS_PHYSICAL_GRID; + + FirstUndo = 1; + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + Rectangle = Select->RECTANGLE; + + if ( ! IsDrealAccepted( Rectangle ) ) continue; + + if ( IsRdsFigRec( Rectangle ) ) + { + if ( FirstUndo ) + { + DrealAddUndo(); + + FirstUndo = 0; + } + + DrealDeleteRectangle( Rectangle ); + DrealAddUndoRec( Rectangle ); + + X = Rectangle->X + DeltaX; + Y = Rectangle->Y + DeltaY; + DX = Rectangle->DX; + DY = Rectangle->DY; + + if ( IsRdsFigure( Rectangle ) ) + { + NewRec = DrealAddAbox( X, Y, DX, DY ); + } + else + { + NewRec = DrealAddRectangle( Rectangle->NAME, + GetRdsLayer( Rectangle ), + X, Y, DX, DY ); + } + + DrealAddUndoRec( NewRec ); + } + } + + DrealDelSelect(); + DrealZoomRefresh(); + + if ( Mode == 0 ) + { + DrealChangeEditMode( DREAL_SELECT_POINT_MOVE, + DrealPromptSelectPointMove ); + } + else + { + DrealChangeEditMode( DREAL_SELECT_WINDOW_MOVE, + DrealPromptSelectWindowMove ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditDelete | +| | +\------------------------------------------------------------*/ + +void DrealEditDelete() +{ + drealselect *Select; + rdsrec_list *Rectangle; + char FirstUndo; + + rdsbegin(); + + FirstUndo = 1; + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + Rectangle = Select->RECTANGLE; + + if ( ! IsDrealAccepted( Rectangle ) ) continue; + + if ( IsRdsFigRec( Rectangle ) ) + { + if ( FirstUndo ) + { + DrealAddUndo(); + FirstUndo = 0; + } + + if ( IsRdsFigure( Rectangle ) ) + { + DrealFigureXAB1 = 0; + DrealFigureXAB2 = 0; + DrealFigureYAB1 = 0; + DrealFigureYAB2 = 0; + } + + DrealDeleteRectangle( Rectangle ); + DrealAddUndoRec( Rectangle ); + } + } + + DrealDelSelect(); + DrealZoomRefresh(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditStretch | +| | +\------------------------------------------------------------*/ + +void DrealEditStretch( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; +{ + drealselect *Select; + rdsrec_list *Rectangle; + rdsrec_list *NewRec; + char Orient; + char FirstUndo; + long Delta; + long X; + long Y; + long DX; + long DY; + + rdsbegin(); + + Orient = 0; + + if ( LambdaX2 != LambdaX1 ) + { + Delta = LambdaX2 - LambdaX1; + Orient = ( Delta > 0 ) ? DREAL_EAST : DREAL_WEST; + } + else + { + Delta = LambdaY2 - LambdaY1; + Orient = ( Delta > 0 ) ? DREAL_NORTH : DREAL_SOUTH; + } + + Delta = Delta * RDS_PHYSICAL_GRID; + LambdaX1 = LambdaX1 * RDS_PHYSICAL_GRID; + LambdaY1 = LambdaY1 * RDS_PHYSICAL_GRID; + + if ( Delta != 0 ) + { + FirstUndo = 1; + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + Rectangle = Select->RECTANGLE; + + if ( IsRdsFigRec( Rectangle ) ) + { + X = Rectangle->X; + Y = Rectangle->Y; + DX = Rectangle->DX; + DY = Rectangle->DY; + + switch ( Orient ) + { + case DREAL_NORTH : + case DREAL_SOUTH : + + if ( LambdaY1 >= (Y + (DY >> 1)) ) + { + DY += Delta; + } + else + { + Y += Delta; DY -= Delta; + } + break; + + case DREAL_WEST : + case DREAL_EAST : + + if ( LambdaX1 <= (X + (DX >> 1)) ) + { + X += Delta; DX -= Delta; + } + else + { + DX += Delta; + } + break; + } + + if ( ( DX > 0 ) && + ( DY > 0 ) ) + { + if ( FirstUndo ) + { + DrealAddUndo(); + + FirstUndo = 0; + } + + DrealDeleteRectangle( Rectangle ); + DrealAddUndoRec( Rectangle ); + + if ( IsRdsFigure( Rectangle ) ) + { + NewRec = DrealAddAbox( X, Y, DX, DY ); + } + else + { + NewRec = DrealAddRectangle( Rectangle->NAME, + GetRdsLayer( Rectangle ), + X, Y, DX, DY ); + } + + DrealAddUndoRec( NewRec ); + } + } + } + } + + DrealDelSelect(); + DrealZoomRefresh(); + + DrealChangeEditMode( DREAL_SELECT_POINT_STRETCH, + DrealPromptSelectPointStretch ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GME_edit.h b/alliance/src/dreal/src/GME_edit.h new file mode 100644 index 00000000..9050772c --- /dev/null +++ b/alliance/src/dreal/src/GME_edit.h @@ -0,0 +1,68 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Edit.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_EDIT +# define DREAL_EDIT + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_IDENTIFY_BUFFER_SIZE 256 +# define DREAL_IDENTIFY_MESSAGE_SIZE 4096 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GME_menu.c b/alliance/src/dreal/src/GME_menu.c new file mode 100644 index 00000000..c4a358c1 --- /dev/null +++ b/alliance/src/dreal/src/GME_menu.c @@ -0,0 +1,609 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GTB.h" +# include "GRD.h" +# include "GMV.h" +# include "GME.h" +# include "GMX.h" + +# include "GME_menu.h" +# include "GME_edit.h" +# include "GME_modify.h" +# include "GME_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + DrealMenuItem DrealEditMenu[] = + + { + { + "Undo", + 'U', + "CtrlU", + "Ctrl U", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditUndo, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Redo", + 'R', + "CtrlR", + "Ctrl R", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditRedo, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Copy", + 'C', + "CtrlC", + "Ctrl C", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditCopy, + (XtPointer)0, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Move", + 'M', + "CtrlM", + "Ctrl M", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditMove, + (XtPointer)0, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Delete", + 'D', + "CtrlD", + "Ctrl D", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditDelete, + (XtPointer)0, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Stretch", + 'S', + "CtrlS", + "Ctrl S", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditStretch, + (XtPointer)0, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Modify ", + 'y', + "CtrlY", + "Ctrl Y", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditModify, + (XtPointer)0, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Identify", + 'I', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditIdentify, + (XtPointer)0, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Search ", + 'h', + "CtrlH", + "Ctrl H", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditSearch, + (XtPointer)0, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + NULL + }; + + DrealMenuItem DrealWindowMenu[] = + + { + { + "Undo", + 'U', + "MetaU", + "Meta U", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditUndo, + (XtPointer)1, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Redo", + 'R', + "MetaR", + "Meta R", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditRedo, + (XtPointer)1, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Copy", + 'C', + "MetaC", + "Meta C", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditCopy, + (XtPointer)1, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Move", + 'M', + "MetaM", + "Meta M", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditMove, + (XtPointer)1, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Delete", + 'D', + "MetaD", + "Meta D", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditDelete, + (XtPointer)1, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Modify ", + 'y', + "MetaY", + "Meta Y", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditModify, + (XtPointer)1, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Identify ", + 'I', + "MetaI", + "Meta I", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditIdentify, + (XtPointer)1, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackEditIdentify | +| | +\------------------------------------------------------------*/ + +void CallbackEditIdentify( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ClientData ) + { + DrealEnterPanel( &DrealWindowGlobalPanel ); + + DrealChangeEditMode( DREAL_SELECT_WINDOW_IDENTIFY, + DrealPromptSelectWindowIdentify ); + } + else + { + DrealEnterPanel( &DrealEditGlobalPanel ); + + DrealChangeEditMode( DREAL_SELECT_POINT_IDENTIFY, + DrealPromptSelectPointIdentify ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditCopy | +| | +\------------------------------------------------------------*/ + +void CallbackEditCopy( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ClientData ) + { + DrealEnterPanel( &DrealWindowGlobalPanel ); + + DrealChangeEditMode( DREAL_SELECT_WINDOW_COPY, + DrealPromptSelectWindowCopy ); + } + else + { + DrealEnterPanel( &DrealEditGlobalPanel ); + + DrealChangeEditMode( DREAL_SELECT_POINT_COPY, + DrealPromptSelectPointCopy ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditMove | +| | +\------------------------------------------------------------*/ + +void CallbackEditMove( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ClientData ) + { + DrealEnterPanel( &DrealWindowGlobalPanel ); + + DrealChangeEditMode( DREAL_SELECT_WINDOW_MOVE, + DrealPromptSelectWindowMove ); + } + else + { + DrealEnterPanel( &DrealEditGlobalPanel ); + + DrealChangeEditMode( DREAL_SELECT_POINT_MOVE, + DrealPromptSelectPointMove ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditDelete | +| | +\------------------------------------------------------------*/ + +void CallbackEditDelete( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ClientData ) + { + DrealEnterPanel( &DrealWindowGlobalPanel ); + + DrealChangeEditMode( DREAL_SELECT_WINDOW_DELETE, + DrealPromptSelectWindowDelete ); + } + else + { + DrealEnterPanel( &DrealEditGlobalPanel ); + + DrealChangeEditMode( DREAL_SELECT_POINT_DELETE, + DrealPromptSelectPointDelete ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditStretch | +| | +\------------------------------------------------------------*/ + +void CallbackEditStretch( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterPanel( &DrealEditGlobalPanel ); + + DrealChangeEditMode( DREAL_SELECT_POINT_STRETCH, + DrealPromptSelectPointStretch ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditModify | +| | +\------------------------------------------------------------*/ + +void CallbackEditModify( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ClientData ) + { + DrealEnterPanel( &DrealWindowGlobalPanel ); + + DrealChangeEditMode( DREAL_SELECT_WINDOW_MODIFY, + DrealPromptSelectWindowModify ); + } + else + { + DrealEnterPanel( &DrealEditGlobalPanel ); + + DrealChangeEditMode( DREAL_SELECT_POINT_MODIFY, + DrealPromptSelectPointModify ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditSearch | +| | +\------------------------------------------------------------*/ + +void CallbackEditSearch( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterPanel( &DrealEditSearchPanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditUndo | +| | +\------------------------------------------------------------*/ + +void CallbackEditUndo( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEditUndo(); + + if ( ClientData ) + { + DrealEnterPanel( &DrealWindowGlobalPanel ); + } + else + { + DrealEnterPanel( &DrealEditGlobalPanel ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditRedo | +| | +\------------------------------------------------------------*/ + +void CallbackEditRedo( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEditRedo(); + + if ( ClientData ) + { + DrealEnterPanel( &DrealWindowGlobalPanel ); + } + else + { + DrealEnterPanel( &DrealEditGlobalPanel ); + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GME_menu.h b/alliance/src/dreal/src/GME_menu.h new file mode 100644 index 00000000..004176e5 --- /dev/null +++ b/alliance/src/dreal/src/GME_menu.h @@ -0,0 +1,80 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MENU +# define DREAL_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackEditUndo(); + extern void CallbackEditRedo(); + extern void CallbackEditCopy(); + extern void CallbackEditMove(); + extern void CallbackEditDelete(); + extern void CallbackEditStretch(); + extern void CallbackEditModify(); + extern void CallbackEditIdentify(); + extern void CallbackEditSearch(); + +# endif diff --git a/alliance/src/dreal/src/GME_message.c b/alliance/src/dreal/src/GME_message.c new file mode 100644 index 00000000..33172fc0 --- /dev/null +++ b/alliance/src/dreal/src/GME_message.c @@ -0,0 +1,468 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Message.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GME.h" +# include "GME_modify.h" +# include "GME_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static char MessageBuffer[ 512 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealPromptSelectPointIdentify | +| | +\------------------------------------------------------------*/ + +void DrealPromptSelectPointIdentify() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE , "Identify" ); + DrealDisplayMessage( DREAL_MESSAGE_INFO , "Select object" ); + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter select point" ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptSelectWindowIdentify | +| | +\------------------------------------------------------------*/ + +void DrealPromptSelectWindowIdentify() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE, "Identify" ); + 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(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptSelectPointCopy | +| | +\------------------------------------------------------------*/ + +void DrealPromptSelectPointCopy() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE , "Copy" ); + DrealDisplayMessage( DREAL_MESSAGE_INFO , "Select object" ); + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter select point" ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptSelectWindowCopy | +| | +\------------------------------------------------------------*/ + +void DrealPromptSelectWindowCopy() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE, "Copy" ); + 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(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptEditCopy | +| | +\------------------------------------------------------------*/ + +void DrealPromptEditCopy() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE, "Copy" ); + 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(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptSelectPointMove | +| | +\------------------------------------------------------------*/ + +void DrealPromptSelectPointMove() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE , "Move" ); + DrealDisplayMessage( DREAL_MESSAGE_INFO , "Select object" ); + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter select point" ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptSelectWindowMove | +| | +\------------------------------------------------------------*/ + +void DrealPromptSelectWindowMove() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE, "Move" ); + 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(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptEditMove | +| | +\------------------------------------------------------------*/ + +void DrealPromptEditMove() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE, "Move" ); + 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(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptSelectPointDelete | +| | +\------------------------------------------------------------*/ + +void DrealPromptSelectPointDelete() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE , "Delete" ); + DrealDisplayMessage( DREAL_MESSAGE_INFO , "Select object" ); + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter select point" ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptSelectWindowDelete | +| | +\------------------------------------------------------------*/ + +void DrealPromptSelectWindowDelete() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE, "Delete" ); + 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(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptSelectPointStretch | +| | +\------------------------------------------------------------*/ + +void DrealPromptSelectPointStretch() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE , "Stretch" ); + DrealDisplayMessage( DREAL_MESSAGE_INFO , "Select object" ); + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter select point" ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptEditStretch | +| | +\------------------------------------------------------------*/ + +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(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptSelectPointModify | +| | +\------------------------------------------------------------*/ + +void DrealPromptSelectPointModify() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE , "Modify" ); + DrealDisplayMessage( DREAL_MESSAGE_INFO , "Select object" ); + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter select point" ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptSelectWindowModify | +| | +\------------------------------------------------------------*/ + +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(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptModifyRectangle | +| | +\------------------------------------------------------------*/ + +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(); +} diff --git a/alliance/src/dreal/src/GME_message.h b/alliance/src/dreal/src/GME_message.h new file mode 100644 index 00000000..83de16da --- /dev/null +++ b/alliance/src/dreal/src/GME_message.h @@ -0,0 +1,89 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Message.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MESSAGE +# define DREAL_MESSAGE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealPromptSelectPointIdentify(); + extern void DrealPromptSelectPointCopy(); + extern void DrealPromptSelectPointMove(); + extern void DrealPromptSelectPointDelete(); + extern void DrealPromptSelectPointStretch(); + extern void DrealPromptSelectPointModify(); + + extern void DrealPromptSelectWindowIdentify(); + extern void DrealPromptSelectWindowCopy(); + extern void DrealPromptSelectWindowMove(); + extern void DrealPromptSelectWindowDelete(); + extern void DrealPromptSelectWindowModify(); + + extern void DrealPromptEditCopy(); + extern void DrealPromptEditMove(); + extern void DrealPromptEditStretch(); + + extern void DrealPromptModifyRectangle(); + +# endif diff --git a/alliance/src/dreal/src/GME_modify.c b/alliance/src/dreal/src/GME_modify.c new file mode 100644 index 00000000..14354cdd --- /dev/null +++ b/alliance/src/dreal/src/GME_modify.c @@ -0,0 +1,207 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Modify.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GSB.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GME.h" + +# include "GME_modify.h" +# include "GME_panel.h" +# include "GME_edit.h" +# include "GME_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + char DrealModifyAbort = 0; + char DrealModifyLock = 0; + char DrealModifyApply = 0; + +/*------------------------------------------------------------\ +| | +| Rectangle | +| | +\------------------------------------------------------------*/ + + char DrealRectangleMLayer; + char *DrealRectangleMName; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Changed Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealRectangleChanged | +| | +\------------------------------------------------------------*/ + +char DrealRectangleChanged( Rectangle ) + + rdsrec_list *Rectangle; +{ + return + + ( ( Rectangle->NAME != DrealRectangleMName ) || + ( GetRdsLayer( Rectangle ) != DrealRectangleMLayer ) ); +} + +/*------------------------------------------------------------\ +| | +| DrealEditModify | +| | +\------------------------------------------------------------*/ + +void DrealEditModify() + +{ + drealselect *Select; + rdsrec_list *Rectangle; + rdsrec_list *NewRec; + char FirstUndo; + + rdsbegin(); + + FirstUndo = 1; + + DrealModifyAbort = 0; + DrealModifyApply = 0; + DrealModifyLock = 0; + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + Rectangle = Select->RECTANGLE; + + if ( ( IsRdsFigRec( Rectangle ) ) && + ( ! IsRdsFigure( Rectangle ) ) ) + { + DrealAcceptRectangle( Rectangle ); + DrealDisplayRectangle( Rectangle ); + + DrealRectangleMLayer = GetRdsLayer( Rectangle ); + DrealRectangleMName = Rectangle->NAME; + + DrealPromptModifyRectangle(); + DrealEnterPanel( &DrealModifyRectanglePanel ); + + DrealModifyLock = DREAL_TRUE; + + while ( DrealModifyLock ) + { + DrealLimitedLoop( DrealModifyRectanglePanel.PANEL ); + } + + DrealRejectRectangle( Rectangle ); + DrealDisplayRectangle( Rectangle ); + + if ( DrealModifyAbort ) break; + + if ( DrealModifyApply ) + { + if ( ! DrealRectangleChanged( Rectangle ) ) + + continue; + + if ( FirstUndo ) + { + DrealAddUndo(); + + FirstUndo = 0; + } + + DrealDeleteRectangle( Rectangle ); + DrealAddUndoRec( Rectangle ); + + NewRec = DrealAddRectangle( DrealRectangleMName, + DrealRectangleMLayer, + Rectangle->X , Rectangle->Y, + Rectangle->DX, Rectangle->DY ); + + DrealAddUndoRec( NewRec ); + + DrealDisplayRectangle( NewRec ); + } + } + } + + DrealExitPanel( &DrealModifyRectanglePanel ); + + DrealDelSelect(); + DrealZoomRefresh(); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GME_modify.h b/alliance/src/dreal/src/GME_modify.h new file mode 100644 index 00000000..44ff2db9 --- /dev/null +++ b/alliance/src/dreal/src/GME_modify.h @@ -0,0 +1,84 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Modify.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MODIFY +# define DREAL_MODIFY + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char DrealModifyAbort; + extern char DrealModifyLock; + extern char DrealModifyApply; + +/*------------------------------------------------------------\ +| | +| Lock | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rectangle | +| | +\------------------------------------------------------------*/ + + extern char DrealRectangleMLayer; + extern char *DrealRectangleMName; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + +# endif diff --git a/alliance/src/dreal/src/GME_panel.c b/alliance/src/dreal/src/GME_panel.c new file mode 100644 index 00000000..1c5b9689 --- /dev/null +++ b/alliance/src/dreal/src/GME_panel.c @@ -0,0 +1,2189 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GME.h" + +# include "GME_panel.h" +# include "GME_message.h" +# include "GME_dialog.h" +# include "GME_modify.h" +# include "GME_search.h" +# include "GME_select.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Panel | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Search View Panel | +| | +\------------------------------------------------------------*/ + + static DrealPanelButtonItem DrealEditSearchViewButton[] = + + { + { + "Continue", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackEditSearchViewContinue, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Abort", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 1, + 1, 1, + CallbackEditSearchViewAbort, + (XtPointer)NULL, + (Widget)NULL + } + }; + + DrealPanelItem DrealEditSearchViewPanel = + + { + "View search", + 1, + 0, + DREAL_EDIT_VIEW_SEARCH_X, + DREAL_EDIT_VIEW_SEARCH_Y, + 100, + 50, + 1, + 2, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 2, + DrealEditSearchViewButton + }; + + int DrealEditSearchViewDefaultValues[ 5 ] = + + { + DREAL_EDIT_VIEW_SEARCH_X, + DREAL_EDIT_VIEW_SEARCH_Y, + 100, 50, 0 + }; + +/*------------------------------------------------------------\ +| | +| Identify Edit Panel | +| | +\------------------------------------------------------------*/ + + + DrealPanelButtonItem DrealEditIdentifyButton[] = + + { + { + "Text", + "Nothing", NULL, 0, 0, + NULL, + NULL, + 0, 0, + 8, 9, + NULL, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Close", + NULL, NULL, 0, 0, + NULL, + NULL, + 3, 9, + 2, 1, + CallbackEditCloseIdentify, + (XtPointer)NULL, + (Widget)NULL + } + }; + + DrealPanelItem DrealEditIdentifyPanel = + + { + "Identify", + 1, + 0, + DREAL_EDIT_IDENTIFY_X, + DREAL_EDIT_IDENTIFY_Y, + 360, + 250, + 8, + 10, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 2, + DrealEditIdentifyButton + }; + + int DrealEditIdentifyDefaultValues[ 5 ] = + + { + DREAL_EDIT_IDENTIFY_X, + DREAL_EDIT_IDENTIFY_Y, + 360, 250, 0 + }; + +/*------------------------------------------------------------\ +| | +| Select Panel | +| | +\------------------------------------------------------------*/ + + DrealPanelButtonItem DrealEditSelectButton[] = + + { + { + "Select", + "List", + "List", 0, 0, + NULL, + NULL, + 0, 0, + 8, 9, + CallbackEditSelectList, + (XtPointer)1, + (Widget)NULL + } + , + { + "Accept", + NULL, NULL, 0, 0, + NULL, + NULL, + 1, 9, + 2, 1, + CallbackEditSelectAccept, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Cancel", + NULL, NULL, 0, 0, + NULL, + NULL, + 5, 9, + 2, 1, + CallbackEditSelectCancel, + (XtPointer)NULL, + (Widget)NULL + } + }; + + DrealPanelItem DrealEditSelectPanel = + + { + "Select", + 1, + 0, + DREAL_EDIT_SELECT_X, + DREAL_EDIT_SELECT_Y, + 360, + 250, + 8, + 10, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 3, + DrealEditSelectButton + }; + + int DrealEditSelectDefaultValues[ 5 ] = + + { + DREAL_EDIT_IDENTIFY_X, + DREAL_EDIT_IDENTIFY_Y, + 360, 250, 0 + }; + +/*------------------------------------------------------------\ +| | +| Search Element Panel | +| | +\------------------------------------------------------------*/ + + static DrealPanelButtonItem DrealEditSearchButton[] = + + { + { + "Rectangle", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackEditSearchRectangle, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Close", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 1, + 1, 1, + CallbackEditCloseSearch, + (XtPointer)NULL, + (Widget)NULL + } + }; + + DrealPanelItem DrealEditSearchPanel = + + { + "Search", + 1, + 0, + DREAL_EDIT_SEARCH_X, + DREAL_EDIT_SEARCH_Y, + 100, + 50, + 1, + 2, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 2, + DrealEditSearchButton + }; + + int DrealEditSearchDefaultValues[ 5 ] = + + { + DREAL_EDIT_SEARCH_X, + DREAL_EDIT_SEARCH_Y, + 100, 50, 0 + }; + +/*------------------------------------------------------------\ +| | +| Modify Rectangle Panel | +| | +\------------------------------------------------------------*/ + + static DrealPanelButtonItem DrealModifyRectangleButton[RDS_ALL_LAYER + 3] = + + { + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackModifyRectangleLayer, + (XtPointer)0, + (Widget)NULL + } + , + { + "Name", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 2, 1, + CallbackModifyRectangleName, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Apply", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 2, 1, + CallbackModifyRectangleApply, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Cancel", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 2, 1, + CallbackModifyRectangleCancel, + (XtPointer)NULL, + (Widget)NULL + } + }; + + DrealPanelItem DrealModifyRectanglePanel = + + { + "Modify Rectangle", + 1, + 0, + DREAL_MODIFY_RECTANGLE_X, + DREAL_MODIFY_RECTANGLE_Y, + 100, + 300, + 2, + (RDS_ALL_LAYER + 3 ) / 2, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + RDS_ALL_LAYER + 3, + DrealModifyRectangleButton + }; + + int DrealModifyRectangleDefaultValues[ 5 ] = + + { + DREAL_MODIFY_RECTANGLE_X, + DREAL_MODIFY_RECTANGLE_Y, + 100, 300, 0 + }; + +/*------------------------------------------------------------\ +| | +| Global Edit | +| | +\------------------------------------------------------------*/ + + static DrealPanelButtonItem DrealEditGlobalButton[] = + + { + { + "Undo", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackEditGlobalUndo, + (XtPointer)0, + (Widget)NULL + } + , + { + "Redo", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 1, + 1, 1, + CallbackEditGlobalRedo, + (XtPointer)0, + (Widget)NULL + } + , + { + "Copy", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 2, + 1, 1, + CallbackEditGlobalCopy, + (XtPointer)0, + (Widget)NULL + } + , + { + "Move", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 3, + 1, 1, + CallbackEditGlobalMove, + (XtPointer)0, + (Widget)NULL + } + , + { + "Delete", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 4, + 1, 1, + CallbackEditGlobalDelete, + (XtPointer)0, + (Widget)NULL + } + , + { + "Stretch", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 5, + 1, 1, + CallbackEditGlobalStretch, + (XtPointer)0, + (Widget)NULL + } + , + { + "Modify", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 6, + 1, 1, + CallbackEditGlobalModify, + (XtPointer)0, + (Widget)NULL + } + , + { + "Identify", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 7, + 1, 1, + CallbackEditGlobalIdentify, + (XtPointer)0, + (Widget)NULL + } + , + { + "Close", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 8, + 1, 1, + CallbackEditCloseGlobal, + (XtPointer)0, + (Widget)NULL + } + }; + + DrealPanelItem DrealEditGlobalPanel = + + { + "Edit", + 1, + 0, + DREAL_EDIT_GLOBAL_X, + DREAL_EDIT_GLOBAL_Y, + 100, + 225, + 1, + 9, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 9, + DrealEditGlobalButton + }; + + int DrealEditGlobalDefaultValues[ 5 ] = + + { + DREAL_EDIT_GLOBAL_X, + DREAL_EDIT_GLOBAL_Y, + 100, 225, 0 + }; + +/*------------------------------------------------------------\ +| | +| Global Window | +| | +\------------------------------------------------------------*/ + + static DrealPanelButtonItem DrealWindowGlobalButton[] = + + { + { + "Undo", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackEditGlobalUndo, + (XtPointer)0, + (Widget)NULL + } + , + { + "Redo", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 1, + 1, 1, + CallbackEditGlobalRedo, + (XtPointer)0, + (Widget)NULL + } + , + { + "Copy", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 2, + 1, 1, + CallbackEditGlobalCopy, + (XtPointer)1, + (Widget)NULL + } + , + { + "Move", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 3, + 1, 1, + CallbackEditGlobalMove, + (XtPointer)1, + (Widget)NULL + } + , + { + "Delete", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 4, + 1, 1, + CallbackEditGlobalDelete, + (XtPointer)1, + (Widget)NULL + } + , + { + "Modify", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 5, + 1, 1, + CallbackEditGlobalModify, + (XtPointer)1, + (Widget)NULL + } + , + { + "Identify", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 6, + 1, 1, + CallbackEditGlobalIdentify, + (XtPointer)1, + (Widget)NULL + } + , + { + "Close", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 7, + 1, 1, + CallbackEditCloseGlobal, + (XtPointer)1, + (Widget)NULL + } + , + NULL + }; + + DrealPanelItem DrealWindowGlobalPanel = + + { + "Window", + 1, + 0, + DREAL_WINDOW_GLOBAL_X, + DREAL_WINDOW_GLOBAL_Y, + 100, + 200, + 1, + 8, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 8, + DrealWindowGlobalButton + }; + + int DrealWindowGlobalDefaultValues[ 5 ] = + + { + DREAL_WINDOW_GLOBAL_X, + DREAL_WINDOW_GLOBAL_Y, + 100, 200, 0 + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealBuildPanelModify | +| | +\------------------------------------------------------------*/ + +void DrealBuildPanelModify() + +{ + DrealPanelButtonItem *Button; + long Layer; + long Index; + unsigned char X1; + unsigned char Y1; + + X1 = 0; + Y1 = 0; + Index = 0; + + for ( Layer = 0; Layer < RDS_LAYER_ABOX; Layer++ ) + { + if ( ( DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 0 ] != NULL ) && + ( RDS_DYNAMIC_LAYER[ Layer ] != RDS_LAYER_UNUSED ) ) + { + Button = &DrealModifyRectangleButton[ Index ]; + + Button->LABEL = DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 0 ]; + Button->FOREGROUND = DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 1 ]; + Button->BACKGROUND = DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 2 ]; + + Button->X = X1; + Button->Y = Y1; + Button->CALLDATA = (XtPointer)(long)RDS_DYNAMIC_LAYER[ Layer ]; + + if ( X1 == 1 ) + { + X1 = 0; Y1 = Y1 + 1; + } + else + { + X1 = X1 + 1; + } + + Index = Index + 1; + } + } + + if ( X1 == 1 ) Y1 = Y1 + 1; + + for ( Index = 0; Index < 3; Index++ ) + { + DrealModifyRectangleButton[ RDS_ALL_LAYER + Index ].Y = Y1; + Y1 = Y1 + 1; + } + + DrealModifyRectanglePanel.ROW = Y1; + DrealModifyRectangleDefaultValues[ 3 ] = Y1 * 25; +} + +/*------------------------------------------------------------\ +| | +| Callback For Global Edit | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackEditGlobalUndo | +| | +\------------------------------------------------------------*/ + +void CallbackEditGlobalUndo( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEditUndo(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditGlobalRedo | +| | +\------------------------------------------------------------*/ + +void CallbackEditGlobalRedo( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEditRedo(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditGlobalCopy | +| | +\------------------------------------------------------------*/ + +void CallbackEditGlobalCopy( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ClientData ) + { + DrealChangeEditMode( DREAL_SELECT_WINDOW_COPY, + DrealPromptSelectWindowCopy ); + } + else + { + DrealChangeEditMode( DREAL_SELECT_POINT_COPY, + DrealPromptSelectPointCopy ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditGlobalMove | +| | +\------------------------------------------------------------*/ + +void CallbackEditGlobalMove( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ClientData ) + { + DrealChangeEditMode( DREAL_SELECT_WINDOW_MOVE, + DrealPromptSelectWindowMove ); + } + else + { + DrealChangeEditMode( DREAL_SELECT_POINT_MOVE, + DrealPromptSelectPointMove ); + } + + rdsend(); +} +/*------------------------------------------------------------\ +| | +| CallbackEditGlobalDelete | +| | +\------------------------------------------------------------*/ + +void CallbackEditGlobalDelete( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ClientData ) + { + DrealChangeEditMode( DREAL_SELECT_WINDOW_DELETE, + DrealPromptSelectWindowDelete ); + } + else + { + DrealChangeEditMode( DREAL_SELECT_POINT_DELETE, + DrealPromptSelectPointDelete ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditGlobalStretch | +| | +\------------------------------------------------------------*/ + +void CallbackEditGlobalStretch( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealChangeEditMode( DREAL_SELECT_POINT_STRETCH, + DrealPromptSelectPointStretch ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditGlobalModify | +| | +\------------------------------------------------------------*/ + +void CallbackEditGlobalModify( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ClientData ) + { + DrealChangeEditMode( DREAL_SELECT_WINDOW_MODIFY, + DrealPromptSelectWindowModify ); + } + else + { + DrealChangeEditMode( DREAL_SELECT_POINT_MODIFY, + DrealPromptSelectPointModify ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditGlobalIdentify | +| | +\------------------------------------------------------------*/ + +void CallbackEditGlobalIdentify( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ClientData ) + { + DrealChangeEditMode( DREAL_SELECT_WINDOW_IDENTIFY, + DrealPromptSelectWindowIdentify ); + } + else + { + DrealChangeEditMode( DREAL_SELECT_POINT_IDENTIFY, + DrealPromptSelectPointIdentify ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditCloseGlobal | +| | +\------------------------------------------------------------*/ + +void CallbackEditCloseGlobal( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( ClientData ) + { + DrealExitPanel( &DrealWindowGlobalPanel ); + } + else + { + DrealExitPanel( &DrealEditGlobalPanel ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Search | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackEditSearchRectangle | +| | +\------------------------------------------------------------*/ + +void CallbackEditSearchRectangle( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterDialog( &DrealSearchRectangleDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditCloseSearch | +| | +\------------------------------------------------------------*/ + +void CallbackEditCloseSearch( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitPanel( &DrealEditSearchPanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For View Search | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackEditSearchViewContinue | +| | +\------------------------------------------------------------*/ + +void CallbackEditSearchViewContinue( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditSearchViewAbort | +| | +\------------------------------------------------------------*/ + +void CallbackEditSearchViewAbort( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealSearchAbort = DREAL_TRUE; + + DrealExitDialog(); + + rdsbegin(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Identify | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackEditCloseIdentify | +| | +\------------------------------------------------------------*/ + +void CallbackEditCloseIdentify( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitPanel( &DrealEditIdentifyPanel ); + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDisplayIdentifyMessage | +| | +\------------------------------------------------------------*/ + +void DrealDisplayIdentifyMessage( Message ) + + char *Message; +{ + rdsbegin(); + + XmTextSetString( DrealEditIdentifyButton[0].BUTTON, Message ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Select | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackEditSelectList | +| | +\------------------------------------------------------------*/ + +void CallbackEditSelectList( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmListCallbackStruct *CallData; +{ + rdsbegin(); + + if ( ClientData == (caddr_t)NULL ) + { + CallbackEditSelectAccept( MyWidget, (caddr_t)NULL, (caddr_t)NULL ); + } + else + { + DrealEditSelectRectangle( CallData->item_position - 1 ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditSelectAccept | +| | +\------------------------------------------------------------*/ + +void CallbackEditSelectAccept( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitPanel( &DrealEditSelectPanel ); + + DrealExitDialog(); + + DrealEditSelectAccept(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditSelectCancel | +| | +\------------------------------------------------------------*/ + +void CallbackEditSelectCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitPanel( &DrealEditSelectPanel ); + + DrealExitDialog(); + + DrealEditSelectCancel(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDisplaySelectList | +| | +\------------------------------------------------------------*/ + +void DrealDisplaySelectList( Message ) + + char *Message; +{ + XmString Label; + + rdsbegin(); + + if ( Message == (char *)NULL ) + { + XmListDeleteAllItems( DrealEditSelectButton[ 0 ].BUTTON ); + } + else + { + Label = XmStringCreateSimple( Message ); + XmListAddItem( DrealEditSelectButton[ 0 ].BUTTON , Label , 0 ); + XmStringFree( Label ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Modify Rectangle | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackModifyRectangleLayer | +| | +\------------------------------------------------------------*/ + +void CallbackModifyRectangleLayer( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealRectangleMLayer = (int)ClientData; + + DrealPromptModifyRectangle(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackModifyRectangleName | +| | +\------------------------------------------------------------*/ + +void CallbackModifyRectangleName( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterDialog( &DrealModifyRectangleNameDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackModifyRectangleApply | +| | +\------------------------------------------------------------*/ + +void CallbackModifyRectangleApply( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealModifyLock = DREAL_FALSE; + DrealModifyAbort = DREAL_FALSE; + DrealModifyApply = DREAL_TRUE; + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackModifyRectangleCancel | +| | +\------------------------------------------------------------*/ + +void CallbackModifyRectangleCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealModifyLock = DREAL_FALSE; + DrealModifyAbort = DREAL_TRUE; + DrealModifyApply = DREAL_FALSE; + + DrealExitDialog(); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GME_panel.h b/alliance/src/dreal/src/GME_panel.h new file mode 100644 index 00000000..fe92b69e --- /dev/null +++ b/alliance/src/dreal/src/GME_panel.h @@ -0,0 +1,121 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_EDIT_PANEL +# define DREAL_EDIT_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_WINDOW_GLOBAL_X 690 +# define DREAL_WINDOW_GLOBAL_Y 205 + +# define DREAL_EDIT_GLOBAL_X 890 +# define DREAL_EDIT_GLOBAL_Y 205 + +# define DREAL_EDIT_SEARCH_X 890 +# define DREAL_EDIT_SEARCH_Y 450 +# define DREAL_EDIT_VIEW_SEARCH_X 790 +# define DREAL_EDIT_VIEW_SEARCH_Y 450 + +# define DREAL_EDIT_SELECT_X 330 +# define DREAL_EDIT_SELECT_Y 280 + +# define DREAL_EDIT_IDENTIFY_X 330 +# define DREAL_EDIT_IDENTIFY_Y 280 + +# define DREAL_MODIFY_RECTANGLE_X 790 +# define DREAL_MODIFY_RECTANGLE_Y 330 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackEditGlobalUndo(); + extern void CallbackEditGlobalRedo(); + extern void CallbackEditGlobalCopy(); + extern void CallbackEditGlobalMove(); + extern void CallbackEditGlobalDelete(); + extern void CallbackEditGlobalStretch(); + extern void CallbackEditGlobalModify(); + extern void CallbackEditGlobalIdentify(); + extern void CallbackEditCloseGlobal(); + + extern void CallbackEditSearchRectangle(); + extern void CallbackEditCloseSearch(); + + extern void CallbackEditCloseIdentify(); + + extern void CallbackEditSelectList(); + extern void CallbackEditSelectAccept(); + extern void CallbackEditSelectCancel(); + + extern void CallbackEditSearchViewContinue(); + extern void CallbackEditSearchViewAbort(); + + extern void CallbackModifyRectangleLayer(); + extern void CallbackModifyRectangleName(); + extern void CallbackModifyRectangleApply(); + extern void CallbackModifyRectangleCancel(); + + extern void DrealDisplayIdentifyMessage(); + extern void DrealDisplaySelectList(); + +# endif diff --git a/alliance/src/dreal/src/GME_search.c b/alliance/src/dreal/src/GME_search.c new file mode 100644 index 00000000..cb83a940 --- /dev/null +++ b/alliance/src/dreal/src/GME_search.c @@ -0,0 +1,221 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Search.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GSB.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GMV.h" +# include "GME.h" + +# include "GME_search.h" +# include "GME_panel.h" +# include "GME_edit.h" +# include "GME_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + char DrealSearchAbort; + int DrealSearchNumber; + char *DrealSearchString; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealEditInitializeSearch | +| | +\------------------------------------------------------------*/ + +void DrealEditInitializeSearch( Name ) + + char *Name; +{ + char *Star; + + rdsbegin(); + + Star = strrchr( Name, '*' ); + + if ( Star != (char *)NULL ) + { + DrealSearchNumber = (int)(Star - Name); + } + else + { + DrealSearchNumber = 0; + } + + DrealSearchString = Name; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSearchCompare | +| | +\------------------------------------------------------------*/ + +int DrealEditSearchCompare( Name ) + + char *Name; +{ + if ( Name != (char *)NULL ) + { + if ( DrealSearchNumber ) + { + return( ! strncmp( DrealSearchString, Name, DrealSearchNumber ) ); + } + else + { + return( Name == DrealSearchString ); + } + } + + return( 0 ); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSearchRectangle | +| | +\------------------------------------------------------------*/ + +void DrealEditSearchRectangle( RectangleName ) + + char *RectangleName; +{ + drealsearch *Search; + rdsins_list *Instance; + rdsfig_list *Figure; + rdsrec_list *Rec; + char Layer; + long X1; + long Y1; + + if ( DrealFigureRds == (rdsfig_list *)NULL ) return; + + rdsbegin(); + + DrealEditInitializeSearch( RectangleName ); + + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + for ( Rec = DrealFigureRds->LAYERTAB[ Layer ]; + Rec != (rdsrec_list *)NULL; + Rec = Rec->NEXT ) + { + if ( ( ! IsDrealDeleted( Rec ) ) && + ( DrealEditSearchCompare( Rec->NAME ) ) ) + { + DrealAddSearch( Rec ); + } + } + } + + if ( DrealHeadSearch == (drealsearch *)NULL ) + { + DrealWarningMessage( DrealMainWindow, "No rectangle found !" ); + } + else + { + for ( Search = DrealHeadSearch; + Search != (drealsearch *)NULL; + Search = Search->NEXT ) + { + Rec = Search->RECTANGLE; + + X1 = ( Rec->X + ( Rec->DX >> 1 ) ) / RDS_PHYSICAL_GRID; + Y1 = ( Rec->Y + ( Rec->DY >> 1 ) ) / RDS_PHYSICAL_GRID; + + DrealZoomCenter( X1, Y1 ); + + if ( Search->NEXT != (drealsearch *)NULL ) + { + DrealSearchAbort = DREAL_FALSE; + + DrealEnterPanel( &DrealEditSearchViewPanel ); + DrealLimitedLoop( DrealEditSearchViewPanel.PANEL ); + + if ( DrealSearchAbort ) break; + } + } + + DrealDelSearch(); + + DrealExitPanel( &DrealEditSearchViewPanel ); + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GME_search.h b/alliance/src/dreal/src/GME_search.h new file mode 100644 index 00000000..04457ed2 --- /dev/null +++ b/alliance/src/dreal/src/GME_search.h @@ -0,0 +1,69 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Search.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_SEARCH +# define DREAL_SEARCH + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char DrealSearchAbort; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealEditSearchRectangle(); + +# endif diff --git a/alliance/src/dreal/src/GME_select.c b/alliance/src/dreal/src/GME_select.c new file mode 100644 index 00000000..240cb313 --- /dev/null +++ b/alliance/src/dreal/src/GME_select.c @@ -0,0 +1,1161 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Select.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GME.h" +# include "GMT.h" + +# include "GME_select.h" +# include "GME_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Select Buffer | +| | +\------------------------------------------------------------*/ + + static char DrealSelectBuffer [ DREAL_SELECT_BUFFER_SIZE ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealAddSelectList | +| | +\------------------------------------------------------------*/ + +void DrealAddSelectList( Rectangle ) + + rdsrec_list *Rectangle; +{ + char StaticLayer; + + rdsbegin(); + + DrealSelectBuffer[0] = '\0'; + + if ( IsRdsInstance( Rectangle ) ) + { + sprintf( DrealSelectBuffer, + " INSTANCE %s : %s", Rectangle->NAME ); + } + else + if ( IsRdsFigure( Rectangle ) ) + { + sprintf( DrealSelectBuffer, + " ABUTMENT BOX : %s", Rectangle->NAME ); + } + else + { + StaticLayer = RDS_STATIC_LAYER[ GetRdsLayer( Rectangle ) ]; + + sprintf( DrealSelectBuffer, + " RECTANGLE %s : %s", + ( Rectangle->NAME != (char *)NULL ) ? Rectangle->NAME : "None", + DREAL_RDS_LAYER_NAME_TABLE[ StaticLayer ][0] ); + } + + DrealDisplaySelectList( DrealSelectBuffer ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectRectangle | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectRectangle( Number ) + + int Number; +{ + int Counter; + drealselect *Select; + + rdsbegin(); + + Select = DrealHeadSelect; + + for ( Counter = 0; Counter < Number; Counter++ ) + { + Select = Select->NEXT; + } + + if ( IsDrealAccepted( Select->RECTANGLE ) ) + { + DrealRejectRectangle( Select->RECTANGLE ); + } + else + { + DrealAcceptRectangle( Select->RECTANGLE ); + } + + DrealDisplayRectangle( Select->RECTANGLE ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectAccept | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectAccept() +{ + rdsbegin(); + + DrealPurgeSelect(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectCancel | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectCancel() +{ + rdsbegin(); + + DrealEditUnselectAll(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Select Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealEditUnselectAll | +| | +\------------------------------------------------------------*/ + +void DrealEditUnselectAll() +{ + rdsrec_list *Rectangle; + + rdsbegin(); + + if ( DrealHeadSelect != (drealselect *)NULL ) + { + if ( DrealHeadSelect->NEXT == (drealselect *)NULL ) + { + Rectangle = DrealHeadSelect->RECTANGLE; + DrealDelSelect(); + DrealDisplayRectangle( Rectangle ); + } + else + { + DrealDelSelect(); + DrealZoomRefresh(); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectPoint | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectPoint( LambdaX1, LambdaY1 ) + + long LambdaX1; + long LambdaY1; +{ + long Offset; + drealwin *ScanWin; + drealwinrec *ScanWinRec; + rdsrec_list *Rec; + drealselect *Select; + char ScanRec; + char Layer; + char StaticLayer; + long X; + long Y; + + rdsbegin(); + + if ( DrealFigureRds != (rdsfig_list *)NULL ) + { + LambdaX1 = LambdaX1 * RDS_PHYSICAL_GRID; + LambdaY1 = LambdaY1 * RDS_PHYSICAL_GRID; + + X = ( LambdaX1 - DrealWindowXmin ) / DrealWindowSide; + Y = ( LambdaY1 - DrealWindowYmin ) / DrealWindowSide; + + if ( X < 0 ) X = 0; + if ( X > DrealWindowDx ) X = DrealWindowDx - 1; + if ( Y < 0 ) Y = 0; + if ( Y > DrealWindowDy ) Y = DrealWindowDy - 1; + + Offset = Y * DrealWindowDx + X; + + ScanWin = &DrealWindowTable[ Offset ]; + + if ( ScanWin->LAYERTAB != (drealwinrec **)NULL ) + { + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + StaticLayer = RDS_STATIC_LAYER[ Layer ]; + + if ( DREAL_RDS_ACTIVE_LAYER_TABLE[ StaticLayer ] != 1 ) continue; + + for ( ScanWinRec = ScanWin->LAYERTAB[ Layer ]; + ScanWinRec != (drealwinrec *)NULL; + ScanWinRec = ScanWinRec->NEXT ) + { + for ( ScanRec = 0; ScanRec < DREAL_MAX_REC ; ScanRec++ ) + { + Rec = ScanWinRec->RECTAB[ ScanRec ]; + + if ( ( Rec != (rdsrec_list *)NULL ) && + ( ! IsDrealDeleted( Rec ) ) && + ( ! IsDrealSelected( Rec ) ) && + ( Rec->X <= LambdaX1 ) && + ( Rec->Y <= LambdaY1 ) && + ( ( Rec->X + Rec->DX ) >= LambdaX1 ) && + ( ( Rec->Y + Rec->DY ) >= LambdaY1 ) ) + { + if ( IsRdsFigRec( Rec ) ) + { + if ( Layer == RDS_ABOX ) + { + if ( ( Rec->X == LambdaX1 ) || + ( ( Rec->X + Rec->DX ) == LambdaX1 ) ) + { + if ( ( LambdaY1 < Rec->Y ) || + ( LambdaY1 > ( Rec->Y + Rec->DY ) ) ) + + continue; + } + else + if ( ( Rec->Y == LambdaY1 ) || + ( ( Rec->Y + Rec->DY ) == LambdaY1 ) ) + { + if ( ( LambdaX1 < Rec->X ) || + ( LambdaX1 > ( Rec->X + Rec->DX ) ) ) + + continue; + } + else continue; + } + + DrealAddSelect( Rec ); + } + else + { + if ( Layer == RDS_ABOX ) + { + DrealAddSelect( Rec ); + } + } + } + } + } + } + } + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + DrealUnselectRectangle( Select->RECTANGLE ); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectWindow | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectWindow( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; +{ + long Offset; + drealwin *ScanWin; + drealwinrec *ScanWinRec; + rdsrec_list *Rec; + drealselect *Select; + char ScanRec; + char Layer; + char StaticLayer; + long Xmin; + long Ymin; + long Xmax; + long Ymax; + long X; + long Y; + long Swap; + + rdsbegin(); + + if ( ( LambdaX1 != LambdaX2 ) && + ( LambdaY1 != LambdaY2 ) ) + { + if ( LambdaX1 > LambdaX2 ) + { + Swap = LambdaX1; LambdaX1 = LambdaX2; LambdaX2 = Swap; + } + + if ( LambdaY1 > LambdaY2 ) + { + Swap = LambdaY1; LambdaY1 = LambdaY2; LambdaY2 = Swap; + } + } + + if ( DrealFigureRds != (rdsfig_list *)NULL ) + { + LambdaX1 = LambdaX1 * RDS_PHYSICAL_GRID; + LambdaX2 = LambdaX2 * RDS_PHYSICAL_GRID; + LambdaY1 = LambdaY1 * RDS_PHYSICAL_GRID; + LambdaY2 = LambdaY2 * RDS_PHYSICAL_GRID; + + Xmin = ( LambdaX1 - DrealWindowXmin ) / DrealWindowSide; + Xmax = ( LambdaX2 - DrealWindowXmin ) / DrealWindowSide; + Ymin = ( LambdaY1 - DrealWindowYmin ) / DrealWindowSide; + Ymax = ( LambdaY2 - DrealWindowYmin ) / DrealWindowSide; + + if ( Xmin < 0 ) Xmin = 0; + if ( Xmin > DrealWindowDx ) Xmin = DrealWindowDx - 1; + if ( Ymin < 0 ) Ymin = 0; + if ( Ymin > DrealWindowDy ) Ymin = DrealWindowDy - 1; + + if ( Xmax < 0 ) Xmax = 0; + if ( Xmax > DrealWindowDx ) Xmax = DrealWindowDx - 1; + if ( Ymax < 0 ) Ymax = 0; + if ( Ymax > DrealWindowDy ) Ymax = DrealWindowDy - 1; + + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + StaticLayer = RDS_STATIC_LAYER[ Layer ]; + + if ( DREAL_RDS_ACTIVE_LAYER_TABLE[ StaticLayer ] != 1 ) continue; + + Y = Ymin; + + while ( Y <= Ymax ) + { + X = Xmin; + + while ( X <= Xmax ) + { + Offset = ( Y * DrealWindowDx ) + X; + + ScanWin = &DrealWindowTable[ Offset ]; + + if ( ScanWin->LAYERTAB != (drealwinrec **)NULL ) + { + for ( ScanWinRec = ScanWin->LAYERTAB[ Layer ]; + ScanWinRec != (drealwinrec *)NULL; + ScanWinRec = ScanWinRec->NEXT ) + { + for ( ScanRec = 0; ScanRec < DREAL_MAX_REC ; ScanRec++ ) + { + Rec = ScanWinRec->RECTAB[ ScanRec ]; + + if ( ( Rec != (rdsrec_list *)NULL ) && + ( ! IsDrealDeleted( Rec ) ) && + ( ! IsDrealAccepted( Rec ) ) && + ( ! IsDrealSelected( Rec ) ) && + ( Rec->X >= LambdaX1 ) && + ( Rec->Y >= LambdaY1 ) && + ( ( Rec->X + Rec->DX ) <= LambdaX2 ) && + ( ( Rec->Y + Rec->DY ) <= LambdaY2 ) ) + { + if ( ( IsRdsFigRec( Rec ) ) || + ( IsRdsInstance( Rec ) ) ) + { + DrealAddSelect( Rec ); + } + } + } + } + } + + X = X + 1; + } + + Y = Y + 1; + } + } + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + DrealUnselectRectangle( Select->RECTANGLE ); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectFence | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectFence( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; +{ + long Offset; + drealwin *ScanWin; + drealwinrec *ScanWinRec; + rdsrec_list *Rec; + drealselect *Select; + char ScanRec; + char Layer; + char StaticLayer; + long Xmin; + long Ymin; + long Xmax; + long Ymax; + long X; + long Y; + long Swap; + + rdsbegin(); + + if ( ( LambdaX1 != LambdaX2 ) && + ( LambdaY1 != LambdaY2 ) ) + { + if ( LambdaX1 > LambdaX2 ) + { + Swap = LambdaX1; LambdaX1 = LambdaX2; LambdaX2 = Swap; + } + + if ( LambdaY1 > LambdaY2 ) + { + Swap = LambdaY1; LambdaY1 = LambdaY2; LambdaY2 = Swap; + } + } + + if ( DrealFigureRds != (rdsfig_list *)NULL ) + { + LambdaX1 = LambdaX1 * RDS_PHYSICAL_GRID; + LambdaX2 = LambdaX2 * RDS_PHYSICAL_GRID; + LambdaY1 = LambdaY1 * RDS_PHYSICAL_GRID; + LambdaY2 = LambdaY2 * RDS_PHYSICAL_GRID; + + Xmin = ( LambdaX1 - DrealWindowXmin ) / DrealWindowSide; + Xmax = ( LambdaX2 - DrealWindowXmin ) / DrealWindowSide; + Ymin = ( LambdaY1 - DrealWindowYmin ) / DrealWindowSide; + Ymax = ( LambdaY2 - DrealWindowYmin ) / DrealWindowSide; + + if ( Xmin < 0 ) Xmin = 0; + if ( Xmin > DrealWindowDx ) Xmin = DrealWindowDx - 1; + if ( Ymin < 0 ) Ymin = 0; + if ( Ymin > DrealWindowDy ) Ymin = DrealWindowDy - 1; + + if ( Xmax < 0 ) Xmax = 0; + if ( Xmax > DrealWindowDx ) Xmax = DrealWindowDx - 1; + if ( Ymax < 0 ) Ymax = 0; + if ( Ymax > DrealWindowDy ) Ymax = DrealWindowDy - 1; + + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + StaticLayer = RDS_STATIC_LAYER[ Layer ]; + + if ( DREAL_RDS_ACTIVE_LAYER_TABLE[ StaticLayer ] != 1 ) continue; + + Y = Ymin; + + while ( Y <= Ymax ) + { + X = Xmin; + + while ( X <= Xmax ) + { + Offset = ( Y * DrealWindowDx ) + X; + + ScanWin = &DrealWindowTable[ Offset ]; + + if ( ScanWin->LAYERTAB != (drealwinrec **)NULL ) + { + for ( ScanWinRec = ScanWin->LAYERTAB[ Layer ]; + ScanWinRec != (drealwinrec *)NULL; + ScanWinRec = ScanWinRec->NEXT ) + { + for ( ScanRec = 0; ScanRec < DREAL_MAX_REC ; ScanRec++ ) + { + Rec = ScanWinRec->RECTAB[ ScanRec ]; + + if ( ( Rec != (rdsrec_list *)NULL ) && + ( ! IsDrealDeleted( Rec ) ) && + ( ! IsDrealAccepted( Rec ) ) && + ( ! IsDrealSelected( Rec ) ) && + ( ( Rec->X + Rec->DX ) >= LambdaX1 ) && + ( ( Rec->Y + Rec->DY ) >= LambdaY1 ) && + ( ( Rec->X ) <= LambdaX2 ) && + ( ( Rec->Y ) <= LambdaY2 ) ) + { + if ( ( IsRdsFigRec( Rec ) ) || + ( IsRdsInstance( Rec ) ) ) + { + DrealAddSelect( Rec ); + } + } + } + } + } + + X = X + 1; + } + + Y = Y + 1; + } + } + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + DrealUnselectRectangle( Select->RECTANGLE ); + } + } + + rdsend(); +} + + +/*------------------------------------------------------------\ +| | +| DrealEditSelectPointCopy | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectPointCopy( LambdaX1, LambdaY1 ) + + long LambdaX1; + long LambdaY1; +{ + drealselect *Select; + drealselect *DelSelect; + drealselect **Previous; + + rdsbegin(); + + DrealEditSelectPoint( LambdaX1, LambdaY1 ); + + DrealDisplaySelectList( (char *)NULL ); + + Previous = &DrealHeadSelect; + Select = DrealHeadSelect; + + while ( Select != (drealselect *)NULL ) + { + if ( IsRdsFigure( Select->RECTANGLE ) || + IsRdsInstance( Select->RECTANGLE ) ) + { + DelSelect = Select; + Select = Select->NEXT; + *Previous = Select; + + DrealFreeSelect( DelSelect ); + } + else + { + DrealAddSelectList( Select->RECTANGLE ); + + Previous = &Select->NEXT; + Select = Select->NEXT; + } + } + + if ( DrealHeadSelect == (drealselect *)NULL ) + { + DrealWarningMessage( DrealMainWindow, "No element found !" ); + } + else + { + if ( DrealHeadSelect->NEXT != (drealselect *)NULL ) + { + DrealEnterPanel( &DrealEditSelectPanel ); + DrealLimitedLoop( DrealEditSelectPanel.PANEL ); + } + else + { + DrealAcceptRectangle( DrealHeadSelect->RECTANGLE ); + DrealDisplayRectangle( DrealHeadSelect->RECTANGLE ); + } + + if ( DrealHeadSelect != (drealselect *)NULL ) + { + DrealContinueEditMode( DREAL_EDIT_COPY_POINT, + DrealPromptEditCopy, 1 ); + } + else + { + DrealChangeEditMode( DREAL_SELECT_POINT_COPY, + DrealPromptSelectPointCopy ); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectWindowCopy | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectWindowCopy( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; +{ + drealselect *Select; + drealselect *DelSelect; + drealselect **Previous; + + rdsbegin(); + + DrealEditSelectWindow( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ); + + Previous = &DrealHeadSelect; + Select = DrealHeadSelect; + + while ( Select != (drealselect *)NULL ) + { + if ( IsRdsFigure( Select->RECTANGLE ) || + IsRdsInstance( Select->RECTANGLE ) ) + { + DelSelect = Select; + Select = Select->NEXT; + *Previous = Select; + + DrealFreeSelect( DelSelect ); + } + else + { + DrealAcceptRectangle( Select->RECTANGLE ); + + Previous = &Select->NEXT; + Select = Select->NEXT; + } + } + + if ( DrealHeadSelect == (drealselect *)NULL ) + { + DrealWarningMessage( DrealMainWindow, "No element found !" ); + + DrealChangeEditMode( DREAL_SELECT_WINDOW_COPY, + DrealPromptSelectWindowCopy ); + } + else + { + if ( DrealHeadSelect->NEXT == (drealselect *)NULL ) + { + DrealDisplayRectangle( DrealHeadSelect->RECTANGLE ); + } + else + { + DrealZoomRefresh(); + } + + DrealContinueEditMode( DREAL_EDIT_COPY_WINDOW, + DrealPromptEditCopy, 0 ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectPointMove | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectPointMove( LambdaX1, LambdaY1 ) + + long LambdaX1; + long LambdaY1; +{ + drealselect *Select; + + rdsbegin(); + + DrealEditSelectPoint( LambdaX1, LambdaY1 ); + + DrealDisplaySelectList( (char *)NULL ); + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + DrealAddSelectList( Select->RECTANGLE ); + } + + if ( DrealHeadSelect == (drealselect *)NULL ) + { + DrealWarningMessage( DrealMainWindow, "No element found !" ); + } + else + { + if ( DrealHeadSelect->NEXT != (drealselect *)NULL ) + { + DrealEnterPanel( &DrealEditSelectPanel ); + DrealLimitedLoop( DrealEditSelectPanel.PANEL ); + } + else + { + DrealAcceptRectangle( DrealHeadSelect->RECTANGLE ); + DrealDisplayRectangle( DrealHeadSelect->RECTANGLE ); + } + + if ( DrealHeadSelect != (drealselect *)NULL ) + { + DrealContinueEditMode( DREAL_EDIT_MOVE_POINT, + DrealPromptEditMove, 1 ); + } + else + { + DrealChangeEditMode( DREAL_SELECT_POINT_MOVE, + DrealPromptSelectPointMove ); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectWindowMove | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectWindowMove( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; +{ + drealselect *Select; + + rdsbegin(); + + DrealEditSelectWindow( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ); + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + DrealAcceptRectangle( Select->RECTANGLE ); + } + + if ( DrealHeadSelect == (drealselect *)NULL ) + { + DrealWarningMessage( DrealMainWindow, "No element found !" ); + + DrealChangeEditMode( DREAL_SELECT_WINDOW_MOVE, + DrealPromptSelectWindowMove ); + } + else + { + if ( DrealHeadSelect->NEXT == (drealselect *)NULL ) + { + DrealDisplayRectangle( DrealHeadSelect->RECTANGLE ); + } + else + { + DrealZoomRefresh(); + } + + DrealContinueEditMode( DREAL_EDIT_MOVE_WINDOW, + DrealPromptEditMove, 0 ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectPointDelete | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectPointDelete( LambdaX1, LambdaY1 ) + + long LambdaX1; + long LambdaY1; +{ + drealselect *Select; + + rdsbegin(); + + DrealEditSelectPoint( LambdaX1, LambdaY1 ); + + DrealDisplaySelectList( (char *)NULL ); + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + DrealAddSelectList( Select->RECTANGLE ); + } + + if ( DrealHeadSelect == (drealselect *)NULL ) + { + DrealWarningMessage( DrealMainWindow, "No element found !" ); + } + else + { + if ( DrealHeadSelect->NEXT != (drealselect *)NULL ) + { + DrealEnterPanel( &DrealEditSelectPanel ); + DrealLimitedLoop( DrealEditSelectPanel.PANEL ); + } + else + { + DrealAcceptRectangle( DrealHeadSelect->RECTANGLE ); + DrealDisplayRectangle( DrealHeadSelect->RECTANGLE ); + } + + if ( DrealHeadSelect != (drealselect *)NULL ) + { + DrealEditDelete(); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectWindowDelete | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectWindowDelete( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; +{ + drealselect *Select; + + rdsbegin(); + + DrealEditSelectWindow( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ); + + for ( Select = DrealHeadSelect; + Select != (drealselect *)NULL; + Select = Select->NEXT ) + { + DrealAcceptRectangle( Select->RECTANGLE ); + } + + if ( DrealHeadSelect == (drealselect *)NULL ) + { + DrealWarningMessage( DrealMainWindow, "No element found !" ); + } + else + { + if ( DrealHeadSelect->NEXT == (drealselect *)NULL ) + { + DrealDisplayRectangle( DrealHeadSelect->RECTANGLE ); + } + else + { + DrealZoomRefresh(); + } + + DrealEditDelete(); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectPointStretch | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectPointStretch( LambdaX1, LambdaY1 ) + + long LambdaX1; + long LambdaY1; +{ + drealselect *Select; + drealselect *DelSelect; + drealselect **Previous; + + rdsbegin(); + + DrealEditSelectPoint( LambdaX1, LambdaY1 ); + + DrealDisplaySelectList( (char *)NULL ); + + Previous = &DrealHeadSelect; + Select = DrealHeadSelect; + + while ( Select != (drealselect *)NULL ) + { + if ( IsRdsFigRec( Select->RECTANGLE ) ) + { + DrealAddSelectList( Select->RECTANGLE ); + + Previous = &Select->NEXT; + Select = Select->NEXT; + } + else + { + DelSelect = Select; + Select = Select->NEXT; + *Previous = Select; + + DrealFreeSelect( DelSelect ); + } + } + + if ( DrealHeadSelect == (drealselect *)NULL ) + { + DrealWarningMessage( DrealMainWindow, "No element found !" ); + } + else + { + if ( DrealHeadSelect->NEXT != (drealselect *)NULL ) + { + DrealEnterPanel( &DrealEditSelectPanel ); + DrealLimitedLoop( DrealEditSelectPanel.PANEL ); + } + else + { + DrealAcceptRectangle( DrealHeadSelect->RECTANGLE ); + DrealDisplayRectangle( DrealHeadSelect->RECTANGLE ); + } + + if ( DrealHeadSelect != (drealselect *)NULL ) + { + DrealContinueEditMode( DREAL_EDIT_STRETCH_POINT, + DrealPromptEditStretch, 1 ); + } + else + { + DrealChangeEditMode( DREAL_SELECT_POINT_STRETCH, + DrealPromptSelectPointStretch ); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectPointModify | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectPointModify( LambdaX1, LambdaY1 ) + + long LambdaX1; + long LambdaY1; +{ + drealselect *Select; + drealselect *DelSelect; + drealselect **Previous; + + rdsbegin(); + + DrealEditSelectPoint( LambdaX1, LambdaY1 ); + + DrealDisplaySelectList( (char *)NULL ); + + Previous = &DrealHeadSelect; + Select = DrealHeadSelect; + + while ( Select != (drealselect *)NULL ) + { + if ( ! IsRdsFigure( Select->RECTANGLE ) ) + { + DrealAddSelectList( Select->RECTANGLE ); + + Previous = &Select->NEXT; + Select = Select->NEXT; + } + else + { + DelSelect = Select; + Select = Select->NEXT; + *Previous = Select; + + DrealFreeSelect( DelSelect ); + } + } + + if ( DrealHeadSelect == (drealselect *)NULL ) + { + DrealWarningMessage( DrealMainWindow, "No element found !" ); + } + else + { + if ( DrealHeadSelect->NEXT != (drealselect *)NULL ) + { + DrealEnterPanel( &DrealEditSelectPanel ); + DrealLimitedLoop( DrealEditSelectPanel.PANEL ); + } + + if ( DrealHeadSelect != (drealselect *)NULL ) + { + DrealEditModify(); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEditSelectWindowModify | +| | +\------------------------------------------------------------*/ + +void DrealEditSelectWindowModify( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; +{ + drealselect *Select; + drealselect *DelSelect; + drealselect **Previous; + + rdsbegin(); + + DrealEditSelectWindow( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ); + + Previous = &DrealHeadSelect; + Select = DrealHeadSelect; + + while ( Select != (drealselect *)NULL ) + { + if ( ! IsRdsFigure( Select->RECTANGLE ) ) + { + Previous = &Select->NEXT; + Select = Select->NEXT; + } + else + { + DelSelect = Select; + Select = Select->NEXT; + *Previous = Select; + + DrealFreeSelect( DelSelect ); + } + } + + if ( DrealHeadSelect == (drealselect *)NULL ) + { + DrealWarningMessage( DrealMainWindow, "No element found !" ); + } + else + { + DrealEditModify(); + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GME_select.h b/alliance/src/dreal/src/GME_select.h new file mode 100644 index 00000000..35560447 --- /dev/null +++ b/alliance/src/dreal/src/GME_select.h @@ -0,0 +1,69 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Select.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_SELECT +# define DREAL_SELECT + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_SELECT_BUFFER_SIZE 256 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealEditSelectRectangle(); + +# endif diff --git a/alliance/src/dreal/src/GMF.h b/alliance/src/dreal/src/GMF.h new file mode 100644 index 00000000..42b962a1 --- /dev/null +++ b/alliance/src/dreal/src/GMF.h @@ -0,0 +1,77 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : gmf101.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GMF +# define DREAL_GMF + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern DrealMenuItem DrealFileMenu []; + extern char *DREAL_WORK_LIB; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealBuildFileDialog(); + extern void DrealBuildPanelLibrary(); + +# endif diff --git a/alliance/src/dreal/src/GMF_dialog.c b/alliance/src/dreal/src/GMF_dialog.c new file mode 100644 index 00000000..acccf3f9 --- /dev/null +++ b/alliance/src/dreal/src/GMF_dialog.c @@ -0,0 +1,315 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMF.h" + +# include "GMF_dialog.h" +# include "GMF_file.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| File Dialog | +| | +\------------------------------------------------------------*/ + + DrealDialogItem DrealFileOpenDialog = + + { + "Open File", + DREAL_DIALOG_FILE, + (Widget)NULL, + (void *)CallbackFileOpenOk, + (XtPointer)NULL, + (void *)CallbackFileOpenCancel, + (XtPointer)NULL + }; + + DrealDialogItem DrealFileQuitDialog = + + { + "Do you really want to quit Dreal ?", + DREAL_DIALOG_WARNING, + (Widget)NULL, + (void *)CallbackFileQuitOk, + (XtPointer)NULL, + (void *)CallbackFileQuitCancel, + (XtPointer)NULL + }; + + DrealDialogItem DrealFileSaveAsDialog = + + { + "Save As", + DREAL_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackFileSaveAsOk, + (XtPointer)NULL, + (void *)CallbackFileSaveAsCancel, + (XtPointer)NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealBuildFileDialog | +| | +\------------------------------------------------------------*/ + +void DrealBuildFileDialog() + +{ + rdsbegin(); + + DrealBuildDialog( DrealMainWindow, &DrealFileSaveAsDialog ); + DrealBuildDialog( DrealMainWindow, &DrealFileOpenDialog ); + DrealBuildDialog( DrealMainWindow, &DrealFileQuitDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileQuitOk | +| | +\------------------------------------------------------------*/ + +void CallbackFileQuitOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitDialog(); + + if ( DrealHeadUndo != (drealundo *)NULL ) + { + CallbackFileSaveAs( NULL, NULL, NULL ); + DrealHeadUndo = (drealundo *)0; + } + + XtCloseDisplay( XtDisplay( XtParent( MyWidget ) ) ); + + DrealExitErrorMessage( 0 ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileSaveAsOk | +| | +\------------------------------------------------------------*/ + +void CallbackFileSaveAsOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *FileName; + + rdsbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &FileName ); + + FileName = DrealPostTreatString( FileName ); + + XtUnmanageChild( DrealFileSaveAsDialog.WIDGET ); + + DrealExitDialog(); + + DrealFileSaveAs( FileName ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileSaveAsCancel | +| | +\------------------------------------------------------------*/ + +void CallbackFileSaveAsCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + rdsbegin(); + + XtUnmanageChild( DrealFileSaveAsDialog.WIDGET ); + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileQuitCancel | +| | +\------------------------------------------------------------*/ + +void CallbackFileQuitCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileOpenOk | +| | +\------------------------------------------------------------*/ + +void CallbackFileOpenOk( MyWidget, ClientData, FileStruct ) + + Widget MyWidget; + caddr_t ClientData; + XmFileSelectionBoxCallbackStruct *FileStruct; +{ + char *FileName; + + rdsbegin(); + + XtUnmanageChild( DrealFileOpenDialog.WIDGET ); + + DrealExitDialog(); + + if ( FileStruct->value != NULL ) + { + XmStringGetLtoR( FileStruct->value, + XmSTRING_DEFAULT_CHARSET, + &FileName + ); + + FileName = DrealPostTreatString( FileName ); + + if ( FileName != (char *)NULL ) + { + if ( DrealHeadUndo != (drealundo *)NULL ) + { + CallbackFileSaveAs( NULL, NULL, NULL ); + } + + DrealFileOpen( FileName ); + + DrealChangeEditMode( DREAL_EDIT_MEASURE, + DrealPromptEditMeasure ); + } + else + { + DrealErrorMessage( DrealMainWindow, "Unable to load this file !" ); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileOpenCancel | +| | +\------------------------------------------------------------*/ + +void CallbackFileOpenCancel( MyWidget, ClientData, FileStruct ) + + Widget MyWidget; + caddr_t ClientData; + XmFileSelectionBoxCallbackStruct *FileStruct; +{ + rdsbegin(); + + XtUnmanageChild( DrealFileOpenDialog.WIDGET ); + + DrealExitDialog(); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMF_dialog.h b/alliance/src/dreal/src/GMF_dialog.h new file mode 100644 index 00000000..3b422ad7 --- /dev/null +++ b/alliance/src/dreal/src/GMF_dialog.h @@ -0,0 +1,82 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_FILE_DIALOG +# define DREAL_FILE_DIALOG + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern DrealDialogItem DrealFileOpenDialog; + extern DrealDialogItem DrealFileQuitDialog; + extern DrealDialogItem DrealFileSaveAsDialog; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackFileQuitOk(); + extern void CallbackFileQuitCancel(); + extern void CallbackFileOpenOk(); + extern void CallbackFileOpenCancel(); + extern void CallbackFileSaveAsOk(); + extern void CallbackFileSaveAsCancel(); + +# endif diff --git a/alliance/src/dreal/src/GMF_file.c b/alliance/src/dreal/src/GMF_file.c new file mode 100644 index 00000000..ffee9664 --- /dev/null +++ b/alliance/src/dreal/src/GMF_file.c @@ -0,0 +1,319 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : File.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMF.h" + +# include "GMF_file.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + char DrealFileFilter[ 10 ] = "*."; + char DrealFileExtention[ 10 ] = "."; + + char DrealFileBuffer[ 128 ]; + char DrealDirectoryBuffer[ 512 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealFileNew | +| | +\------------------------------------------------------------*/ + +void DrealFileNew() +{ + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + if ( DrealFigureRds != (rdsfig_list *)NULL ) + { + DrealDelSelect(); + DrealDelFigure(); + } + + DrealChangeTopLevelTitle( (char *)NULL ); + + DrealRecomputeBound = DREAL_TRUE; + + DrealInitializeZoom(); + DrealInitializeUndo(); + DrealClearGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + + DrealRefreshGraphicWindow( 0, 0, + DrealGraphicDx, DrealGraphicDy ); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealFileSave | +| | +\------------------------------------------------------------*/ + +void DrealFileSave() +{ + char Ok; + + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + Ok = DrealSaveFigure(); + + DrealDisplayToolsMessage(); + + if ( ! Ok ) + { + DrealErrorMessage( DrealMainWindow, "Unable to save this figure !" ); + } + + DrealInitializeUndo(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealFileSaveAs | +| | +\------------------------------------------------------------*/ + +void DrealFileSaveAs( FileName ) + + char *FileName; +{ + rdsins_list *InstanceRds; + rdsrec_list *Rectangle; + char Ok; + + rdsbegin(); + + if ( FileName == (char *)NULL ) + { + FileName = DrealFigureRds->NAME; + } + else + { + FileName = namealloc( FileName ); + } + + for ( InstanceRds = DrealFigureRds->INSTANCE; + InstanceRds != (rdsins_list *)NULL; + InstanceRds = InstanceRds->NEXT ) + { + if ( InstanceRds->FIGNAME == FileName ) break; + } + + if ( InstanceRds != (rdsins_list *)NULL ) + { + DrealErrorMessage( DrealMainWindow, + "A figure cannot be part of itself !" ); + } + else + { + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + DrealFigureRds->NAME = FileName; + + DrealChangeTopLevelTitle( DrealFigureRds->NAME ); + + for ( Rectangle = DrealFigureRds->LAYERTAB[ RDS_ABOX ]; + Rectangle != (rdsrec_list *)0; + Rectangle = Rectangle->NEXT ) + { + Rectangle->NAME = FileName; + } + + Ok = DrealSaveFigure(); + + DrealDisplayToolsMessage(); + + if ( ! Ok ) + { + DrealErrorMessage( DrealMainWindow, "Unable to save this figure !" ); + } + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + } + + DrealInitializeUndo(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealFileOpen | +| | +\------------------------------------------------------------*/ + +void DrealFileOpen( FileName ) + + char *FileName; +{ + char *Directory; + char *File; + int Index; + char *SWAP_WORK_LIB = WORK_LIB; + + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + DrealUndisplayCursor(); + + if ( DrealFigureRds != (rdsfig_list *)NULL ) + { + DrealDelSelect(); + DrealInitializeUndo(); + DrealDelFigure(); + } + + DrealRecomputeBound = DREAL_TRUE; + + if ( DREAL_WORK_LIB == (char *)NULL ) + { + DREAL_WORK_LIB = WORK_LIB; + } + + for ( Index = strlen( FileName ); Index >= 0; Index-- ) + { + if ( FileName[ Index ] == '/' ) break; + } + + if ( Index >= 0 ) + { + strcpy( DrealDirectoryBuffer, FileName ); + strcpy( DrealFileBuffer, FileName + Index + 1); + + DrealDirectoryBuffer[ Index + 1 ] = '\0'; + + WORK_LIB = DrealDirectoryBuffer; + } + else + { + strcpy( DrealFileBuffer, FileName ); + + WORK_LIB = DREAL_WORK_LIB; + } + + Index = strlen( DrealFileBuffer ) - strlen( DrealFileExtention ); + + if ( Index >= 0 ) + { + if ( ! strcmp( DrealFileBuffer + Index, DrealFileExtention ) ) + { + DrealFileBuffer[ Index ] = '\0'; + } + } + + DrealAddFigure( DrealFileBuffer ); + + DrealInitializeUndo(); + + DrealDisplayToolsMessage(); + + if ( DrealFigureRds == (rdsfig_list *)NULL ) + { + DrealErrorMessage( DrealMainWindow, "Unable to open this figure !" ); + DrealChangeTopLevelTitle( (char *)NULL ); + DrealInitializeZoom(); + DrealClearGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + } + else + { + DrealChangeTopLevelTitle( DrealFigureRds->NAME ); + DrealInitializeZoom(); + DrealDisplayFigure( 0, 0, DrealGraphicDx, DrealGraphicDy ); + } + + DrealRefreshGraphicWindow( 0, 0, + DrealGraphicDx, DrealGraphicDy ); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + DrealDisplayCursor(); + + WORK_LIB = SWAP_WORK_LIB; + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMF_file.h b/alliance/src/dreal/src/GMF_file.h new file mode 100644 index 00000000..ad7fcc3f --- /dev/null +++ b/alliance/src/dreal/src/GMF_file.h @@ -0,0 +1,79 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : File.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_FILE +# define DREAL_FILE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char DrealFileFilter[ 10 ]; + extern char DrealFileExtention[ 10 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealFileNew(); + extern void DrealFileSave(); + extern void DrealFileOpen(); + extern void DrealFileSaveAs(); + +# endif diff --git a/alliance/src/dreal/src/GMF_menu.c b/alliance/src/dreal/src/GMF_menu.c new file mode 100644 index 00000000..21fd7606 --- /dev/null +++ b/alliance/src/dreal/src/GMF_menu.c @@ -0,0 +1,328 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rtl.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMF.h" + +# include "GMF_menu.h" +# include "GMF_dialog.h" +# include "GMF_file.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Menu | +| | +\------------------------------------------------------------*/ + + DrealMenuItem DrealFileMenu[] = + + { + { + "New", + 'N', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackFileNew, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Open", + 'O', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackFileOpen, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Save ", + 'S', + "CtrlW", + "Ctrl W", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackFileSave, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Save As", + 'A', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackFileSaveAs, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Quit ", + 'Q', + "CtrlQ", + "Ctrl Q", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackFileQuit, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackFileNew | +| | +\------------------------------------------------------------*/ + +void CallbackFileNew( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( DrealHeadUndo != (drealundo *)NULL ) + { + CallbackFileSaveAs( NULL, NULL, NULL ); + } + + DrealFileNew(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileOpen | +| | +\------------------------------------------------------------*/ + +void CallbackFileOpen( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + XmString Filter; + + rdsbegin(); + + if ( DrealFileFilter[2] == '\0' ) + { + strcat( DrealFileFilter, RDS_IN ); + strcat( DrealFileExtention, RDS_IN ); + + Filter = XmStringCreateSimple( DrealFileFilter ); + + XtVaSetValues( DrealFileOpenDialog.WIDGET, + XmNpattern, Filter, NULL); + + XmStringFree( Filter ); + } + + DrealEnterDialog( &DrealFileOpenDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileSave | +| | +\------------------------------------------------------------*/ + +void CallbackFileSave( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( DrealFigureRds != (rdsfig_list *)NULL ) + { + if ( ( DrealFigureRds->NAME == (char *)NULL ) || + ( ! strcmp( DrealFigureRds->NAME, + DREAL_DEFAULT_FIGURE_NAME ) ) ) + + { + CallbackFileSaveAs( NULL, NULL, NULL ); + } + else + { + DrealFileSave(); + } + } + else + { + DrealErrorMessage( DrealMainWindow, "No current figure !" ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileSaveAs | +| | +\------------------------------------------------------------*/ + +void CallbackFileSaveAs( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + Arg Args; + XmString SaveAsString; + + rdsbegin(); + + if ( DrealFigureRds == (rdsfig_list *)NULL ) + { + DrealErrorMessage( DrealMainWindow, "No current figure !" ); + } + else + { + SaveAsString = XmStringCreateLtoR( DrealFigureRds->NAME, + XmSTRING_DEFAULT_CHARSET ); + + XtVaSetValues( DrealFileSaveAsDialog.WIDGET, + XmNtextString, SaveAsString, NULL ); + + XmStringFree( SaveAsString ); + + DrealEnterDialog( &DrealFileSaveAsDialog ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileQuit | +| | +\------------------------------------------------------------*/ + +void CallbackFileQuit( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterDialog( &DrealFileQuitDialog ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMF_menu.h b/alliance/src/dreal/src/GMF_menu.h new file mode 100644 index 00000000..e72dc15d --- /dev/null +++ b/alliance/src/dreal/src/GMF_menu.h @@ -0,0 +1,76 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_FILE_MENU +# define DREAL_FILE_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackFileNew(); + extern void CallbackFileOpen(); + extern void CallbackFileSave(); + extern void CallbackFileSaveAs(); + extern void CallbackFileQuit(); + +# endif diff --git a/alliance/src/dreal/src/GMF_panel.c b/alliance/src/dreal/src/GMF_panel.c new file mode 100644 index 00000000..1510c3b0 --- /dev/null +++ b/alliance/src/dreal/src/GMF_panel.c @@ -0,0 +1,829 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMF.h" + +# include "GMF_panel.h" +# include "GMF_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + DrealPanelItem DrealLibraryPanel = + + { + "Library", + 1, + 0, + DREAL_LIBRARY_X, + DREAL_LIBRARY_Y, + 250, + 375, + 1, + 1, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 0, + (DrealPanelButtonItem *)NULL + }; + + int DrealLibraryDefaultValues[ 5 ] = + + { + DREAL_LIBRARY_X, + DREAL_LIBRARY_Y, + 250, 375, 0 + }; + + static char **DREAL_CATA_LIB = (char **)NULL; + static char *DREAL_DEFAULT_LIB = (char *)NULL; + char *DREAL_WORK_LIB = (char *)NULL; + + static char DrealFirstLibrary = 1; + +/*------------------------------------------------------------\ +| | +| Buffer | +| | +\------------------------------------------------------------*/ + + static char *LibraryBuffer = (char *)NULL; + +/*------------------------------------------------------------\ +| | +| Widget For Library Panel | +| | +\------------------------------------------------------------*/ + + Widget DrealLibraryListLabel; + Widget DrealLibraryList; + + Widget DrealLibraryButtonOk; + Widget DrealLibraryButtonUpdate; + Widget DrealLibraryButtonCancel; + + Widget DrealLibraryCataLabel; + Widget DrealLibraryCata; + + Widget DrealLibraryWorkLabel; + Widget DrealLibraryWork; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealIsDirectory | +| | +\------------------------------------------------------------*/ + +char DrealIsDirectory( FileName ) + + char *FileName; +{ + struct stat Buffer; + + rdsbegin(); + + if ( stat( FileName, &Buffer ) != -1 ) + { + if ( ( Buffer.st_mode & S_IFMT ) == S_IFDIR ) + { + rdsend(); + return( 1 ); + } + } + + rdsend(); + return( 0 ); +} + +/*------------------------------------------------------------\ +| | +| DrealSetLibraryList | +| | +\------------------------------------------------------------*/ + +void DrealSetLibraryList() +{ + int Index; + XmString Label; + + rdsbegin(); + + XmListDeleteAllItems( DrealLibraryList ); + + for ( Index = 0; + DREAL_CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + Label = XmStringCreateSimple( DREAL_CATA_LIB[ Index ] ); + XmListAddItem( DrealLibraryList , Label , 0 ); + XmStringFree( Label ); + } + + Label = XmStringCreateSimple( DREAL_WORK_LIB ); + XmListAddItem( DrealLibraryList , Label , 0 ); + XmStringFree( Label ); + + DREAL_DEFAULT_LIB = (char *)NULL; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealSetWorkLibrary | +| | +\------------------------------------------------------------*/ + +void DrealSetWorkLibrary() +{ + rdsbegin(); + + XmTextSetString( DrealLibraryWork, DREAL_WORK_LIB ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealSetCataLibrary | +| | +\------------------------------------------------------------*/ + +void DrealSetCataLibrary() +{ + int Index; + long Length; + char *Buffer; + char *Scan; + + rdsbegin(); + + for ( Index = 0, Length = 0; + DREAL_CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + Length = Length + strlen( DREAL_CATA_LIB[ Index ] ) + 1; + } + + Buffer = rdsallocblock( Length + 1 ); + Scan = Buffer; + + for ( Index = 0; + DREAL_CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + strcpy( Scan, DREAL_CATA_LIB[ Index ] ); + strcat( Scan, "\n" ); + + Scan = Scan + strlen( Scan ); + } + + XmTextSetString( DrealLibraryCata, Buffer ); + + rdsfreeblock( Buffer ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeLibrary | +| | +\------------------------------------------------------------*/ + +void DrealInitializeLibrary() +{ + int Index; + + rdsbegin(); + + for ( Index = 0; CATA_LIB[ Index ] != (char *)NULL; Index++ ); + + DREAL_CATA_LIB = (char **)rdsallocblock( sizeof(char *) * ( Index + 1 )); + + for ( Index = 0; + CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + DREAL_CATA_LIB[ Index ] = rdsallocblock( strlen( CATA_LIB[ Index ] ) + 1 ); + strcpy( DREAL_CATA_LIB[ Index ], CATA_LIB[ Index ] ); + } + + DREAL_CATA_LIB[ Index ] = (char *)NULL; + + DREAL_WORK_LIB = rdsallocblock( strlen( WORK_LIB ) + 1 ); + strcpy( DREAL_WORK_LIB, WORK_LIB ); + + DrealSetCataLibrary(); + DrealSetWorkLibrary(); + DrealSetLibraryList(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealGetCataLibrary | +| | +\------------------------------------------------------------*/ + + void DrealGetCataLibrary() + { + char *NewCata; + char *Scan; + int Index; + int Count; + int Length; + + rdsbegin(); + + for ( Index = 0; + DREAL_CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + rdsfreeblock( DREAL_CATA_LIB[ Index ] ); + } + + rdsfreeblock( DREAL_CATA_LIB ); + + NewCata = XmTextGetString( DrealLibraryCata ); + + Count = 1; + + for ( Index = 0; NewCata[ Index ] != '\0'; Index++ ) + { + if ( NewCata[ Index ] == '\n' ) + { + Count = Count + 1; + } + } + + DREAL_CATA_LIB = (char **)rdsallocblock( sizeof(char *) * ( Count + 1 )); + + Count = 0; + Scan = NewCata; + + for ( Index = 0; NewCata[ Index ] != '\0'; Index++ ) + { + if ( NewCata[ Index ] == '\n' ) + { + NewCata[ Index ] = '\0'; + + Length = strlen( Scan ); + + if ( ( Length > 0 ) && + ( DrealIsDirectory( Scan ) ) ) + { + DREAL_CATA_LIB[ Count ] = rdsallocblock( Length + 1 ); + strcpy( DREAL_CATA_LIB[ Count ], Scan ); + Count = Count + 1; + } + + Scan = NewCata + Index + 1; + } + else + if ( NewCata[ Index ] == ' ' ) + { + NewCata[ Index ] = '\0'; + } + } + + Length = strlen( Scan ); + + if ( Length > 0 ) + { + DREAL_CATA_LIB[ Count ] = rdsallocblock( Length + 1 ); + strcpy( DREAL_CATA_LIB[ Count ], Scan ); + Count = Count + 1; + } + + DREAL_CATA_LIB[ Count ] = (char *)NULL; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealGetWorkLibrary | +| | +\------------------------------------------------------------*/ + +void DrealGetWorkLibrary() +{ + char *NewWork; + + rdsbegin(); + + rdsfreeblock( DREAL_WORK_LIB ); + + NewWork = XmTextGetString( DrealLibraryWork ); + + if ( DrealIsDirectory( NewWork ) ) + { + DREAL_WORK_LIB = rdsallocblock( strlen( NewWork ) + 1 ); + strcpy( DREAL_WORK_LIB, NewWork ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLibraryList | +| | +\------------------------------------------------------------*/ + +void CallbackLibraryList( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmListCallbackStruct *CallData; +{ + rdsbegin(); + + DREAL_DEFAULT_LIB = DREAL_CATA_LIB[ CallData->item_position - 1 ]; + + if ( DREAL_DEFAULT_LIB == (char *)NULL ) + { + DREAL_DEFAULT_LIB = DREAL_WORK_LIB; + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLibraryOk | +| | +\------------------------------------------------------------*/ + +void CallbackLibraryOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + XmString Label; + int Index; + + rdsbegin(); + + DrealExitPanel( &DrealLibraryPanel ); + + DrealExitDialog(); + + if ( DrealFirstLibrary == 0 ) + { + for ( Index = 0; + CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + rdsfreeblock( CATA_LIB[ Index ] ); + } + + rdsfreeblock( CATA_LIB ); + rdsfreeblock( WORK_LIB ); + } + + DrealFirstLibrary = 0; + + CATA_LIB = DREAL_CATA_LIB; + WORK_LIB = DREAL_WORK_LIB; + + if ( DREAL_DEFAULT_LIB != (char *)NULL ) + { + Label = XmStringCreateSimple( DREAL_DEFAULT_LIB ); + + XtVaSetValues( DrealFileOpenDialog.WIDGET, + XmNdirectory, Label, NULL ); + + XmStringFree( Label ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLibraryUpdate | +| | +\------------------------------------------------------------*/ + +void CallbackLibraryUpdate( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealGetCataLibrary(); + DrealGetWorkLibrary(); + DrealSetLibraryList(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLibraryCancel | +| | +\------------------------------------------------------------*/ + +void CallbackLibraryCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + int Index; + + rdsbegin(); + + for ( Index = 0; + DREAL_CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + rdsfreeblock( DREAL_CATA_LIB[ Index ] ); + } + + rdsfreeblock( DREAL_CATA_LIB ); + rdsfreeblock( DREAL_WORK_LIB ); + + XtUnmanageChild( DrealLibraryPanel.PANEL ); + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEnterLibrary | +| | +\------------------------------------------------------------*/ + +void CallbackEnterLibrary( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealInitializeLibrary(); + + DrealEnterPanel( &DrealLibraryPanel ); + DrealLimitedLoop( DrealLibraryPanel.PANEL ); + DrealReEnterDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealBuildPanelLibrary | +| | +\------------------------------------------------------------*/ + +void DrealBuildPanelLibrary() +{ + Arg Args[15]; + XmString Label; + + rdsbegin(); + + XtSetArg( Args[0], XmNshadowType , XmSHADOW_ETCHED_IN ); + XtSetArg( Args[1], XmNdeleteResponse, XmDO_NOTHING ); + XtSetArg( Args[2], XmNtitle , DrealLibraryPanel.TITLE ); + + DrealLibraryPanel.PANEL = + + XmCreateFormDialog( DrealMainWindow, "DrealLibraryPanel", Args, 3); + + XtAddCallback( DrealLibraryPanel.PANEL, XmNdestroyCallback, + DrealDestroyDialogCallback, NULL ); + + DrealLibraryPanel.PANEL_FORM = + + XtVaCreateManagedWidget( "DrealLibraryPanelForm", + xmFormWidgetClass, + DrealLibraryPanel.PANEL, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNfractionBase , 10, + NULL + ); + + DrealLibraryPanel.FRAME = + + XtVaCreateManagedWidget( "DrealLibraryFrame", + xmFrameWidgetClass, + DrealLibraryPanel.PANEL_FORM, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + NULL + ); + + DrealLibraryPanel.FORM = + + XtVaCreateManagedWidget( "DrealLibraryForm", + xmFormWidgetClass, + DrealLibraryPanel.FRAME, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNfractionBase , 120, + NULL + ); + + DrealLibraryButtonUpdate = + + XtVaCreateManagedWidget( "Update", + xmPushButtonWidgetClass, + DrealLibraryPanel.FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 10, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 40, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 105, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 115, + NULL + ); + + DrealLibraryButtonOk = + + XtVaCreateManagedWidget( "Ok", + xmPushButtonWidgetClass, + DrealLibraryPanel.FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 50, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 70, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 105, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 115, + NULL + ); + + DrealLibraryButtonCancel = + + XtVaCreateManagedWidget( "Cancel", + xmPushButtonWidgetClass, + DrealLibraryPanel.FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 80, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 110, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 105, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 115, + NULL + ); + + Label = XmStringCreateSimple( "Directories" ); + + DrealLibraryListLabel = + + XtVaCreateManagedWidget( "DrealLibraryListLabel", + xmLabelGadgetClass , + DrealLibraryPanel.FORM, + XmNlabelString , Label, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 5, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 5, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 10, + NULL ); + + XmStringFree( Label ); + + XtSetArg( Args[0] , XmNtopAttachment , XmATTACH_POSITION ); + XtSetArg( Args[1] , XmNtopPosition , 10 ); + XtSetArg( Args[2] , XmNbottomAttachment , XmATTACH_POSITION ); + XtSetArg( Args[3] , XmNbottomPosition , 40 ); + XtSetArg( Args[4] , XmNrightAttachment , XmATTACH_POSITION ); + XtSetArg( Args[5] , XmNrightPosition , 115 ); + XtSetArg( Args[6] , XmNleftAttachment , XmATTACH_POSITION ); + XtSetArg( Args[7] , XmNleftPosition , 5 ); + XtSetArg( Args[8] , XmNscrollBarDisplayPolicy, XmSTATIC ); + XtSetArg( Args[9] , XmNscrollHorizontal , True ); + XtSetArg( Args[10] , XmNscrollVertical , True ); + XtSetArg( Args[11] , XmNlistSizePolicy , XmCONSTANT ); + + DrealLibraryList = + + XmCreateScrolledList( DrealLibraryPanel.FORM, + "DrealLibraryList", Args, 12 ); + + Label = XmStringCreateSimple( "Catalog libraries" ); + + DrealLibraryCataLabel = + + XtVaCreateManagedWidget( "DrealLibraryCataLabel", + xmLabelGadgetClass , + DrealLibraryPanel.FORM, + XmNlabelString , Label, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 5, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 45, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 50, + NULL ); + + XmStringFree( Label ); + + XtSetArg( Args[0] , XmNrows , 4 ); + XtSetArg( Args[1] , XmNeditable , True ); + XtSetArg( Args[2] , XmNcursorPositionVisible , True ); + XtSetArg( Args[3] , XmNscrollHorizontal , True ); + XtSetArg( Args[4] , XmNscrollVertical , True ); + XtSetArg( Args[5] , XmNeditMode , XmMULTI_LINE_EDIT ); + XtSetArg( Args[6] , XmNtopAttachment , XmATTACH_POSITION ); + XtSetArg( Args[7] , XmNtopPosition , 50 ); + XtSetArg( Args[8] , XmNleftAttachment , XmATTACH_POSITION ); + XtSetArg( Args[9] , XmNleftPosition , 5 ); + XtSetArg( Args[10] , XmNrightAttachment , XmATTACH_POSITION ); + XtSetArg( Args[11] , XmNrightPosition , 115 ); + XtSetArg( Args[12] , XmNbottomAttachment , XmATTACH_POSITION ); + XtSetArg( Args[13] , XmNbottomPosition , 80 ); + + DrealLibraryCata = + + XmCreateScrolledText( DrealLibraryPanel.FORM, + "DrealLibraryCata", Args, 14 ); + + Label = XmStringCreateSimple( "Work library" ); + + DrealLibraryWorkLabel = + + XtVaCreateManagedWidget( "DrealLibraryWorkLabel", + xmLabelGadgetClass , + DrealLibraryPanel.FORM, + XmNlabelString , Label, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 5, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 85, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 90, + NULL ); + XmStringFree( Label ); + + XtSetArg( Args[0] , XmNrows , 1 ); + XtSetArg( Args[1] , XmNeditable , True ); + XtSetArg( Args[2] , XmNeditMode , XmSINGLE_LINE_EDIT ); + XtSetArg( Args[3] , XmNscrollHorizontal , False ); + XtSetArg( Args[4] , XmNscrollVertical , False ); + XtSetArg( Args[5] , XmNcursorPositionVisible , True ); + XtSetArg( Args[6] , XmNtopAttachment , XmATTACH_POSITION ); + XtSetArg( Args[7] , XmNtopPosition , 90 ); + XtSetArg( Args[8] , XmNleftAttachment , XmATTACH_POSITION ); + XtSetArg( Args[9] , XmNleftPosition , 5 ); + XtSetArg( Args[10] , XmNrightAttachment , XmATTACH_POSITION ); + XtSetArg( Args[11] , XmNrightPosition , 115 ); + XtSetArg( Args[12] , XmNbottomAttachment , XmATTACH_POSITION ); + XtSetArg( Args[13] , XmNbottomPosition , 100 ); + + DrealLibraryWork = + + XmCreateText( DrealLibraryPanel.FORM, + "DrealLibraryWork", Args, 14 ); + + XtManageChild( DrealLibraryWork ); + XtManageChild( DrealLibraryList ); + XtManageChild( DrealLibraryCata ); + + XtAddCallback( DrealLibraryList, + XmNdefaultActionCallback, + CallbackLibraryList, NULL ); + + XtAddCallback( DrealLibraryButtonOk, + XmNactivateCallback, + CallbackLibraryOk, NULL ); + + XtAddCallback( DrealLibraryButtonCancel, + XmNactivateCallback, + CallbackLibraryCancel, NULL ); + + XtAddCallback( DrealLibraryButtonUpdate, + XmNactivateCallback, + CallbackLibraryUpdate, NULL ); + + XtVaSetValues( DrealLibraryPanel.PANEL, + XmNheight, DrealLibraryPanel.HEIGHT, + XmNwidth , DrealLibraryPanel.WIDTH, + XmNx , DrealLibraryPanel.X, + XmNy , DrealLibraryPanel.Y, + NULL ); + + Label = XmStringCreateSimple( "Library" ); + + XtVaSetValues( XmFileSelectionBoxGetChild( DrealFileOpenDialog.WIDGET, + XmDIALOG_HELP_BUTTON ), + XmNlabelString, Label, NULL ); + + XmStringFree( Label ); + + XtAddCallback( XmFileSelectionBoxGetChild( DrealFileOpenDialog.WIDGET, + XmDIALOG_HELP_BUTTON ), + XmNactivateCallback, + CallbackEnterLibrary, NULL ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMF_panel.h b/alliance/src/dreal/src/GMF_panel.h new file mode 100644 index 00000000..bfb02a91 --- /dev/null +++ b/alliance/src/dreal/src/GMF_panel.h @@ -0,0 +1,80 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_FILE_PANEL +# define DREAL_FILE_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_LIBRARY_X 100 +# define DREAL_LIBRARY_Y 230 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackLibraryList(); + extern void CallbackLibraryOk(); + extern void CallbackLibraryUpdate(); + extern void CallbackLibraryCancel(); + extern void CallbackEnterLibrary(); + +# endif diff --git a/alliance/src/dreal/src/GMH.h b/alliance/src/dreal/src/GMH.h new file mode 100644 index 00000000..09686dec --- /dev/null +++ b/alliance/src/dreal/src/GMH.h @@ -0,0 +1,74 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : GMH101.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GMH +# define DREAL_GMH + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern DrealMenuItem DrealHelpMenu[]; + extern DrealPanelItem DrealHelpPresentPanel; + + extern int DrealHelpPresentDefaultValues[5]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealBuildPresentPanel(); + extern void DrealEnterPresentPanel(); + +# endif diff --git a/alliance/src/dreal/src/GMH_help.c b/alliance/src/dreal/src/GMH_help.c new file mode 100644 index 00000000..fcd11882 --- /dev/null +++ b/alliance/src/dreal/src/GMH_help.c @@ -0,0 +1,79 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Help.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GTB.h" +# include "GSB.h" +# include "GMH.h" +# include "GMX.h" + +# include "GMH_help.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ diff --git a/alliance/src/dreal/src/GMH_help.h b/alliance/src/dreal/src/GMH_help.h new file mode 100644 index 00000000..c21daa9c --- /dev/null +++ b/alliance/src/dreal/src/GMH_help.h @@ -0,0 +1,70 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Help.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_HELP +# define DREAL_HELP + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GMH_menu.c b/alliance/src/dreal/src/GMH_menu.c new file mode 100644 index 00000000..d0a64919 --- /dev/null +++ b/alliance/src/dreal/src/GMH_menu.c @@ -0,0 +1,126 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GTB.h" +# include "GSB.h" +# include "GMH.h" +# include "GMX.h" + +# include "GMH_menu.h" +# include "GMH_panel.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Help Menu | +| | +\------------------------------------------------------------*/ + + DrealMenuItem DrealHelpMenu[] = + + { + { + "About Dreal", + 'G', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackHelpAbout, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackHelpAbout | +| | +\------------------------------------------------------------*/ + +void CallbackHelpAbout( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterPresentPanel(); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMH_menu.h b/alliance/src/dreal/src/GMH_menu.h new file mode 100644 index 00000000..0d15d228 --- /dev/null +++ b/alliance/src/dreal/src/GMH_menu.h @@ -0,0 +1,73 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_HELP_MENU +# define DREAL_HELP_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackHelpAbout(); + +# endif diff --git a/alliance/src/dreal/src/GMH_panel.c b/alliance/src/dreal/src/GMH_panel.c new file mode 100644 index 00000000..0b32f71a --- /dev/null +++ b/alliance/src/dreal/src/GMH_panel.c @@ -0,0 +1,322 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.c | +| | +| Authors : Venot Frederic and Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GTB.h" +# include "GMX.h" +# include "GMH.h" + +# include "GMH_panel.h" +# include "LIP6bw.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + DrealPanelItem DrealHelpPresentPanel = + + { + "Dreal present", + 1, + 0, + DREAL_HELP_PRESENT_X, + DREAL_HELP_PRESENT_Y, + 700, + 360, + 1, + 1, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 0, + (DrealPanelButtonItem *)NULL + }; + + int DrealHelpPresentDefaultValues[ 5 ] = + + { + DREAL_HELP_PRESENT_X, + DREAL_HELP_PRESENT_Y, + 700, 360, 0 + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealBuildPresentPanel | +| | +\------------------------------------------------------------*/ + +void DrealBuildPresentPanel() + +{ + 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( DrealMainWindow ); + 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 , "Dreal present" ); + + DrealHelpPresentPanel.PANEL = + + XmCreateFormDialog( DrealMainWindow, DrealHelpPresentPanel.TITLE, Args, 3); + + XtAddCallback( DrealHelpPresentPanel.PANEL, XmNdestroyCallback, + DrealDestroyDialogCallback, NULL ); + + DrealHelpPresentPanel.PANEL_FORM = + + XtVaCreateManagedWidget( "", + xmFormWidgetClass, + DrealHelpPresentPanel.PANEL, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + NULL + ); + + DrealHelpPresentPanel.FRAME = + + XtVaCreateManagedWidget( "", + xmFrameWidgetClass, + DrealHelpPresentPanel.PANEL_FORM, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 05, + XmNbottomAttachment, XmATTACH_POSITION, + XmNbottomPosition , 95, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 05, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 95, + NULL + ); + + DrealHelpPresentPanel.FORM = + + XtVaCreateManagedWidget( "", + xmFormWidgetClass, + DrealHelpPresentPanel.FRAME, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 05, + XmNbottomAttachment, XmATTACH_POSITION, + XmNbottomPosition , 95, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 05, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 95, + NULL + ); + + PanelPixmap = DrealCreatePixmap( DrealMainWindow, + LIP6bw_bits, + LIP6bw_width, + LIP6bw_height); + + PanelLabel = XtVaCreateManagedWidget( "", + xmLabelGadgetClass, + DrealHelpPresentPanel.FORM, + XmNlabelType , XmPIXMAP, + XmNlabelPixmap , PanelPixmap, + NULL + ); + sprintf( Buffer, "ALLIANCE CAD SYSTEM %s\n", ALLIANCE_VERSION ); + + PanelString = XmStringCreateLtoR( Buffer, "Panel_charset2" ); + + PanelLabel = XtVaCreateManagedWidget( "", + xmLabelWidgetClass, + DrealHelpPresentPanel.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( "Dreal" , "Panel_charset1" ); + PanelString2 = XmStringCreateLtoR( "\n( Click On IT )", "Panel_charset4" ); + PanelString = XmStringConcat( PanelString1, PanelString2 ); + + PanelButton = XtVaCreateManagedWidget( "", + xmPushButtonWidgetClass, + DrealHelpPresentPanel.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, + DrealExitDialogCallback, NULL ); + + sprintf( Buffer, "\nDesign Real layout\nVersion %s", DREAL_VERSION ); + + PanelString = XmStringCreateLtoR( Buffer, "Panel_charset2" ); + + PanelLabel = XtVaCreateManagedWidget( "", + xmLabelWidgetClass, + DrealHelpPresentPanel.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 1995-2000 ASIM, \ +CAO-VLSI Team\nWritten by Ludovic Jacomme\nE-mail support: alliance-support@asim.lip6.fr", "Panel_charset4" ); + + PanelLabel = XtVaCreateManagedWidget( "", + xmLabelWidgetClass, + DrealHelpPresentPanel.FORM, + XmNfontList , PanelFontList, + XmNlabelString , PanelString, + XmNtopAttachment , XmATTACH_WIDGET, + XmNtopWidget , PanelLabel, + XmNtopOffset , 5, + XmNrightAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + NULL + ); + XmStringFree( PanelString ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEnterPresentPanel | +| | +\------------------------------------------------------------*/ + +void DrealEnterPresentPanel() + +{ + rdsbegin(); + + DrealEnterPanel( &DrealHelpPresentPanel ); + + DrealLimitedLoop( DrealHelpPresentPanel.PANEL ); + + DrealExitPanel( &DrealHelpPresentPanel ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMH_panel.h b/alliance/src/dreal/src/GMH_panel.h new file mode 100644 index 00000000..5b252dff --- /dev/null +++ b/alliance/src/dreal/src/GMH_panel.h @@ -0,0 +1,74 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.h | +| | +| Authors : Venot Frederic and Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_HELP_PANEL +# define DREAL_HELP_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_HELP_PRESENT_X 180 +# define DREAL_HELP_PRESENT_Y 200 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GMS.h b/alliance/src/dreal/src/GMS.h new file mode 100644 index 00000000..c538e1e9 --- /dev/null +++ b/alliance/src/dreal/src/GMS.h @@ -0,0 +1,80 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : GMS101.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GMS +# define DREAL_GMS + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern DrealMenuItem DrealSetupMenu[]; + + extern DrealPanelItem DrealSetupInformationsPanel; + + extern int DrealSetupInformationsDefaultValues[ 5 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackSetupLoadConfig(); + extern void CallbackSetupSaveConfig(); + extern void CallbackSetupDefaultConfig(); + extern void CallbackSetupInformations(); + + extern void DrealLoadConfig(); + extern void DrealLoadTopLevelConfig(); + +# endif diff --git a/alliance/src/dreal/src/GMS_dialog.c b/alliance/src/dreal/src/GMS_dialog.c new file mode 100644 index 00000000..2bdcda7e --- /dev/null +++ b/alliance/src/dreal/src/GMS_dialog.c @@ -0,0 +1,84 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMS.h" + +# include "GMS_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ diff --git a/alliance/src/dreal/src/GMS_dialog.h b/alliance/src/dreal/src/GMS_dialog.h new file mode 100644 index 00000000..8f8d1ff3 --- /dev/null +++ b/alliance/src/dreal/src/GMS_dialog.h @@ -0,0 +1,70 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_SETUP_DIALOG +# define DREAL_SETUP_DIALOG + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GMS_menu.c b/alliance/src/dreal/src/GMS_menu.c new file mode 100644 index 00000000..4d4f0799 --- /dev/null +++ b/alliance/src/dreal/src/GMS_menu.c @@ -0,0 +1,231 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GTB.h" +# include "GSB.h" +# include "GMS.h" + +# include "GMS_menu.h" +# include "GMS_setup.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + DrealMenuItem DrealSetupMenu[] = + + { + { + "Default Config", + 'D', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackSetupDefaultConfig, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Load Config", + 'L', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackSetupLoadConfig, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Save Config", + 'S', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackSetupSaveConfig, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Informations", + 'I', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackSetupInformations, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + NULL + }; + + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackSetupLoadConfig | +| | +\------------------------------------------------------------*/ + +void CallbackSetupLoadConfig( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealLoadConfig( DREAL_TRUE ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackSetupSaveConfig | +| | +\------------------------------------------------------------*/ + +void CallbackSetupSaveConfig( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealSaveConfig(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackSetupDefaultConfig | +| | +\------------------------------------------------------------*/ + +void CallbackSetupDefaultConfig( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealDefaultConfig(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackSetupInformations | +| | +\------------------------------------------------------------*/ + +void CallbackSetupInformations( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealDisplayInformations(); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMS_menu.h b/alliance/src/dreal/src/GMS_menu.h new file mode 100644 index 00000000..913b891b --- /dev/null +++ b/alliance/src/dreal/src/GMS_menu.h @@ -0,0 +1,70 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_SETUP_MENU +# define DREAL_SETUP_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GMS_panel.c b/alliance/src/dreal/src/GMS_panel.c new file mode 100644 index 00000000..0ccbb193 --- /dev/null +++ b/alliance/src/dreal/src/GMS_panel.c @@ -0,0 +1,175 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GTB.h" +# include "GSB.h" +# include "GRD.h" +# include "GMS.h" + +# include "GMS_panel.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Panel | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Panel Informations | +| | +\------------------------------------------------------------*/ + + DrealPanelButtonItem DrealSetupInformationsButton[] = + + { + { + "Text", + "Nothing", NULL, 0, 0, + NULL, + NULL, + 0, 0, + 8, 9, + NULL, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Close", + NULL, NULL, 0, 0, + NULL, + NULL, + 3, 9, + 2, 1, + DrealExitDialogCallback, + (XtPointer)NULL, + (Widget)NULL + } + }; + + DrealPanelItem DrealSetupInformationsPanel = + + { + "Informations", + 1, + 0, + DREAL_SETUP_INFORMATIONS_X, + DREAL_SETUP_INFORMATIONS_Y, + 360, + 250, + 8, + 10, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 2, + DrealSetupInformationsButton + }; + + int DrealSetupInformationsDefaultValues[ 5 ] = + + { + DREAL_SETUP_INFORMATIONS_X, + DREAL_SETUP_INFORMATIONS_Y, + 360, 250, 0 + }; + +/*------------------------------------------------------------\ +| | +| Callback For Informations | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealDisplayInformations | +| | +\------------------------------------------------------------*/ + +void DrealDisplayInformations() + +{ + char *Message; + + rdsbegin(); + + Message = DrealGetInformations(); + + XmTextSetString( DrealSetupInformationsButton[0].BUTTON, Message ); + + DrealEnterPanel( &DrealSetupInformationsPanel ); + + DrealLimitedLoop( DrealSetupInformationsPanel.PANEL ); + + DrealExitPanel( &DrealSetupInformationsPanel ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMS_panel.h b/alliance/src/dreal/src/GMS_panel.h new file mode 100644 index 00000000..b656de11 --- /dev/null +++ b/alliance/src/dreal/src/GMS_panel.h @@ -0,0 +1,76 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_SETUP_PANEL +# define DREAL_SETUP_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_SETUP_INFORMATIONS_X 330 +# define DREAL_SETUP_INFORMATIONS_Y 280 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealDisplayInformations(); + +# endif diff --git a/alliance/src/dreal/src/GMS_setup.c b/alliance/src/dreal/src/GMS_setup.c new file mode 100644 index 00000000..26826eec --- /dev/null +++ b/alliance/src/dreal/src/GMS_setup.c @@ -0,0 +1,556 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Setup.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GTB.h" +# include "GSB.h" +# include "GMX.h" +# include "GMF.h" +# include "GMV.h" +# include "GME.h" +# include "GMC.h" +# include "GMT.h" +# include "GMS.h" +# include "GMH.h" + +# include "GMS_setup.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static FILE *FileConfig; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Set Panel New Values | +| | +\------------------------------------------------------------*/ + +void DrealSetPanelValues( Panel, Values ) + + DrealPanelItem *Panel; + int *Values; +{ + rdsbegin(); + + Panel->COMPUTE = 1; + Panel->X = Values[0]; + Panel->Y = Values[1]; + Panel->WIDTH = Values[2]; + Panel->HEIGHT = Values[3]; + Panel->MANAGED = Values[4]; + + XtVaSetValues( Panel->PANEL, + XmNx , Values[0], + XmNy , Values[1], + XmNwidth , Values[2], + XmNheight , Values[3], + NULL ); + + if ( Panel->MANAGED ) + { + DrealEnterPanel( Panel ); + } + else + { + XtUnmanageChild( Panel->PANEL ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Write TopLevel Values | +| | +\------------------------------------------------------------*/ + +void DrealWriteTopLevelValues() + +{ + Dimension Values[5]; + + rdsbegin(); + + XtVaGetValues( DrealTopLevel, + XmNx , &Values[0], + XmNy , &Values[1], + XmNwidth , &Values[2], + XmNheight , &Values[3], + NULL ); + + Values[0] = Values[0] - DREAL_TOPLEVEL_TRANSLATE_X; + Values[1] = Values[1] - DREAL_TOPLEVEL_TRANSLATE_Y; + Values[4] = 1; + + fprintf( FileConfig, "VERSION: %s\n", DREAL_VERSION ); + fprintf( FileConfig, "X: %d, Y: %d, WIDTH: %d, HEIGHT: %d, MANAGED: %d\n", + Values[0], Values[1], Values[2], Values[3], Values[4] ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Write Panel Values | +| | +\------------------------------------------------------------*/ + +void DrealWritePanelValues( Panel ) + + DrealPanelItem *Panel; +{ + Dimension Values[5]; + + rdsbegin(); + + if ( Panel->COMPUTE == 0 ) + { + XtVaGetValues( Panel->PANEL, + XmNx , &Values[0], + XmNy , &Values[1], + XmNwidth , &Values[2], + XmNheight , &Values[3], + NULL ); + + Values[0] = Values[0] - DREAL_PANEL_TRANSLATE_X; + Values[1] = Values[1] - DREAL_PANEL_TRANSLATE_Y; + } + else + { + Values[0] = Panel->X; + Values[1] = Panel->Y; + Values[2] = Panel->WIDTH; + Values[3] = Panel->HEIGHT; + } + + Values[2] /= Panel->COLUMN; + Values[3] /= Panel->ROW; + + Values[4] = Panel->MANAGED; + + fprintf( FileConfig, "X: %d, Y: %d, WIDTH: %d, HEIGHT: %d, MANAGED: %d\n", + Values[0], Values[1], Values[2], Values[3], Values[4] ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Read Panel Values | +| | +\------------------------------------------------------------*/ + +void DrealReadPanelValues( Panel ) + + DrealPanelItem *Panel; +{ + int Values[5]; + + rdsbegin(); + + fscanf( FileConfig, "X: %d, Y: %d, WIDTH: %d, HEIGHT: %d, MANAGED: %d\n", + &Values[0], &Values[1], &Values[2], &Values[3], &Values[4] ); + + Values[2] *= Panel->COLUMN; + Values[3] *= Panel->ROW; + + DrealSetPanelValues( Panel, Values ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Read Panel Values | +| | +\------------------------------------------------------------*/ + +char DrealReadTopLevelValues() +{ + int Values[5]; + char Version[64]; + + rdsbegin(); + + fscanf( FileConfig, "VERSION: %s\n", Version ); + + if ( strcmp( Version, DREAL_VERSION ) ) + { + rdsend(); + return( 0 ); + } + + fscanf( FileConfig, "X: %d, Y: %d, WIDTH: %d, HEIGHT: %d, MANAGED: %d\n", + &Values[0], &Values[1], &Values[2], &Values[3], &Values[4] ); + + XtVaSetValues( DrealTopLevel, + XmNx , Values[0], + XmNy , Values[1], + XmNwidth , Values[2], + XmNheight , Values[3], + NULL ); + + rdsend(); + return( 1 ); +} + +/*------------------------------------------------------------\ +| | +| ReadActiveLayers | +| | +\------------------------------------------------------------*/ + +void DrealReadActiveLayers() + +{ + char Layer; + int Value; + + rdsbegin(); + + for ( Layer = 0; Layer < RDS_ALL_LAYER; Layer++ ) + { + fscanf( FileConfig, "ACTIVE: %d\n", &Value ); + + if ( ( DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 0 ] != (char *)NULL ) && + ( RDS_DYNAMIC_LAYER[ Layer ] != RDS_LAYER_UNUSED ) ) + { + DREAL_RDS_ACTIVE_LAYER_TABLE[ Layer ] = Value; + } + else + { + DREAL_RDS_ACTIVE_LAYER_TABLE[ Layer ] = -1; + } + } + + for ( Layer = 0; Layer < DREAL_MAX_ACTIVE_NAME; Layer++ ) + { + fscanf( FileConfig, "ACTIVE: %d\n", &Value ); + + DREAL_RDS_ACTIVE_NAME_TABLE[ Layer ] = Value; + } + + fscanf( FileConfig, "FILLMODE: %d\n", &Value ); + + DREAL_FILL_MODE = Value; + + fscanf( FileConfig, "INTERFACE: %d\n", &Value ); + + DREAL_INSTANCE_INTERFACE = Value; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| WriteActiveLayers | +| | +\------------------------------------------------------------*/ + +void DrealWriteActiveLayers() + +{ + char Layer; + int Value; + + rdsbegin(); + + for ( Layer = 0; Layer < RDS_ALL_LAYER; Layer++ ) + { + fprintf( FileConfig, "ACTIVE: %d\n", + ( DREAL_RDS_ACTIVE_LAYER_TABLE[ Layer ] != 0 ) ); + } + + for ( Layer = 0; Layer < DREAL_MAX_ACTIVE_NAME; Layer++ ) + { + fprintf( FileConfig, "ACTIVE: %d\n", + DREAL_RDS_ACTIVE_NAME_TABLE[ Layer ] ); + } + + fprintf( FileConfig, "FILLMODE: %d\n", + DREAL_FILL_MODE ); + + fprintf( FileConfig, "INTERFACE: %d\n", + DREAL_INSTANCE_INTERFACE ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDefaultTopLevelValues | +| | +\------------------------------------------------------------*/ + +void DrealDefaultTopLevelValues() + +{ + rdsbegin(); + + XtVaSetValues( DrealTopLevel, + XmNheight , DREAL_TOPLEVEL_HEIGHT, + XmNwidth , DREAL_TOPLEVEL_WIDTH, + XmNx , DREAL_TOPLEVEL_X, + XmNy , DREAL_TOPLEVEL_Y, + NULL + ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDefaultConfig | +| | +\------------------------------------------------------------*/ + +void DrealDefaultConfig() + +{ + char Layer; + + rdsbegin(); + + DrealDefaultTopLevelValues(); + + DrealSetPanelValues( &DrealViewArrowsPanel, + DrealViewArrowsDefaultValues ); + DrealSetPanelValues( &DrealViewZoomPanel, + DrealViewZoomDefaultValues ); + DrealSetPanelValues( &DrealViewLayerPanel, + DrealViewLayerDefaultValues ); + DrealSetPanelValues( &DrealViewGridPanel, + DrealViewGridDefaultValues ); + DrealSetPanelValues( &DrealViewMapPanel, + DrealViewMapDefaultValues ); + DrealSetPanelValues( &DrealCreateRectanglePanel, + DrealCreateRectangleDefaultValues ); + DrealSetPanelValues( &DrealModifyRectanglePanel, + DrealModifyRectangleDefaultValues ); + DrealSetPanelValues( &DrealToolsMessagePanel, + DrealToolsMessageDefaultValues ); + DrealSetPanelValues( &DrealHelpPresentPanel, + DrealHelpPresentDefaultValues ); + + for ( Layer = 0; Layer < RDS_ALL_LAYER; Layer++ ) + { + if ( ( DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 0 ] != (char *)NULL ) && + ( RDS_DYNAMIC_LAYER[ Layer ] != RDS_LAYER_UNUSED ) ) + { + DREAL_RDS_ACTIVE_LAYER_TABLE[ Layer ] = 1; + } + else + { + DREAL_RDS_ACTIVE_LAYER_TABLE[ Layer ] = -1; + } + } + + for ( Layer = 0; Layer < DREAL_MAX_ACTIVE_NAME; Layer++ ) + { + DREAL_RDS_ACTIVE_NAME_TABLE[ Layer ] = 1; + } + + DREAL_FILL_MODE = DREAL_FILL_MODE_PATTERN; + DREAL_INSTANCE_INTERFACE = DREAL_TRUE; + + DrealInitializeLayer(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealLoadTopLevelConfig | +| | +\------------------------------------------------------------*/ + +void DrealLoadTopLevelConfig() + +{ + rdsbegin(); + + FileConfig = fopen( DREAL_GMS_FILE_NAME, "r" ); + + if ( FileConfig == (FILE *)NULL ) + { + DrealDefaultTopLevelValues(); + } + else + { + if ( ! DrealReadTopLevelValues() ) + { + DrealDefaultTopLevelValues(); + } + + fclose( FileConfig ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealLoadConfig | +| | +\------------------------------------------------------------*/ + +void DrealLoadConfig( Message ) + + char Message; +{ + rdsbegin(); + + FileConfig = fopen( DREAL_GMS_FILE_NAME, "r" ); + + if ( FileConfig == (FILE *)NULL ) + { + if ( Message ) + { + DrealErrorMessage( DrealMainWindow, + "Unable to open config file !" ); + } + else + { + DrealDefaultConfig(); + } + } + else + { + if ( DrealReadTopLevelValues() ) + { + DrealReadPanelValues( &DrealViewArrowsPanel ); + DrealReadPanelValues( &DrealViewZoomPanel ); + DrealReadPanelValues( &DrealViewLayerPanel ); + DrealReadPanelValues( &DrealViewGridPanel ); + DrealReadPanelValues( &DrealViewMapPanel ); + DrealReadPanelValues( &DrealCreateRectanglePanel ); + DrealReadPanelValues( &DrealModifyRectanglePanel ); + DrealReadPanelValues( &DrealToolsMessagePanel ); + DrealReadPanelValues( &DrealHelpPresentPanel ); + + DrealReadActiveLayers(); + DrealInitializeLayer(); + } + else + if ( Message ) + { + DrealErrorMessage( DrealMainWindow, + "Bad version, unable to open config file !" ); + } + else + { + DrealDefaultConfig(); + } + + fclose( FileConfig ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealSaveConfig | +| | +\------------------------------------------------------------*/ + +void DrealSaveConfig() + +{ + rdsbegin(); + + FileConfig = fopen( DREAL_GMS_FILE_NAME, "w" ); + + if ( FileConfig == (FILE *)NULL ) + { + DrealErrorMessage( DrealMainWindow, + "Unable to open config file !" ); + } + else + { + DrealWriteTopLevelValues(); + + DrealWritePanelValues( &DrealViewArrowsPanel ); + DrealWritePanelValues( &DrealViewZoomPanel ); + DrealWritePanelValues( &DrealViewLayerPanel ); + DrealWritePanelValues( &DrealViewGridPanel ); + DrealWritePanelValues( &DrealViewMapPanel ); + DrealWritePanelValues( &DrealCreateRectanglePanel ); + DrealWritePanelValues( &DrealModifyRectanglePanel ); + DrealWritePanelValues( &DrealToolsMessagePanel ); + DrealWritePanelValues( &DrealHelpPresentPanel ); + + DrealWriteActiveLayers(); + + fclose( FileConfig ); + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMS_setup.h b/alliance/src/dreal/src/GMS_setup.h new file mode 100644 index 00000000..d064b077 --- /dev/null +++ b/alliance/src/dreal/src/GMS_setup.h @@ -0,0 +1,85 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Setup.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_SETUP +# define DREAL_SETUP + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_TOPLEVEL_TRANSLATE_X 0 +# define DREAL_TOPLEVEL_TRANSLATE_Y 0 +# define DREAL_PANEL_TRANSLATE_X 4 +# define DREAL_PANEL_TRANSLATE_Y 21 + +# define DREAL_TOPLEVEL_X 10 +# define DREAL_TOPLEVEL_Y 10 +# define DREAL_TOPLEVEL_WIDTH 1024 +# define DREAL_TOPLEVEL_HEIGHT 768 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealDefaultConfig(); + extern void DrealSaveConfig(); + extern void DrealLoadConfig(); + +# endif diff --git a/alliance/src/dreal/src/GMT.h b/alliance/src/dreal/src/GMT.h new file mode 100644 index 00000000..f60484f2 --- /dev/null +++ b/alliance/src/dreal/src/GMT.h @@ -0,0 +1,74 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : GMT101.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GMT +# define DREAL_GMT + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern DrealMenuItem DrealToolsMenu[]; + extern DrealPanelItem DrealToolsMessagePanel; + + extern int DrealToolsMessageDefaultValues[ 5 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealDisplayToolsMessage(); + extern void DrealBuildToolsDialog(); + +# endif diff --git a/alliance/src/dreal/src/GMT_dialog.c b/alliance/src/dreal/src/GMT_dialog.c new file mode 100644 index 00000000..243ff402 --- /dev/null +++ b/alliance/src/dreal/src/GMT_dialog.c @@ -0,0 +1,170 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMT.h" + +# include "GMT_dialog.h" +# include "GMT_tools.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| File Dialog | +| | +\------------------------------------------------------------*/ + + DrealDialogItem DrealToolsSavePixmapDialog = + + { + "Save xpm file As", + DREAL_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackToolsSavePixmapOk, + (XtPointer)NULL, + (void *)CallbackToolsSavePixmapCancel, + (XtPointer)NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealBuildToolsDialog | +| | +\------------------------------------------------------------*/ + +void DrealBuildToolsDialog() + +{ + rdsbegin(); + + DrealBuildDialog( DrealMainWindow, &DrealToolsSavePixmapDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackToolsSavePixmapOk | +| | +\------------------------------------------------------------*/ + +void CallbackToolsSavePixmapOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *FileName; + + rdsbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &FileName ); + + FileName = DrealPostTreatString( FileName ); + + XtUnmanageChild( DrealToolsSavePixmapDialog.WIDGET ); + + DrealExitDialog(); + + DrealToolsSavePixmap( FileName ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackToolsSavePixmapCancel | +| | +\------------------------------------------------------------*/ + +void CallbackToolsSavePixmapCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + rdsbegin(); + + XtUnmanageChild( DrealToolsSavePixmapDialog.WIDGET ); + + DrealExitDialog(); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMT_dialog.h b/alliance/src/dreal/src/GMT_dialog.h new file mode 100644 index 00000000..4427da24 --- /dev/null +++ b/alliance/src/dreal/src/GMT_dialog.h @@ -0,0 +1,77 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_TOOLS_DIALOG +# define DREAL_TOOLS_DIALOG + + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern DrealDialogItem DrealToolsSavePixmapDialog; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackToolsSavePixmapOk(); + extern void CallbackToolsSavePixmapCancel(); + +# endif diff --git a/alliance/src/dreal/src/GMT_menu.c b/alliance/src/dreal/src/GMT_menu.c new file mode 100644 index 00000000..7027b355 --- /dev/null +++ b/alliance/src/dreal/src/GMT_menu.c @@ -0,0 +1,202 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GTB.h" +# include "GRD.h" +# include "GMV.h" +# include "GMT.h" +# include "GMX.h" + +# include "GMT_menu.h" +# include "GMT_tools.h" +# include "GMT_dialog.h" +# include "GMT_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + DrealMenuItem DrealToolsMenu[] = + + { + { + "Save Image", + 'S', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackToolsSavePixmap, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Flatten", + 'F', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackToolsFlatten, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Message", + 'M', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackToolsMessage, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackToolsMessage | +| | +\------------------------------------------------------------*/ + +void CallbackToolsMessage( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterPanel( &DrealToolsMessagePanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackToolsFlatten | +| | +\------------------------------------------------------------*/ + +void CallbackToolsFlatten( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealToolsFlatten(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackToolsSavePixmap | +| | +\------------------------------------------------------------*/ + +void CallbackToolsSavePixmap( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( DrealFigureRds != (rdsfig_list *)NULL ) + { + DrealEnterDialog( &DrealToolsSavePixmapDialog ); + } + else + { + DrealErrorMessage( DrealMainWindow, "No current figure !" ); + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMT_menu.h b/alliance/src/dreal/src/GMT_menu.h new file mode 100644 index 00000000..3332014d --- /dev/null +++ b/alliance/src/dreal/src/GMT_menu.h @@ -0,0 +1,74 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MENU +# define DREAL_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackToolsMessage(); + extern void CallbackToolsFlatten(); + extern void CallbackToolsSavePixmap(); + +# endif diff --git a/alliance/src/dreal/src/GMT_message.c b/alliance/src/dreal/src/GMT_message.c new file mode 100644 index 00000000..3ef36d68 --- /dev/null +++ b/alliance/src/dreal/src/GMT_message.c @@ -0,0 +1,83 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Message.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMT.h" +# include "GMT_tools.h" +# include "GMT_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ diff --git a/alliance/src/dreal/src/GMT_message.h b/alliance/src/dreal/src/GMT_message.h new file mode 100644 index 00000000..68393e68 --- /dev/null +++ b/alliance/src/dreal/src/GMT_message.h @@ -0,0 +1,70 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Message.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MESSAGE +# define DREAL_MESSAGE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GMT_panel.c b/alliance/src/dreal/src/GMT_panel.c new file mode 100644 index 00000000..298cc463 --- /dev/null +++ b/alliance/src/dreal/src/GMT_panel.c @@ -0,0 +1,205 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMT.h" + +# include "GMT_panel.h" +# include "GMT_message.h" +# include "GMT_dialog.h" +# include "GMT_tools.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Panel | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Panel Message | +| | +\------------------------------------------------------------*/ + + DrealPanelButtonItem DrealToolsMessageButton[] = + + { + { + "Text", + "Nothing", NULL, 0, 0, + NULL, + NULL, + 0, 0, + 8, 9, + NULL, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Close", + NULL, NULL, 0, 0, + NULL, + NULL, + 3, 9, + 2, 1, + CallbackToolsCloseMessage, + (XtPointer)NULL, + (Widget)NULL + } + }; + + DrealPanelItem DrealToolsMessagePanel = + + { + "Message", + 1, + 0, + DREAL_TOOLS_MESSAGE_X, + DREAL_TOOLS_MESSAGE_Y, + 360, + 250, + 8, + 10, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 2, + DrealToolsMessageButton + }; + + int DrealToolsMessageDefaultValues[ 5 ] = + + { + DREAL_TOOLS_MESSAGE_X, + DREAL_TOOLS_MESSAGE_Y, + 360, 250, 0 + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback For Message | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackToolsCloseMessage | +| | +\------------------------------------------------------------*/ + +void CallbackToolsCloseMessage( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitPanel( &DrealToolsMessagePanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDisplayErrorMessage | +| | +\------------------------------------------------------------*/ + +void DrealDisplayToolsMessage() +{ + char *Message; + + rdsbegin(); + + Message = DrealGetErrorMessage(); + + if ( Message != (char *)NULL ) + { + XmTextSetString( DrealToolsMessageButton[0].BUTTON, Message ); + + DrealEnterPanel( &DrealToolsMessagePanel ); + } + else + { + XmTextSetString( DrealToolsMessageButton[0].BUTTON, "" ); + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMT_panel.h b/alliance/src/dreal/src/GMT_panel.h new file mode 100644 index 00000000..7fe6c9e4 --- /dev/null +++ b/alliance/src/dreal/src/GMT_panel.h @@ -0,0 +1,76 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_TOOLS_PANEL +# define DREAL_TOOLS_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_TOOLS_MESSAGE_X 330 +# define DREAL_TOOLS_MESSAGE_Y 280 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackToolsCloseMessage(); + +# endif diff --git a/alliance/src/dreal/src/GMT_tools.c b/alliance/src/dreal/src/GMT_tools.c new file mode 100644 index 00000000..c91ca7e9 --- /dev/null +++ b/alliance/src/dreal/src/GMT_tools.c @@ -0,0 +1,150 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Tools.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# ifdef AUTO_HAS_XPM +# include +# endif + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rfm.h" +# include "rpr.h" +# include "GTB.h" +# include "GSB.h" +# include "GMX.h" +# include "GRD.h" +# include "GMT.h" + +# include "GMT_tools.h" +# include "GMT_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealToolsFlatten | +| | +\------------------------------------------------------------*/ + +void DrealToolsFlatten() + +{ + rdsbegin(); + + if ( DrealFigureRds != (rdsfig_list *)NULL ) + { + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + DrealFlattenFigure(); + DrealComputeBound(); + DrealZoomRefresh(); + DrealDisplayToolsMessage(); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealToolsSavePixmap | +| | +\------------------------------------------------------------*/ + +void DrealToolsSavePixmap( FileName ) + + char *FileName; +{ +# ifdef AUTO_HAS_XPM + XpmAttributes Attribute; + char *XpmFileName; + int Error; + + XpmFileName = rdsallocblock( strlen( FileName ) + 4 ); + sprintf( XpmFileName, "%s.xpm", FileName ); + + Attribute.colormap = DrealColorMap; + Attribute.valuemask = XpmColormap; + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + Error = XpmWriteFileFromPixmap( DrealGraphicDisplay, + XpmFileName, + DrealGraphicPixmap, + (Pixmap)0, &Attribute ); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + if ( Error ) + { + DrealErrorMessage( DrealMainWindow, "Unable to save xpm file !" ); + } + + rdsfreeblock( XpmFileName ); +# else + + DrealErrorMessage( DrealMainWindow, "XPM cannot be used: Not enabled at compile time !" ); + +# endif +} diff --git a/alliance/src/dreal/src/GMT_tools.h b/alliance/src/dreal/src/GMT_tools.h new file mode 100644 index 00000000..2331c84c --- /dev/null +++ b/alliance/src/dreal/src/GMT_tools.h @@ -0,0 +1,74 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Tools.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_TOOLS +# define DREAL_TOOLS + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealToolsFlatten(); + extern void DrealToolsSavePixmap(); + + +# endif diff --git a/alliance/src/dreal/src/GMV.h b/alliance/src/dreal/src/GMV.h new file mode 100644 index 00000000..2ef001e1 --- /dev/null +++ b/alliance/src/dreal/src/GMV.h @@ -0,0 +1,125 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : GMV101.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GMV +# define DREAL_GMV + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char DrealFirstViewLayer; + +/*------------------------------------------------------------\ +| | +| Panel And Menu | +| | +\------------------------------------------------------------*/ + + extern DrealMenuItem DrealViewMenu[]; + extern DrealPanelItem DrealViewArrowsPanel; + extern DrealPanelItem DrealViewZoomPanel; + extern DrealPanelItem DrealViewGridPanel; + extern DrealPanelItem DrealViewLayerPanel; + extern DrealPanelItem DrealViewMapPanel; + + extern int DrealPercentZoom; + extern int DrealPercentMove; + + extern int DrealViewArrowsDefaultValues[5]; + extern int DrealViewZoomDefaultValues[5]; + extern int DrealViewLayerDefaultValues[5]; + extern int DrealViewGridDefaultValues[5]; + extern int DrealViewMapDefaultValues[5]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Zoom | +| | +\------------------------------------------------------------*/ + + extern void DrealComputeAndDisplayMap(); + extern void DrealInitializeZoom(); + extern void DrealBuildViewDialog(); + extern void DrealBuildPanelLayer(); + extern void DrealBuildPanelMap(); + extern void DrealInitializeMapEvent(); + + + extern void DrealZoomUndo(); + extern void DrealZoomLeft(); + extern void DrealZoomRight(); + extern void DrealZoomUp(); + extern void DrealZoomDown(); + extern void DrealZoomMore(); + extern void DrealZoomLess(); + extern void DrealZoomFit(); + extern void DrealZoomCenter(); + extern void DrealZoomRefresh(); + extern void DrealZoomIn(); + extern void DrealZoomPan(); + + extern void DrealPromptZoomIn(); + extern void DrealPromptZoomPan(); + extern void DrealPromptZoomCenter(); + +# endif diff --git a/alliance/src/dreal/src/GMV_dialog.c b/alliance/src/dreal/src/GMV_dialog.c new file mode 100644 index 00000000..62df6473 --- /dev/null +++ b/alliance/src/dreal/src/GMV_dialog.c @@ -0,0 +1,519 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GTB.h" +# include "GSB.h" +# include "GMX.h" +# include "GMV.h" + +# include "GMV_dialog.h" +# include "GMV_view.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Dialog Box | +| | +\------------------------------------------------------------*/ + + DrealDialogItem DrealViewZoomSetDialog = + + { + "Zoom set", + DREAL_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackViewZoomSetOk, + (XtPointer)NULL, + (void *)CallbackViewZoomSetCancel, + (XtPointer)NULL + }; + + DrealDialogItem DrealViewZoomGotoDialog = + + { + "Goto X,Y", + DREAL_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackViewZoomGotoOk, + (XtPointer)NULL, + (void *)CallbackViewZoomGotoCancel, + (XtPointer)NULL + }; + + DrealDialogItem DrealViewMoveSetDialog = + + { + "Move set", + DREAL_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackViewMoveSetOk, + (XtPointer)NULL, + (void *)CallbackViewMoveSetCancel, + (XtPointer)NULL + }; + + DrealDialogItem DrealViewGridXDialog = + + { + "Grid X", + DREAL_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackViewGridXOk, + (XtPointer)NULL, + (void *)CallbackViewGridXCancel, + (XtPointer)NULL + }; + + DrealDialogItem DrealViewGridYDialog = + + { + "Grid Y", + DREAL_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackViewGridYOk, + (XtPointer)NULL, + (void *)CallbackViewGridYCancel, + (XtPointer)NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Build Dialog Box | +| | +\------------------------------------------------------------*/ + +void DrealBuildViewDialog() + +{ + rdsbegin(); + + DrealBuildDialog( DrealMainWindow, &DrealViewZoomSetDialog ); + DrealBuildDialog( DrealMainWindow, &DrealViewZoomGotoDialog ); + DrealBuildDialog( DrealMainWindow, &DrealViewMoveSetDialog ); + DrealBuildDialog( DrealMainWindow, &DrealViewGridXDialog ); + DrealBuildDialog( DrealMainWindow, &DrealViewGridYDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Dialog | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackViewZoomSetOk | +| | +\------------------------------------------------------------*/ + +void CallbackViewZoomSetOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *ZoomSet; + int ZoomPercent; + + rdsbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &ZoomSet ); + + XtUnmanageChild( DrealViewZoomSetDialog.WIDGET ); + + DrealExitDialog(); + + if ( ZoomSet != (char *)NULL ) + { + ZoomPercent = atoi( ZoomSet ); + + if ( ( ZoomPercent < DREAL_PERCENT_ZOOM_MIN ) || + ( ZoomPercent > DREAL_PERCENT_ZOOM_MAX ) ) + { + DrealErrorMessage( DrealMainWindow, "The value must be between 5% and 95% !" ); + } + else + { + DrealPercentZoom = ZoomPercent; + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewZoomSetCancel | +| | +\------------------------------------------------------------*/ + +void CallbackViewZoomSetCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + rdsbegin(); + + XtUnmanageChild( DrealViewZoomSetDialog.WIDGET ); + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewZoomGotoOk | +| | +\------------------------------------------------------------*/ + +void CallbackViewZoomGotoOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *ZoomGoto; + int Index; + long GotoX; + long GotoY; + + rdsbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &ZoomGoto ); + + XtUnmanageChild( DrealViewZoomGotoDialog.WIDGET ); + + DrealExitDialog(); + + if ( ZoomGoto != (char *)NULL ) + { + for ( Index = 0; ZoomGoto[ Index ]; Index++ ) + { + if ( ZoomGoto[ Index ] == ',' ) + { + ZoomGoto[ Index ] = '\0'; + + if ( Index == 0 ) + { + GotoX = DrealLambdaGridX + ( DrealLambdaGridDx >> 1 ); + } + else + { + GotoX = atof( ZoomGoto ) / DREAL_PHYSICAL_GRID_TO_MICRON; + } + + if ( ZoomGoto[ Index + 1 ] == '\0' ) + { + GotoY = DrealLambdaGridY + ( DrealLambdaGridDy >> 1 ); + } + else + { + GotoY = atof( ZoomGoto + Index + 1 ) / DREAL_PHYSICAL_GRID_TO_MICRON; + } + + ZoomGoto = (char *)NULL; + + DrealZoomCenter( GotoX, GotoY ); + + break; + } + } + + if ( ZoomGoto != (char *)NULL ) + { + DrealErrorMessage( DrealMainWindow, "A coordinate must be specified !" ); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewZoomGotoCancel | +| | +\------------------------------------------------------------*/ + +void CallbackViewZoomGotoCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + rdsbegin(); + + XtUnmanageChild( DrealViewZoomGotoDialog.WIDGET ); + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewMoveSetOk | +| | +\------------------------------------------------------------*/ + +void CallbackViewMoveSetOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *MoveSet; + int MovePercent; + + rdsbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &MoveSet ); + + XtUnmanageChild( DrealViewMoveSetDialog.WIDGET ); + + DrealExitDialog(); + + if ( MoveSet != (char *)NULL ) + { + MovePercent = atoi( MoveSet ); + + if ( ( MovePercent < DREAL_PERCENT_MOVE_MIN ) || + ( MovePercent > DREAL_PERCENT_MOVE_MAX ) ) + { + DrealErrorMessage( DrealMainWindow, "The value must be between 5% and 95% !" ); + } + else + { + DrealPercentMove = MovePercent; + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewMoveSetCancel | +| | +\------------------------------------------------------------*/ + +void CallbackViewMoveSetCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + rdsbegin(); + + XtUnmanageChild( DrealViewMoveSetDialog.WIDGET ); + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewGridXOk | +| | +\------------------------------------------------------------*/ + +void CallbackViewGridXOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *GridSet; + int GridPercent; + + rdsbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &GridSet ); + + XtUnmanageChild( DrealViewGridXDialog.WIDGET ); + + DrealExitDialog(); + + if ( GridSet != (char *)NULL ) + { + GridPercent = atoi( GridSet ); + + if ( GridPercent < 2 ) + { + DrealErrorMessage( DrealMainWindow, "The value must be greater than one !" ); + } + else + { + DrealLambdaUserGridDx = GridPercent; + DrealZoomRefresh(); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewGridXCancel | +| | +\------------------------------------------------------------*/ + +void CallbackViewGridXCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + rdsbegin(); + + XtUnmanageChild( DrealViewGridXDialog.WIDGET ); + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewGridYOk | +| | +\------------------------------------------------------------*/ + +void CallbackViewGridYOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *GridSet; + int GridPercent; + + rdsbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &GridSet ); + + XtUnmanageChild( DrealViewGridYDialog.WIDGET ); + + DrealExitDialog(); + + if ( GridSet != (char *)NULL ) + { + GridPercent = atoi( GridSet ); + + if ( GridPercent < 2 ) + { + DrealErrorMessage( DrealMainWindow, "The value must be greater than one !" ); + } + else + { + DrealLambdaUserGridDy = GridPercent; + DrealZoomRefresh(); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewGridYCancel | +| | +\------------------------------------------------------------*/ + +void CallbackViewGridYCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + rdsbegin(); + + XtUnmanageChild( DrealViewGridYDialog.WIDGET ); + + DrealExitDialog(); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMV_dialog.h b/alliance/src/dreal/src/GMV_dialog.h new file mode 100644 index 00000000..71f81772 --- /dev/null +++ b/alliance/src/dreal/src/GMV_dialog.h @@ -0,0 +1,93 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_VIEW_DIALOG +# define DREAL_VIEW_DIALOG + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern DrealDialogItem DrealViewZoomSetDialog; + extern DrealDialogItem DrealViewZoomGotoDialog; + extern DrealDialogItem DrealViewMoveSetDialog; + extern DrealDialogItem DrealViewGridXDialog; + extern DrealDialogItem DrealViewGridYDialog; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback View Dialog | +| | +\------------------------------------------------------------*/ + + extern void CallbackViewZoomGotoOk(); + extern void CallbackViewZoomGotoCancel(); + extern void CallbackViewZoomSetOk(); + extern void CallbackViewZoomSetCancel(); + extern void CallbackViewMoveSetOk(); + extern void CallbackViewMoveSetCancel(); + extern void CallbackViewGridXOk(); + extern void CallbackViewGridXCancel(); + extern void CallbackViewGridYOk(); + extern void CallbackViewGridYCancel(); + +# endif diff --git a/alliance/src/dreal/src/GMV_map.c b/alliance/src/dreal/src/GMV_map.c new file mode 100644 index 00000000..6343e986 --- /dev/null +++ b/alliance/src/dreal/src/GMV_map.c @@ -0,0 +1,724 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Map.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GRD.h" +# include "GTB.h" +# include "GMX.h" +# include "GMV.h" + +# include "GMV_map.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + DrealPanelItem DrealViewMapPanel = + + { + "Map", + 1, + 0, + DREAL_VIEW_MAP_X, + DREAL_VIEW_MAP_Y, + 190, + 200, + 1, + 1, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 0, + (DrealPanelButtonItem *)NULL + }; + + int DrealViewMapDefaultValues[ 5 ] = + + { + DREAL_VIEW_MAP_X, + DREAL_VIEW_MAP_Y, + 190, 200, 0 + }; + +/*------------------------------------------------------------\ +| | +| Graphic Map Window | +| | +\------------------------------------------------------------*/ + + Widget DrealMapWindow; + Widget DrealMapButtonCompute; + Widget DrealMapButtonClose; + + Dimension DrealMapDx = 0; + Dimension DrealMapDy = 0; + + static char DrealFirstEnterMap = DREAL_TRUE; + static char DrealFirstExpose = DREAL_TRUE; + +/*------------------------------------------------------------\ +| | +| Lambda Map | +| | +\------------------------------------------------------------*/ + + float DrealLambdaMapStep; + + long DrealLambdaMapX; + long DrealLambdaMapY; + long DrealLambdaMapDx; + long DrealLambdaMapDy; + + long DrealBoundMapX; + long DrealBoundMapY; + long DrealBoundMapDx; + long DrealBoundMapDy; + + long DrealPixelMapX; + long DrealPixelMapY; + +/*------------------------------------------------------------\ +| | +| Expose | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Translation | +| | +\------------------------------------------------------------*/ + + static String DrealMapEventTranslation = + + ": CallbackMapEvent( 0 )\n\ + : CallbackMapEvent( 1 )\n\ + : CallbackMapEvent( 2 )"; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Event Callback | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackCloseMap | +| | +\------------------------------------------------------------*/ + +void CallbackCloseMap( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitPanel( &DrealViewMapPanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackMapCompute | +| | +\------------------------------------------------------------*/ + +void CallbackMapCompute( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealComputeAndDisplayMap(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackMapEvent | +| | +\------------------------------------------------------------*/ + +void CallbackMapEvent ( MyWidget, Event, Args, Argc ) + + Widget MyWidget; + XButtonEvent *Event; + String *Args; + int *Argc; +{ + Display *EventDisplay; + char MouseEvent; + long X; + long Y; + + rdsbegin(); + + EventDisplay = Event->display; + MouseEvent = Args[ 0 ][ 0 ] - '0'; + + X = Event->x; + Y = DrealMapDy - Event->y; + + X = X + DrealPixelMapX; + Y = Y + DrealPixelMapY; + + if ( X < 0 ) + { + X = ((float)(X) / DrealLambdaMapStep) - 0.5 ; + } + else + { + X = ((float)(X) / DrealLambdaMapStep) + 0.5 ; + } + + if ( Y < 0 ) + { + Y = ((float)(Y) / DrealLambdaMapStep) - 0.5 ; + } + else + { + Y = ((float)(Y) / DrealLambdaMapStep) + 0.5 ; + } + + switch ( MouseEvent ) + { + case DREAL_B1UP : + case DREAL_B2UP : + case DREAL_B3UP : + + DrealZoomCenter( X, Y ); + + break; + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackMapResize | +| | +\------------------------------------------------------------*/ + +void CallbackMapResize( MyWidget, ClientData, CallData ) + + Widget MyWidget; + XtPointer ClientData; + XmDrawingAreaCallbackStruct *CallData; +{ + rdsbegin(); + + if ( ! DrealFirstExpose ) + { + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + DrealResizeMapWindow(); + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackMapExpose | +| | +\------------------------------------------------------------*/ + +void CallbackMapExpose( MyWidget, ClientData, CallData ) + + Widget MyWidget; + XtPointer ClientData; + XmDrawingAreaCallbackStruct *CallData; +{ + XExposeEvent *ExposeEvent; + + rdsbegin(); + + ExposeEvent = (XExposeEvent *)CallData->event; + + if ( DrealFirstExpose ) + { + DrealFirstExpose = DREAL_FALSE; + + DrealInitializeMapWindow(); + } + + DrealRefreshMapWindow(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Initialize Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealsnitializeMapWindow | +| | +\------------------------------------------------------------*/ + +void DrealInitializeMapWindow() + +{ + rdsbegin(); + + XtVaGetValues( DrealMapWindow, + XmNwidth , &DrealMapDx, + XmNheight, &DrealMapDy, + NULL + ); + + DrealInitializeLambdaMap(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Graphic Window Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealRefreshMapWindow | +| | +\------------------------------------------------------------*/ + +void DrealRefreshMapWindow() +{ + rdsbegin(); + + DrealClearMapWindow(); + DrealDisplayLambdaMap(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealClearMapWindow | +| | +\------------------------------------------------------------*/ + +void DrealClearMapWindow() + +{ + XFillRectangle( XtDisplay( DrealMapWindow ), + XtWindow( DrealMapWindow ), + DrealBackgroundGC, + 0, 0, DrealMapDx, DrealMapDy ); +} + +/*------------------------------------------------------------\ +| | +| DrealResizeMapWindow | +| | +\------------------------------------------------------------*/ + +void DrealResizeMapWindow() + +{ + XtVaGetValues( DrealMapWindow, + XmNwidth, &DrealMapDx, + XmNheight, &DrealMapDy, + NULL + ); + + DrealComputeAndDisplayMap(); +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeMapEvent | +| | +\------------------------------------------------------------*/ + +void DrealInitializeMapEvent() + +{ + XtActionsRec NewActions; + + XtVaSetValues( DrealMapWindow, + XmNtranslations, + XtParseTranslationTable( DrealMapEventTranslation ), + NULL + ); + + NewActions.string = "CallbackMapEvent"; + NewActions.proc = CallbackMapEvent; + + XtAppAddActions( DrealApplication, &NewActions, 1 ); + + XtAddCallback( DrealMapWindow, + XmNresizeCallback, + CallbackMapResize, NULL ); + + XtAddCallback( DrealMapWindow, + XmNexposeCallback, + CallbackMapExpose, NULL ); +} + +/*------------------------------------------------------------\ +| | +| Lambda Map Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealInitializeLambdaMap | +| | +\------------------------------------------------------------*/ + +void DrealInitializeLambdaMap() + +{ + if ( ! DrealComputeBound() ) + { + DrealBoundMapX = DREAL_DEFAULT_MAP_X; + DrealBoundMapY = DREAL_DEFAULT_MAP_Y; + DrealBoundMapDx = DREAL_DEFAULT_MAP_DX; + DrealBoundMapDy = DREAL_DEFAULT_MAP_DY; + } + else + { + DrealBoundMapX = DrealBoundXmin / RDS_PHYSICAL_GRID; + DrealBoundMapY = DrealBoundYmin / RDS_PHYSICAL_GRID; + DrealBoundMapDx = DrealBoundXmax / RDS_PHYSICAL_GRID; + DrealBoundMapDy = DrealBoundYmax / RDS_PHYSICAL_GRID; + DrealBoundMapDx = DrealBoundMapDx - DrealBoundMapX; + DrealBoundMapDy = DrealBoundMapDy - DrealBoundMapY; + } + + DrealLambdaMapX = DrealBoundMapX - 2; + DrealLambdaMapY = DrealBoundMapY - 2; + DrealLambdaMapDx = DrealBoundMapDx + 4; + DrealLambdaMapDy = DrealBoundMapDy + 4; + + DrealComputeLambdaMap(); +} + +/*------------------------------------------------------------\ +| | +| DrealComputeLambdaMap | +| | +\------------------------------------------------------------*/ + +void DrealComputeLambdaMap() + +{ + long Delta; + float StepX; + float StepY; + + StepX = (float)(DrealMapDx) / (float)(DrealLambdaMapDx); + StepY = (float)(DrealMapDy) / (float)(DrealLambdaMapDy); + + if ( StepX < StepY ) + { + DrealLambdaMapStep = StepX; + Delta = DrealLambdaMapDy; + DrealLambdaMapDy = 1 + ( DrealMapDy / StepX ); + Delta = ( DrealLambdaMapDy - Delta ) >> 1; + DrealLambdaMapY = DrealLambdaMapY - Delta; + } + else + { + DrealLambdaMapStep = StepY; + Delta = DrealLambdaMapDx; + DrealLambdaMapDx = 1 + ( DrealMapDx / StepY ); + Delta = ( DrealLambdaMapDx - Delta ) >> 1; + DrealLambdaMapX = DrealLambdaMapX - Delta; + } + + DrealPixelMapX = (float)(DrealLambdaMapX) * DrealLambdaMapStep; + DrealPixelMapY = (float)(DrealLambdaMapY) * DrealLambdaMapStep; +} + +/*------------------------------------------------------------\ +| | +| DrealDisplayLambdaMap | +| | +\------------------------------------------------------------*/ + +void DrealDisplayLambdaMap() +{ + long X1; + long Y1; + long X2; + long Y2; + + X1 = (float)( DrealBoundMapX ) * DrealLambdaMapStep; + Y1 = (float)( DrealBoundMapY ) * DrealLambdaMapStep; + X2 = (float)( DrealBoundMapX + DrealBoundMapDx ) * DrealLambdaMapStep; + Y2 = (float)( DrealBoundMapY + DrealBoundMapDy ) * DrealLambdaMapStep; + + X1 = X1 - DrealPixelMapX; + X2 = X2 - DrealPixelMapX; + Y1 = Y1 - DrealPixelMapY; + Y2 = Y2 - DrealPixelMapY; + + XDrawRectangle( XtDisplay( DrealMapWindow ), + XtWindow( DrealMapWindow ), + DrealLargeTextGC, + X1, DrealMapDy - Y2, + X2 - X1, Y2 - Y1 ); + + X1 = DrealLambdaGridX + ( DrealLambdaGridDx >> 1 ); + Y1 = DrealLambdaGridY + ( DrealLambdaGridDy >> 1 ); + X1 = (float)( X1 ) * DrealLambdaMapStep; + Y1 = (float)( Y1 ) * DrealLambdaMapStep; + + X1 = X1 - DrealPixelMapX; + Y1 = Y1 - DrealPixelMapY; + Y1 = DrealMapDy - Y1; + + if ( ( X1 > 0 ) && + ( Y1 > 0 ) && + ( X1 < DrealMapDx ) && + ( Y1 < DrealMapDy ) ) + { + XDrawLine( XtDisplay( DrealMapWindow ), + XtWindow( DrealMapWindow ), + DrealLargeTextGC, + X1 - 2, Y1, + X1 + 2, Y1 ); + + XDrawLine( XtDisplay( DrealMapWindow ), + XtWindow( DrealMapWindow ), + DrealLargeTextGC, + X1, Y1 - 2, + X1, Y1 + 2 ); + } +} + +/*------------------------------------------------------------\ +| | +| DrealBuildPanelMap | +| | +\------------------------------------------------------------*/ + +void DrealBuildPanelMap() +{ + Arg Args[3]; + + XtSetArg( Args[0], XmNshadowType , XmSHADOW_ETCHED_IN ); + XtSetArg( Args[1], XmNdeleteResponse, XmDO_NOTHING ); + XtSetArg( Args[2], XmNtitle , DrealViewMapPanel.TITLE ); + + DrealViewMapPanel.PANEL = + + XmCreateFormDialog( DrealMainWindow, "DrealViewMapPanel", Args, 3); + + XtAddCallback( DrealViewMapPanel.PANEL, XmNdestroyCallback, + DrealDestroyDialogCallback, NULL ); + + DrealViewMapPanel.PANEL_FORM = + + XtVaCreateManagedWidget( "DrealViewMapPanelForm", + xmFormWidgetClass, + DrealViewMapPanel.PANEL, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNfractionBase , 100, + NULL + ); + + DrealViewMapPanel.FRAME = + + XtVaCreateManagedWidget( "DrealViewMapFrame", + xmFrameWidgetClass, + DrealViewMapPanel.PANEL_FORM, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + NULL + ); + + DrealViewMapPanel.FORM = + + XtVaCreateManagedWidget( "DrealViewMapForm", + xmFormWidgetClass, + DrealViewMapPanel.FRAME, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNfractionBase , 100, + NULL + ); + + DrealMapButtonCompute = + + XtVaCreateManagedWidget( "Compute", + xmPushButtonWidgetClass, + DrealViewMapPanel.FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 1, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 44, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 89, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 99, + NULL + ); + DrealMapButtonClose = + + XtVaCreateManagedWidget( "Close", + xmPushButtonWidgetClass, + DrealViewMapPanel.FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 45, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 99, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 89, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 99, + NULL + ); + + DrealMapWindow = + + XtVaCreateManagedWidget( "DrealMapWindow", + xmDrawingAreaWidgetClass, + DrealViewMapPanel.FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 1, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 99, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 1, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 88, + XmNbackground , 1, + XmNforeground , 0, + NULL + ); + + XtAddCallback( DrealMapButtonCompute, + XmNactivateCallback, + CallbackMapCompute, NULL ); + + XtAddCallback( DrealMapButtonClose, + XmNactivateCallback, + CallbackCloseMap, NULL ); + + XtVaSetValues( DrealViewMapPanel.PANEL, + XmNheight, DrealViewMapPanel.HEIGHT, + XmNwidth , DrealViewMapPanel.WIDTH, + XmNx , DrealViewMapPanel.X, + XmNy , DrealViewMapPanel.Y, + NULL ); +} + +/*------------------------------------------------------------\ +| | +| DrealEnterMapPanel | +| | +\------------------------------------------------------------*/ + +void DrealEnterMapPanel() + +{ + DrealFirstEnterMap = DREAL_FALSE; + + DrealEnterPanel( &DrealViewMapPanel ); +} + +/*------------------------------------------------------------\ +| | +| DrealComputeAndDisplayMap | +| | +\------------------------------------------------------------*/ + +void DrealComputeAndDisplayMap() + +{ + if ( ! DrealFirstEnterMap ) + { + DrealInitializeLambdaMap(); + DrealClearMapWindow(); + DrealDisplayLambdaMap(); + } +} diff --git a/alliance/src/dreal/src/GMV_map.h b/alliance/src/dreal/src/GMV_map.h new file mode 100644 index 00000000..d43e268c --- /dev/null +++ b/alliance/src/dreal/src/GMV_map.h @@ -0,0 +1,101 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Map.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MAP +# define DREAL_MAP + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_B1UP 0 +# define DREAL_B2UP 1 +# define DREAL_B3UP 2 + +# define DREAL_VIEW_MAP_X 25 +# define DREAL_VIEW_MAP_Y 520 + +# define DREAL_DEFAULT_MAP_X 0 +# define DREAL_DEFAULT_MAP_Y 0 +# define DREAL_DEFAULT_MAP_DX 40 +# define DREAL_DEFAULT_MAP_DY 40 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern Widget DrealMapPanel; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealComputeLambdaMap(); + extern void DrealInitializeLambdaMap(); + extern void DrealDisplayLambdaMap(); + + extern void DrealEnterMapPanel(); + extern void DrealClearMapWindow(); + extern void DrealResizeMapWindow(); + extern void DrealRefreshMapWindow(); + extern void DrealInitializeMapWindow(); + + extern void CallbackCloseMap(); + extern void CallbackMapResize(); + extern void CallbackMapExpose(); + extern void CallbackMapEvent(); + +# endif diff --git a/alliance/src/dreal/src/GMV_menu.c b/alliance/src/dreal/src/GMV_menu.c new file mode 100644 index 00000000..5c339bb5 --- /dev/null +++ b/alliance/src/dreal/src/GMV_menu.c @@ -0,0 +1,283 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GTB.h" +# include "GSB.h" +# include "GMX.h" +# include "GMV.h" + +# include "GMV_menu.h" +# include "GMV_dialog.h" +# include "GMV_view.h" +# include "GMV_map.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + char DrealFirstViewLayer = 1; + +/*------------------------------------------------------------\ +| | +| Menu | +| | +\------------------------------------------------------------*/ + + DrealMenuItem DrealViewMenu[] = + + { + { + "Zoom", + 'Z', + "MetaZ", + "Meta Z", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackViewZoom, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Layers", + 'L', + "MetaL", + "Meta L", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackViewLayers, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Map", + 'M', + "MetaP", + "Meta P", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackViewMap, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Arrows", + 'A', + "MetaA", + "Meta A", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackViewArrows, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + { + "Grid ", + 'G', + "MetaG", + "Meta G", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackViewGrid, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (DrealMenuItem *)NULL + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback For Menu | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackViewLayers | +| | +\------------------------------------------------------------*/ + +void CallbackViewLayers( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( DrealFirstViewLayer ) + { + DrealInitializeLayer(); + + DrealFirstViewLayer = 0; + } + + DrealEnterPanel( &DrealViewLayerPanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewGrid | +| | +\------------------------------------------------------------*/ + +void CallbackViewGrid( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterPanel( &DrealViewGridPanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewArrows | +| | +\------------------------------------------------------------*/ + +void CallbackViewArrows( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterPanel( &DrealViewArrowsPanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewZoom | +| | +\------------------------------------------------------------*/ + +void CallbackViewZoom( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterPanel( &DrealViewZoomPanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewMap | +| | +\------------------------------------------------------------*/ + +void CallbackViewMap( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterMapPanel(); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMV_menu.h b/alliance/src/dreal/src/GMV_menu.h new file mode 100644 index 00000000..f0780a18 --- /dev/null +++ b/alliance/src/dreal/src/GMV_menu.h @@ -0,0 +1,82 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 25/02/93 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_VIEW_MENU +# define DREAL_VIEW_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback View Menu | +| | +\------------------------------------------------------------*/ + + + extern void CallbackViewLayers(); + extern void CallbackViewZoom(); + extern void CallbackViewGrid(); + extern void CallbackViewMap(); + extern void CallbackViewArrows(); + +# endif diff --git a/alliance/src/dreal/src/GMV_message.c b/alliance/src/dreal/src/GMV_message.c new file mode 100644 index 00000000..912bdd7f --- /dev/null +++ b/alliance/src/dreal/src/GMV_message.c @@ -0,0 +1,163 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Message.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GSB.h" +# include "GMV.h" +# include "GMV_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static char MessageBuffer[ 512 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealPromptZoomIn | +| | +\------------------------------------------------------------*/ + +void DrealPromptZoomIn() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE, "Zoom In" ); + DrealDisplayMessage( DREAL_MESSAGE_INFO, "Select window" ); + + switch ( DrealCountEventZoom ) + { + case 0 : + + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter first corner" ); + + break; + + case 1 : + + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter second corner" ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptZoomPan | +| | +\------------------------------------------------------------*/ + +void DrealPromptZoomPan() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE, "Zoom Pan" ); + DrealDisplayMessage( DREAL_MESSAGE_INFO, "Select line" ); + + switch ( DrealCountEventZoom ) + { + case 0 : + + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter source point" ); + + break; + + case 1 : + + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter target point" ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptZoomCenter | +| | +\------------------------------------------------------------*/ + +void DrealPromptZoomCenter() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE, "Zoom Center" ); + DrealDisplayMessage( DREAL_MESSAGE_INFO, "Select point" ); + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter center point" ); + + rdsend(); +} + diff --git a/alliance/src/dreal/src/GMV_message.h b/alliance/src/dreal/src/GMV_message.h new file mode 100644 index 00000000..e5c4e158 --- /dev/null +++ b/alliance/src/dreal/src/GMV_message.h @@ -0,0 +1,74 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Message.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MESSAGE +# define DREAL_MESSAGE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealPromptZoomIn(); + extern void DrealPromptZoomCenter(); + extern void DrealPromptZoomPan(); + +# endif diff --git a/alliance/src/dreal/src/GMV_panel.c b/alliance/src/dreal/src/GMV_panel.c new file mode 100644 index 00000000..90714651 --- /dev/null +++ b/alliance/src/dreal/src/GMV_panel.c @@ -0,0 +1,3931 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GTB.h" +# include "GMX.h" +# include "GMV.h" + +# include "GMV_panel.h" +# include "GMV_dialog.h" +# include "GMV_view.h" +# include "GMV_message.h" +# include "GMX_color.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Panel Pixmap | +| | +\------------------------------------------------------------*/ + + static char DrealPixmapDownArrow[] = + + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfe, 0xff, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x02, 0x80, 0x00, + 0x00, 0x02, 0x80, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x02, 0x80, 0x00, + 0x00, 0x02, 0x80, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x02, 0x80, 0x00, + 0xf0, 0x03, 0x80, 0x1f, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, + 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00, 0x08, + 0x40, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, + 0x00, 0x02, 0x80, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x08, 0x20, 0x00, + 0x00, 0x10, 0x10, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x40, 0x04, 0x00, + 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char DrealPixmapLeftArrow[] = + + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x0f, 0x00, 0x00, 0x40, 0x08, 0x00, 0x00, 0x20, 0x08, 0x00, + 0x00, 0x10, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04, 0xf8, 0x1f, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x80, 0x00, 0x00, 0x10, + 0x40, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, + 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00, 0x10, + 0x40, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, + 0x00, 0x02, 0x00, 0x10, 0x00, 0x04, 0xf8, 0x1f, 0x00, 0x08, 0x08, 0x00, + 0x00, 0x10, 0x08, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x40, 0x08, 0x00, + 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char DrealPixmapRightArrow[] = + + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xf0, 0x01, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x10, 0x04, 0x00, + 0x00, 0x10, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0xf8, 0x1f, 0x20, 0x00, + 0x08, 0x00, 0x40, 0x00, 0x08, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00, 0x01, + 0x08, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x04, 0x08, 0x00, 0x00, 0x08, + 0x08, 0x00, 0x00, 0x10, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04, + 0x08, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x01, 0x08, 0x00, 0x80, 0x00, + 0x08, 0x00, 0x40, 0x00, 0xf8, 0x1f, 0x20, 0x00, 0x00, 0x10, 0x10, 0x00, + 0x00, 0x10, 0x08, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x10, 0x02, 0x00, + 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char DrealPixmapUpArrow[] = + + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x20, 0x02, 0x00, + 0x00, 0x10, 0x04, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x04, 0x10, 0x00, + 0x00, 0x02, 0x20, 0x00, 0x00, 0x01, 0x40, 0x00, 0x80, 0x00, 0x80, 0x00, + 0x40, 0x00, 0x00, 0x01, 0x20, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x04, + 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, + 0x08, 0x00, 0x00, 0x08, 0xf8, 0x01, 0xc0, 0x0f, 0x00, 0x01, 0x40, 0x00, + 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x40, 0x00, + 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x40, 0x00, + 0x00, 0x01, 0x40, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + +/*------------------------------------------------------------\ +| | +| Panel Arrows | +| | +\------------------------------------------------------------*/ + + static DrealPanelButtonItem DrealViewArrowsButton[] = + + { + { + "Left", + NULL, DrealPixmapLeftArrow, 32, 32, + NULL, + NULL, + 0, 0, + 1, 2, + CallbackLeftArrow, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Up", + NULL, DrealPixmapUpArrow, 32, 32, + NULL, + NULL, + 1, 0, + 1, 2, + CallbackUpArrow, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Down", + NULL, DrealPixmapDownArrow, 32, 32, + NULL, + NULL, + 0, 2, + 1, 2, + CallbackDownArrow, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Right", + NULL, DrealPixmapRightArrow, 32, 32, + NULL, + NULL, + 1, 2, + 1, 2, + CallbackRightArrow, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Move Set", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 4, + 2, 1, + CallbackMoveSet, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Close", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 5, + 2, 1, + CallbackCloseArrows, + (XtPointer)NULL, + (Widget)NULL + } + }; + + DrealPanelItem DrealViewArrowsPanel = + + { + "Arrows", + 1, + 1, + DREAL_VIEW_ARROWS_X, + DREAL_VIEW_ARROWS_Y, + 90, + 125, + 2, + 6, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 6, + DrealViewArrowsButton + }; + + int DrealViewArrowsDefaultValues[ 5 ] = + + { + DREAL_VIEW_ARROWS_X, + DREAL_VIEW_ARROWS_Y, + 90, 125, 1 + }; + +/*------------------------------------------------------------\ +| | +| Panel Zoom | +| | +\------------------------------------------------------------*/ + + DrealPanelButtonItem DrealViewZoomButton[] = + + { + { + "Refresh", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackZoomRefresh, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "UnZoom", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 1, + 1, 1, + CallbackZoomPrevious, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Zoom", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 2, + 1, 1, + CallbackZoomMore, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Mooz", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 3, + 1, 1, + CallbackZoomLess, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Zoom Set", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 4, + 1, 1, + CallbackZoomSet, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Zoom In", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 5, + 1, 1, + CallbackZoomIn, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Center", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 6, + 1, 1, + CallbackZoomCenter, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Goto", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 7, + 1, 1, + CallbackZoomGoto, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Pan", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 8, + 1, 1, + CallbackZoomPan, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Fit", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 9, + 1, 1, + CallbackZoomFit, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Close", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 10, + 1, 1, + CallbackCloseZoom, + (XtPointer)NULL, + (Widget)NULL + } + }; + + DrealPanelItem DrealViewZoomPanel = + + { + "Zoom", + 1, + 1, + DREAL_VIEW_ZOOM_X, + DREAL_VIEW_ZOOM_Y, + 90, + 275, + 1, + 11, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 11, + DrealViewZoomButton + }; + + int DrealViewZoomDefaultValues[ 5 ] = + + { + DREAL_VIEW_ZOOM_X, + DREAL_VIEW_ZOOM_Y, + 90, 275, 1 + }; + +/*------------------------------------------------------------\ +| | +| Panel Layer | +| | +\------------------------------------------------------------*/ + + static char *DrealViewLayerFillModeName[] = + + { + "Outline", + "Fill", + "Pattern" + }; + + static char *DrealViewLayerInterfaceName[] = + + { + "No interface", + "Interface" + }; + + static char *DrealViewLayerCursorType[] = + + { + "Invert", + "Xor" + }; + + static char *DrealViewLayerForceDisplay[] = + + { + "Quick display", + "Force display" + }; + + static char *DrealViewLayerBlackBoxString[] = + + { + "No string box", + "String box" + }; + + DrealPanelButtonItem DrealViewLayerButton[ ( RDS_ALL_LAYER << 1 ) + + ( DREAL_MAX_ACTIVE_NAME << 1 ) + 10 ] = + { + { + "All visible", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 2, 1, + CallbackLayerAllVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "All invisible", + NULL, NULL, 0, 0, + NULL, + NULL, + 2, 0, + 2, 1, + CallbackLayerAllInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Fig", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameVisible, + (XtPointer)DREAL_FIGURE_NAME, + (Widget)NULL + } + , + { + "Fig", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameInvisible, + (XtPointer)DREAL_FIGURE_NAME, + (Widget)NULL + } + , + { + "Inst", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameVisible, + (XtPointer)DREAL_INSTANCE_NAME, + (Widget)NULL + } + , + { + "Inst", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameInvisible, + (XtPointer)DREAL_INSTANCE_NAME, + (Widget)NULL + } + , + { + "FCon", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameVisible, + (XtPointer)DREAL_FIGURE_CONNECTOR_NAME, + (Widget)NULL + } + , + { + "FCon", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameInvisible, + (XtPointer)DREAL_FIGURE_CONNECTOR_NAME, + (Widget)NULL + } + , + { + "ICon", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameVisible, + (XtPointer)DREAL_INSTANCE_CONNECTOR_NAME, + (Widget)NULL + } + , + { + "ICon", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameInvisible, + (XtPointer)DREAL_INSTANCE_CONNECTOR_NAME, + (Widget)NULL + } + , + { + "FSeg", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameVisible, + (XtPointer)DREAL_FIGURE_SEGMENT_NAME, + (Widget)NULL + } + , + { + "FSeg", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameInvisible, + (XtPointer)DREAL_FIGURE_SEGMENT_NAME, + (Widget)NULL + } + , + { + "ISeg", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameVisible, + (XtPointer)DREAL_INSTANCE_SEGMENT_NAME, + (Widget)NULL + } + , + { + "ISeg", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameInvisible, + (XtPointer)DREAL_INSTANCE_SEGMENT_NAME, + (Widget)NULL + } + , + { + "FRef", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameVisible, + (XtPointer)DREAL_FIGURE_REFERENCE_NAME, + (Widget)NULL + } + , + { + "FRef", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameInvisible, + (XtPointer)DREAL_FIGURE_REFERENCE_NAME, + (Widget)NULL + } + , + { + "IRef", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameVisible, + (XtPointer)DREAL_INSTANCE_REFERENCE_NAME, + (Widget)NULL + } + , + { + "IRef", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackNameInvisible, + (XtPointer)DREAL_INSTANCE_REFERENCE_NAME, + (Widget)NULL + } + , + { + "Pattern", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 2, 1, + CallbackLayerFillMode, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Interface", + NULL, NULL, 0, 0, + NULL, + NULL, + 2, 0, + 2, 1, + CallbackLayerInterface, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Invert", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 2, 1, + CallbackLayerCursor, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Quick display", + NULL, NULL, 0, 0, + NULL, + NULL, + 2, 0, + 2, 1, + CallbackLayerForceDisplay, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "No string box", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 2, 1, + CallbackLayerBlackBoxString, + (XtPointer)NULL, + (Widget)NULL + } + , + { + NULL, + NULL, NULL, 0, 0, + NULL, + NULL, + 2, 0, + 2, 1, + CallbackLayerCursor, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Apply", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 2, 1, + CallbackLayerApply, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Close", + NULL, NULL, 0, 0, + NULL, + NULL, + 2, 0, + 2, 1, + CallbackCloseLayer, + (XtPointer)NULL, + (Widget)NULL + } + }; + + + DrealPanelItem DrealViewLayerPanel = + + { + "Layer", + 1, + 0, + DREAL_VIEW_LAYER_X, + DREAL_VIEW_LAYER_Y, + 180, + 550, + 4, + 23, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + ( RDS_ALL_LAYER << 1 ) + + ( DREAL_MAX_ACTIVE_NAME << 1 ) + 10, + DrealViewLayerButton + }; + + int DrealViewLayerDefaultValues[ 5 ] = + + { + DREAL_VIEW_LAYER_X, + DREAL_VIEW_LAYER_Y, + 180, 550, 0 + }; + + static char FirstEnterLayerPanel = 1; + +/*------------------------------------------------------------\ +| | +| Panel Grid | +| | +\------------------------------------------------------------*/ + + DrealPanelButtonItem DrealViewGridButton[] = + + { + { + "Grid X", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackSetGridX, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Grid Y", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 1, + 1, 1, + CallbackSetGridY, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Grid Off", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 2, + 1, 1, + CallbackGridOnOff, + (XtPointer)NULL, + (Widget)NULL + } + , + { + "Close", + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 3, + 1, 1, + CallbackCloseGrid, + (XtPointer)NULL, + (Widget)NULL + } + }; + + DrealPanelItem DrealViewGridPanel = + + { + "Grid", + 1, + 0, + DREAL_VIEW_GRID_X, + DREAL_VIEW_GRID_Y, + 90, + 100, + 1, + 4, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + 4, + DrealViewGridButton + }; + + int DrealViewGridDefaultValues[ 5 ] = + + { + DREAL_VIEW_GRID_X, + DREAL_VIEW_GRID_Y, + 90, 100, 0 + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealBuildPanelLayer | +| | +\------------------------------------------------------------*/ + +void DrealBuildPanelLayer() +{ + DrealPanelButtonItem *Button; + unsigned char Visible; + long Layer; + unsigned char Index; + unsigned char X1; + unsigned char Y1; + + X1 = 0; + Y1 = 1; + Index = 2; + + for ( Layer = 0; Layer < RDS_ALL_LAYER; Layer++ ) + { + if ( ( DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 0 ] != NULL ) && + ( RDS_DYNAMIC_LAYER[ Layer ] != RDS_LAYER_UNUSED ) ) + { + for ( Visible = 0; Visible < 2; Visible++ ) + { + Button = &DrealViewLayerButton[ Index + Visible ]; + + Button->LABEL = DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 0 ]; + Button->FOREGROUND = DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 1 ]; + Button->BACKGROUND = DREAL_RDS_LAYER_NAME_TABLE[ Layer ][ 2 ]; + + Button->X = X1; + Button->Y = Y1; + Button->CALLDATA = (XtPointer)Layer; + + if ( X1 == 3 ) + { + X1 = 0; Y1 = Y1 + 1; + } + else + { + X1 = X1 + 1; + } + } + } + + Index = Index + 2; + } + + if ( X1 > 0 ) + { + X1 = 0; + Y1 = Y1 + 1; + } + + for ( Layer = 0; Layer < DREAL_MAX_ACTIVE_NAME; Layer++ ) + { + for ( Visible = 0; Visible < 2; Visible++ ) + { + Button = &DrealViewLayerButton[ Index + Visible ]; + + Button->X = X1; + Button->Y = Y1; + + Button->FOREGROUND = "White"; + Button->BACKGROUND = "Black"; + + + if ( X1 == 3 ) + { + X1 = 0; Y1 = Y1 + 1; + } + else + { + X1 = X1 + 1; + } + } + + Index = Index + 2; + } + + if ( X1 > 0 ) Y1 = Y1 + 1; + + for ( Layer = 0; Layer < 4; Layer++ ) + { + DrealViewLayerButton[ Index ].Y = Y1;; + DrealViewLayerButton[ Index + 1 ].Y = Y1;; + + Index = Index + 2; + Y1 = Y1 + 1; + } + + DrealViewLayerPanel.ROW = Y1; + DrealViewLayerDefaultValues[ 3 ] = Y1 * 25; +} + +/*------------------------------------------------------------\ +| | +| Callback For Arrows | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackLeftArrow | +| | +\------------------------------------------------------------*/ + +void CallbackLeftArrow( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealZoomLeft(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackRightArrow | +| | +\------------------------------------------------------------*/ + +void CallbackRightArrow( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealZoomRight(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackUpArrow | +| | +\------------------------------------------------------------*/ + +void CallbackUpArrow( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealZoomUp(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackDownArrow | +| | +\------------------------------------------------------------*/ + +void CallbackDownArrow( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealZoomDown(); + + rdsend(); +} + + +/*------------------------------------------------------------\ +| | +| CallbackMoveSet | +| | +\------------------------------------------------------------*/ + +void CallbackMoveSet( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterDialog( &DrealViewMoveSetDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackCloseArrows | +| | +\------------------------------------------------------------*/ + +void CallbackCloseArrows( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitPanel( &DrealViewArrowsPanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Zoom Callback | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackZoomRefresh | +| | +\------------------------------------------------------------*/ + +void CallbackZoomRefresh( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealZoomRefresh(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomPrevious | +| | +\------------------------------------------------------------*/ + +void CallbackZoomPrevious( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealZoomUndo(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomLess | +| | +\------------------------------------------------------------*/ + +void CallbackZoomLess( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealZoomLess(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomMore | +| | +\------------------------------------------------------------*/ + +void CallbackZoomMore( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealZoomMore(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomSet | +| | +\------------------------------------------------------------*/ + +void CallbackZoomSet( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterDialog( &DrealViewZoomSetDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackCloseZoom | +| | +\------------------------------------------------------------*/ + +void CallbackCloseZoom( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitPanel( &DrealViewZoomPanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomIn | +| | +\------------------------------------------------------------*/ + +void CallbackZoomIn( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealChangeEditMode( DREAL_ZOOM_IN, + DrealPromptZoomIn ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomCenter | +| | +\------------------------------------------------------------*/ + +void CallbackZoomCenter( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealChangeEditMode( DREAL_ZOOM_CENTER, + DrealPromptZoomCenter ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomGoto | +| | +\------------------------------------------------------------*/ + +void CallbackZoomGoto( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterDialog( &DrealViewZoomGotoDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomPan | +| | +\------------------------------------------------------------*/ + +void CallbackZoomPan( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealChangeEditMode( DREAL_ZOOM_PAN, + DrealPromptZoomPan ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomFit | +| | +\------------------------------------------------------------*/ + +void CallbackZoomFit( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealZoomFit(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Layer | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackLayerAllVisible | +| | +\------------------------------------------------------------*/ + +void CallbackLayerAllVisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealLayerAllVisible(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerAllInvisible | +| | +\------------------------------------------------------------*/ + +void CallbackLayerAllInvisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealLayerAllInvisible(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerVisible | +| | +\------------------------------------------------------------*/ + +void CallbackLayerVisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( DREAL_RDS_ACTIVE_LAYER_TABLE[ (long)ClientData ] == 0 ) + { + DrealSetLayerVisible( (long)ClientData ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackNameVisible | +| | +\------------------------------------------------------------*/ + +void CallbackNameVisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( DREAL_RDS_ACTIVE_NAME_TABLE[ (long)ClientData ] == 0 ) + { + DrealSetNameVisible( (long)ClientData ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerInvisible | +| | +\------------------------------------------------------------*/ + +void CallbackLayerInvisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( DREAL_RDS_ACTIVE_LAYER_TABLE[ (long)ClientData ] == 1 ) + { + DrealSetLayerInvisible( (long)ClientData ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackNameInvisible | +| | +\------------------------------------------------------------*/ + +void CallbackNameInvisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + if ( DREAL_RDS_ACTIVE_NAME_TABLE[ (long)ClientData ] == 1 ) + { + DrealSetNameInvisible( (long)ClientData ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerFillMode | +| | +\------------------------------------------------------------*/ + +void CallbackLayerFillMode( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DREAL_FILL_MODE = ( DREAL_FILL_MODE + 1 ) % 3; + + DrealChangeFillMode( DREAL_FILL_MODE ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerInterface | +| | +\------------------------------------------------------------*/ + +void CallbackLayerInterface( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DREAL_INSTANCE_INTERFACE = ! DREAL_INSTANCE_INTERFACE; + DrealChangeInterface( DREAL_INSTANCE_INTERFACE ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerCursor | +| | +\------------------------------------------------------------*/ + +void CallbackLayerCursor( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DREAL_XOR_CURSOR = ! DREAL_XOR_CURSOR; + DrealChangeCursor( DREAL_XOR_CURSOR ); + + DrealChangeCursorContext(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerForceDisplay | +| | +\------------------------------------------------------------*/ + +void CallbackLayerForceDisplay( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DREAL_FORCE_DISPLAY = ! DREAL_FORCE_DISPLAY; + DrealChangeForceDisplay( DREAL_FORCE_DISPLAY ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerBlackBoxString | +| | +\------------------------------------------------------------*/ + +void CallbackLayerBlackBoxString( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DREAL_BLACK_BOX_STRING = ! DREAL_BLACK_BOX_STRING; + DrealChangeBlackBoxString( DREAL_BLACK_BOX_STRING ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerApply | +| | +\------------------------------------------------------------*/ + +void CallbackLayerApply( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealZoomRefresh(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackCloseLayer | +| | +\------------------------------------------------------------*/ + +void CallbackCloseLayer( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitPanel( &DrealViewLayerPanel ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealChangeFillMode | +| | +\------------------------------------------------------------*/ + +void DrealChangeFillMode( FillMode ) + + char FillMode; +{ + int Index; + XmString Label; + + rdsbegin(); + + Index = 2 + ( ( RDS_ALL_LAYER + DREAL_MAX_ACTIVE_NAME ) << 1 ); + Label = XmStringCreateSimple( DrealViewLayerFillModeName[ FillMode ] ); + + XtVaSetValues( DrealViewLayerButton[ Index ].BUTTON, + XmNlabelString, Label, + XmNresizable , False, + NULL ); + + XmStringFree( Label ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealChangeInterface | +| | +\------------------------------------------------------------*/ + +void DrealChangeInterface( Interface ) + + char Interface; +{ + int Index; + XmString Label; + + rdsbegin(); + + Index = 3 + ( ( RDS_ALL_LAYER + DREAL_MAX_ACTIVE_NAME ) << 1 ); + Label = XmStringCreateSimple( DrealViewLayerInterfaceName[ Interface ] ); + + XtVaSetValues( DrealViewLayerButton[ Index ].BUTTON, + XmNlabelString, Label, + XmNresizable , False, + NULL ); + + XmStringFree( Label ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealChangeCurosr | +| | +\------------------------------------------------------------*/ + +void DrealChangeCursor( Index ) + + char Index; +{ + int Pos; + XmString Label; + + rdsbegin(); + + Pos = 4 + ( ( RDS_ALL_LAYER + DREAL_MAX_ACTIVE_NAME ) << 1 ); + Label = XmStringCreateSimple( DrealViewLayerCursorType[ Index ] ); + + XtVaSetValues( DrealViewLayerButton[ Pos ].BUTTON, + XmNlabelString, Label, + XmNresizable , False, + NULL ); + + XmStringFree( Label ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealChangeForceDisplay | +| | +\------------------------------------------------------------*/ + +void DrealChangeForceDisplay( Index ) + + char Index; +{ + int Pos; + XmString Label; + + rdsbegin(); + + Pos = 5 + ( ( RDS_ALL_LAYER + DREAL_MAX_ACTIVE_NAME ) << 1 ); + Label = XmStringCreateSimple( DrealViewLayerForceDisplay[ Index ] ); + + XtVaSetValues( DrealViewLayerButton[ Pos ].BUTTON, + XmNlabelString, Label, + XmNresizable , False, + NULL ); + + XmStringFree( Label ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealChangeBlackBoxString | +| | +\------------------------------------------------------------*/ + +void DrealChangeBlackBoxString( Index ) + + char Index; +{ + int Pos; + XmString Label; + + rdsbegin(); + + Pos = 6 + ( ( RDS_ALL_LAYER + DREAL_MAX_ACTIVE_NAME ) << 1 ); + Label = XmStringCreateSimple( DrealViewLayerBlackBoxString[ Index ] ); + + XtVaSetValues( DrealViewLayerButton[ Pos ].BUTTON, + XmNlabelString, Label, + XmNresizable , False, + NULL ); + + XmStringFree( Label ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealSetLayerVisible | +| | +\------------------------------------------------------------*/ + +void DrealSetLayerVisible( Layer ) + + int Layer; +{ + int Index; + char *Background; + char *Foreground; + + rdsbegin(); + + Index = 2 + ( Layer << 1 ); + + if ( DREAL_RDS_ACTIVE_LAYER_TABLE[ Layer ] != -1 ) + { + DREAL_RDS_ACTIVE_LAYER_TABLE[ Layer ] = 1; + + XtVaSetValues( DrealViewLayerButton[ Index + 1 ].BUTTON, + XtVaTypedArg , + XmNbackground , + XmRString , + DREAL_BLACK_COLOR , + strlen( DREAL_BLACK_COLOR ) + 1 , + NULL + ); + + XtVaSetValues( DrealViewLayerButton[ Index + 1 ].BUTTON, + XtVaTypedArg , + XmNforeground , + XmRString , + DREAL_BLACK_COLOR , + strlen( DREAL_BLACK_COLOR ) + 1 , + NULL + ); + + Background = DrealViewLayerButton[ Index ].BACKGROUND; + Foreground = DrealViewLayerButton[ Index ].FOREGROUND; + + XtVaSetValues( DrealViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNbackground , + XmRString , + Background , + strlen( Background ) + 1, + NULL + ); + + XtVaSetValues( DrealViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNforeground , + XmRString , + Foreground , + strlen( Foreground ) + 1, + NULL + ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealSetNameVisible | +| | +\------------------------------------------------------------*/ + +void DrealSetNameVisible( Name ) + + int Name; +{ + int Index; + char *Background; + char *Foreground; + + rdsbegin(); + + Index = 2 + ( ( RDS_ALL_LAYER + Name ) << 1 ); + + DREAL_RDS_ACTIVE_NAME_TABLE[ Name ] = 1; + + XtVaSetValues( DrealViewLayerButton[ Index + 1 ].BUTTON, + XtVaTypedArg , + XmNbackground , + XmRString , + DREAL_BLACK_COLOR , + strlen( DREAL_BLACK_COLOR ) + 1 , + NULL + ); + + XtVaSetValues( DrealViewLayerButton[ Index + 1 ].BUTTON, + XtVaTypedArg , + XmNforeground , + XmRString , + DREAL_BLACK_COLOR , + strlen( DREAL_BLACK_COLOR ) + 1 , + NULL + ); + + Background = DrealViewLayerButton[ Index ].BACKGROUND; + Foreground = DrealViewLayerButton[ Index ].FOREGROUND; + + XtVaSetValues( DrealViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNbackground , + XmRString , + Background , + strlen( Background ) + 1, + NULL + ); + + XtVaSetValues( DrealViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNforeground , + XmRString , + Foreground , + strlen( Foreground ) + 1, + NULL + ); + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealSetLayerInvisible | +| | +\------------------------------------------------------------*/ + +void DrealSetLayerInvisible( Layer ) + + int Layer; +{ + int Index; + char *Background; + char *Foreground; + + rdsbegin(); + + Index = 3 + ( Layer << 1 ); + + if ( DREAL_RDS_ACTIVE_LAYER_TABLE[ Layer ] != -1 ) + { + DREAL_RDS_ACTIVE_LAYER_TABLE[ Layer ] = 0; + + XtVaSetValues( DrealViewLayerButton[ Index - 1 ].BUTTON, + XtVaTypedArg , + XmNbackground , + XmRString , + DREAL_BLACK_COLOR , + strlen( DREAL_BLACK_COLOR ) + 1 , + NULL + ); + + XtVaSetValues( DrealViewLayerButton[ Index - 1 ].BUTTON, + XtVaTypedArg , + XmNforeground , + XmRString , + DREAL_BLACK_COLOR , + strlen( DREAL_BLACK_COLOR ) + 1 , + NULL + ); + + Background = DrealViewLayerButton[ Index ].BACKGROUND; + Foreground = DrealViewLayerButton[ Index ].FOREGROUND; + + XtVaSetValues( DrealViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNbackground , + XmRString , + Background , + strlen( Background ) + 1 , + NULL + ); + + XtVaSetValues( DrealViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNforeground , + XmRString , + Foreground , + strlen( Foreground ) + 1 , + NULL + ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealSetNameInvisible | +| | +\------------------------------------------------------------*/ + +void DrealSetNameInvisible( Name ) + + int Name; +{ + int Index; + char *Background; + char *Foreground; + + rdsbegin(); + + Index = 3 + ( ( RDS_ALL_LAYER + Name ) << 1 ); + + DREAL_RDS_ACTIVE_NAME_TABLE[ Name ] = 0; + + XtVaSetValues( DrealViewLayerButton[ Index - 1 ].BUTTON, + XtVaTypedArg , + XmNbackground , + XmRString , + DREAL_BLACK_COLOR , + strlen( DREAL_BLACK_COLOR ) + 1 , + NULL + ); + + XtVaSetValues( DrealViewLayerButton[ Index - 1 ].BUTTON, + XtVaTypedArg , + XmNforeground , + XmRString , + DREAL_BLACK_COLOR , + strlen( DREAL_BLACK_COLOR ) + 1 , + NULL + ); + + Background = DrealViewLayerButton[ Index ].BACKGROUND; + Foreground = DrealViewLayerButton[ Index ].FOREGROUND; + + XtVaSetValues( DrealViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNbackground , + XmRString , + Background , + strlen( Background ) + 1 , + NULL + ); + + XtVaSetValues( DrealViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNforeground , + XmRString , + Foreground , + strlen( Foreground ) + 1 , + NULL + ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealLayerAllVisible | +| | +\------------------------------------------------------------*/ + +void DrealLayerAllVisible() + +{ + int Layer; + + rdsbegin(); + + for ( Layer = 0; Layer < RDS_ALL_LAYER; Layer++ ) + { + DrealSetLayerVisible( Layer ); + } + + for ( Layer = 0; Layer < DREAL_MAX_ACTIVE_NAME; Layer++ ) + { + DrealSetNameVisible( Layer ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeLayer | +| | +\------------------------------------------------------------*/ + +void DrealInitializeLayer() + +{ + int Index; + + rdsbegin(); + + for ( Index = 0; Index < RDS_ALL_LAYER; Index++ ) + { + if ( DREAL_RDS_ACTIVE_LAYER_TABLE[ Index ] == 0 ) + { + DrealSetLayerInvisible( Index ); + } + else + if ( DREAL_RDS_ACTIVE_LAYER_TABLE[ Index ] == 1 ) + { + DrealSetLayerVisible( Index ); + } + } + + for ( Index = 0; Index < DREAL_MAX_ACTIVE_NAME; Index++ ) + { + if ( DREAL_RDS_ACTIVE_NAME_TABLE[ Index ] == 0 ) + { + DrealSetNameInvisible( Index ); + } + else + { + DrealSetNameVisible( Index ); + } + } + + DrealChangeFillMode( DREAL_FILL_MODE ); + DrealChangeInterface( DREAL_INSTANCE_INTERFACE ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealLayerAllInvisible | +| | +\------------------------------------------------------------*/ + +void DrealLayerAllInvisible() + +{ + int Layer; + + rdsbegin(); + + for ( Layer = 0; Layer < RDS_ALL_LAYER; Layer++ ) + { + DrealSetLayerInvisible( Layer ); + } + + for ( Layer = 0; Layer < DREAL_MAX_ACTIVE_NAME; Layer++ ) + { + DrealSetNameInvisible( Layer ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Grid | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackSetGridX | +| | +\------------------------------------------------------------*/ + +void CallbackSetGridX( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterDialog( &DrealViewGridXDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackSetGridY | +| | +\------------------------------------------------------------*/ + +void CallbackSetGridY( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealEnterDialog( &DrealViewGridYDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackGridOnOff | +| | +\------------------------------------------------------------*/ + +void CallbackGridOnOff( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + XmString Label; + + rdsbegin(); + + DrealLambdaUserGrid = ! DrealLambdaUserGrid; + + if ( DrealLambdaUserGrid == DREAL_FALSE ) + { + Label = XmStringCreateSimple( "Grid Off" ); + } + else + { + Label = XmStringCreateSimple( "Grid On" ); + } + + XtVaSetValues( MyWidget, XmNlabelString, Label, + XmNresizable , False, + NULL ); + XmStringFree( Label ); + + DrealZoomRefresh(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackCloseGrid | +| | +\------------------------------------------------------------*/ + +void CallbackCloseGrid( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + rdsbegin(); + + DrealExitPanel( &DrealViewGridPanel ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMV_panel.h b/alliance/src/dreal/src/GMV_panel.h new file mode 100644 index 00000000..4bb4845d --- /dev/null +++ b/alliance/src/dreal/src/GMV_panel.h @@ -0,0 +1,137 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 25/02/93 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_VIEW_PANEL +# define DREAL_VIEW_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_VIEW_ARROWS_X 990 +# define DREAL_VIEW_ARROWS_Y 80 +# define DREAL_VIEW_ZOOM_X 990 +# define DREAL_VIEW_ZOOM_Y 230 +# define DREAL_VIEW_LAYER_X 430 +# define DREAL_VIEW_LAYER_Y 90 +# define DREAL_VIEW_GRID_X 470 +# define DREAL_VIEW_GRID_Y 330 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback View Panel | +| | +\------------------------------------------------------------*/ + + extern void CallbackLeftArrow(); + extern void CallbackRightArrow(); + extern void CallbackUpArrow(); + extern void CallbackDownArrow(); + extern void CallbackMoveSet(); + extern void CallbackCloseArrows(); + + extern void CallbackZoomRefresh(); + extern void CallbackZoomPrevious(); + extern void CallbackZoomLess(); + extern void CallbackZoomMore(); + extern void CallbackZoomSet(); + extern void CallbackZoomIn(); + extern void CallbackZoomFit(); + extern void CallbackZoomCenter(); + extern void CallbackZoomGoto(); + extern void CallbackZoomPan(); + extern void CallbackCloseZoom(); + + extern void CallbackLayerAllVisible(); + extern void CallbackLayerAllInvisible(); + extern void CallbackNameVisible(); + extern void CallbackNameInvisible(); + extern void CallbackLayerVisible(); + extern void CallbackLayerInvisible(); + extern void CallbackLayerFillMode(); + extern void CallbackLayerInterface(); + extern void CallbackLayerCursor(); + extern void CallbackLayerForceDisplay(); + extern void CallbackLayerBlackBoxString(); + extern void CallbackLayerApply(); + extern void CallbackCloseLayer(); + + extern void DrealSetLayerVisible(); + extern void DrealSetLayerInvisible(); + extern void DrealSetNameVisible(); + extern void DrealSetNameInvisible(); + extern void DrealLayerAllVisible(); + extern void DrealLayerAllInvisible(); + extern void DrealChangeFillMode(); + extern void DrealChangeInterface(); + extern void DrealChangeCursor(); + extern void DrealChangeForceDisplay(); + extern void DrealChangeBlackBoxString(); + + extern void CallbackSetGridX(); + extern void CallbackSetGridY(); + extern void CallbackGridOnOff(); + extern void CallbackCloseGrid(); + + extern void DrealInitializeLayer(); + +# endif diff --git a/alliance/src/dreal/src/GMV_view.c b/alliance/src/dreal/src/GMV_view.c new file mode 100644 index 00000000..0ed73796 --- /dev/null +++ b/alliance/src/dreal/src/GMV_view.c @@ -0,0 +1,674 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : View.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GSB.h" +# include "GTB.h" +# include "GMX.h" +# include "GMV.h" + +# include "GMV_view.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + drealzoom *DrealHeadZoom = (drealzoom *)NULL; + + int DrealPercentZoom = DREAL_PERCENT_ZOOM; + int DrealPercentMove = DREAL_PERCENT_MOVE; + +/*------------------------------------------------------------\ +| | +| Menu | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealAllocZoom | +| | +\------------------------------------------------------------*/ + +drealzoom *DrealAllocZoom () + +{ + return ( (drealzoom *) rdsallocheap( sizeof ( drealzoom ) ) ); +} + +/*------------------------------------------------------------\ +| | +| DrealFreeZoom | +| | +\------------------------------------------------------------*/ + +void DrealFreeZoom ( FreeZoom ) + + drealzoom *FreeZoom; + +{ + rdsfreeheap( (char *)FreeZoom, sizeof(FreeZoom) ); +} + +/*------------------------------------------------------------\ +| | +| DrealAddZoom | +| | +\------------------------------------------------------------*/ + + void DrealAddZoom () + +{ + drealzoom *DrealZoom; + + rdsbegin(); + + DrealZoom = DrealAllocZoom (); + DrealZoom->X = DrealLambdaGridX; + DrealZoom->Y = DrealLambdaGridY; + DrealZoom->DX = DrealLambdaGridDx; + DrealZoom->DY = DrealLambdaGridDy; + DrealZoom->NEXT = DrealHeadZoom; + DrealHeadZoom = DrealZoom; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDelZoom | +| | +\------------------------------------------------------------*/ + +char DrealDelZoom() + +{ + drealzoom *DrealZoom; + + rdsbegin(); + + if ( DrealHeadZoom != (drealzoom *) NULL ) + { + DrealZoom = DrealHeadZoom; + DrealHeadZoom = DrealHeadZoom->NEXT; + DrealFreeZoom( DrealZoom ); + + rdsend(); + return( DREAL_TRUE ); + } + + + rdsend(); + return( DREAL_FALSE ); +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeZoom | +| | +\------------------------------------------------------------*/ + +void DrealInitializeZoom() + +{ + rdsbegin(); + + while( DrealDelZoom() != DREAL_FALSE ); + + if ( DrealComputeBound() == DREAL_FALSE ) + { + DrealInitializeLambdaGrid(); + } + else + { + DrealLambdaGridX = ( DrealBoundXmin / RDS_PHYSICAL_GRID ) - 1; + DrealLambdaGridY = ( DrealBoundYmin / RDS_PHYSICAL_GRID ) - 1; + DrealLambdaGridDx = DrealBoundXmax / RDS_PHYSICAL_GRID; + DrealLambdaGridDy = DrealBoundYmax / RDS_PHYSICAL_GRID; + DrealLambdaGridDx = DrealLambdaGridDx - DrealLambdaGridX + 1; + DrealLambdaGridDy = DrealLambdaGridDy - DrealLambdaGridY + 1; + + DrealComputeLambdaGrid(); + } + + DrealComputeAndDisplayMap(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomUndo | +| | +\------------------------------------------------------------*/ + +void DrealZoomUndo() + +{ + rdsbegin(); + + if ( DrealHeadZoom == (drealzoom *)NULL ) + { + DrealErrorMessage( DrealMainWindow, "No previous zoom !" ); + } + else + { + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + DrealLambdaGridX = DrealHeadZoom->X; + DrealLambdaGridY = DrealHeadZoom->Y; + DrealLambdaGridDx = DrealHeadZoom->DX; + DrealLambdaGridDy = DrealHeadZoom->DY; + + DrealComputeLambdaGrid(); + DrealComputeAndDisplayMap(); + + DrealDisplayFigure( 0, 0, + DrealGraphicDx, DrealGraphicDy ); + + DrealRefreshGraphicWindow( 0, 0, + DrealGraphicDx, DrealGraphicDy); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + DrealDelZoom(); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomRight | +| | +\------------------------------------------------------------*/ + +void DrealZoomRight() + +{ + long Delta; + long Offset; + long DrealOldPixelGridX; + + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + Delta = ( DrealPercentMove * DrealLambdaGridDx ) / 100; + + if ( Delta == 0 ) Delta = 1; + + DrealLambdaGridX = DrealLambdaGridX + Delta; + DrealOldPixelGridX = DrealPixelGridX; + DrealPixelGridX = (float)(DrealLambdaGridX) * DrealLambdaGridStep; + Offset = DrealPixelGridX - DrealOldPixelGridX; + + XCopyArea( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealGraphicPixmap, + DrealBackgroundGC, + Offset, 0, + DrealGraphicDx - Offset, + DrealGraphicDy, + 0, 0 + ); + + DrealComputeAndDisplayMap(); + DrealDisplayFigure( DrealGraphicDx - Offset, 0, + DrealGraphicDx, DrealGraphicDy ); + DrealRefreshGraphicWindow( 0, 0, + DrealGraphicDx, DrealGraphicDy); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomLeft | +| | +\------------------------------------------------------------*/ + +void DrealZoomLeft() + +{ + long Delta; + long Offset; + long DrealOldPixelGridX; + + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + Delta = ( DrealPercentMove * DrealLambdaGridDx ) / 100; + + if ( Delta == 0 ) Delta = 1; + + DrealLambdaGridX = DrealLambdaGridX - Delta; + DrealOldPixelGridX = DrealPixelGridX; + DrealPixelGridX = (float)(DrealLambdaGridX) * DrealLambdaGridStep; + Offset = DrealOldPixelGridX - DrealPixelGridX; + + XCopyArea( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealGraphicPixmap, + DrealBackgroundGC, + 0, 0, + DrealGraphicDx - Offset, + DrealGraphicDy, + Offset, 0 + ); + + DrealComputeAndDisplayMap(); + DrealDisplayFigure( 0, 0, Offset, DrealGraphicDy ); + DrealRefreshGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomDown | +| | +\------------------------------------------------------------*/ + +void DrealZoomDown() + +{ + long Delta; + long Offset; + long DrealOldPixelGridY; + + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + Delta = ( DrealPercentMove * DrealLambdaGridDy ) / 100; + + if ( Delta == 0 ) Delta = 1; + + DrealLambdaGridY = DrealLambdaGridY - Delta; + DrealOldPixelGridY = DrealPixelGridY; + DrealPixelGridY = (float)(DrealLambdaGridY) * DrealLambdaGridStep; + Offset = DrealOldPixelGridY - DrealPixelGridY; + + XCopyArea( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealGraphicPixmap, + DrealBackgroundGC, + 0, Offset, + DrealGraphicDx, + DrealGraphicDy - Offset, + 0, 0 + ); + + DrealComputeAndDisplayMap(); + DrealDisplayFigure( 0, 0, DrealGraphicDx, Offset ); + DrealRefreshGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomUp | +| | +\------------------------------------------------------------*/ + +void DrealZoomUp() + +{ + long Delta; + long Offset; + long DrealOldPixelGridY; + + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + Delta = ( DrealPercentMove * DrealLambdaGridDy ) / 100; + + if ( Delta == 0 ) Delta = 1; + + DrealLambdaGridY = DrealLambdaGridY + Delta; + DrealOldPixelGridY = DrealPixelGridY; + DrealPixelGridY = (float)(DrealLambdaGridY) * DrealLambdaGridStep; + Offset = DrealPixelGridY - DrealOldPixelGridY; + + XCopyArea( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealGraphicPixmap, + DrealBackgroundGC, + 0, 0, + DrealGraphicDx, + DrealGraphicDy - Offset, + 0, Offset + ); + + DrealComputeAndDisplayMap(); + DrealDisplayFigure( 0, DrealGraphicDy - Offset, + DrealGraphicDx, DrealGraphicDy ); + DrealRefreshGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomMore | +| | +\------------------------------------------------------------*/ + +void DrealZoomMore() + +{ + long DeltaX; + long DeltaY; + + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + DeltaX = ( DrealPercentZoom * DrealLambdaGridDx ) / 100; + DeltaY = ( DrealPercentZoom * DrealLambdaGridDy ) / 100; + + if ( ( DeltaX >= 2 ) && + ( DeltaY >= 2 ) ) + { + DrealAddZoom(); + + DrealLambdaGridX = DrealLambdaGridX + (DeltaX >> 1); + DrealLambdaGridY = DrealLambdaGridY + (DeltaY >> 1); + DrealLambdaGridDx = DrealLambdaGridDx - DeltaX; + DrealLambdaGridDy = DrealLambdaGridDy - DeltaY; + + DrealComputeLambdaGrid(); + DrealComputeAndDisplayMap(); + DrealDisplayFigure( 0, 0, DrealGraphicDx, DrealGraphicDy ); + DrealRefreshGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + } + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomLess | +| | +\------------------------------------------------------------*/ + +void DrealZoomLess() + +{ + long DeltaX; + long DeltaY; + + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + DeltaX = 100 * DrealLambdaGridDx / ( 100 - DrealPercentZoom ); + DeltaY = 100 * DrealLambdaGridDy / ( 100 - DrealPercentZoom ); + + DrealAddZoom(); + + DrealLambdaGridX = DrealLambdaGridX - ((DeltaX - DrealLambdaGridDx) >> 1); + DrealLambdaGridY = DrealLambdaGridY - ((DeltaY - DrealLambdaGridDy) >> 1); + DrealLambdaGridDx = DeltaX; + DrealLambdaGridDy = DeltaY; + + DrealComputeLambdaGrid(); + DrealComputeAndDisplayMap(); + DrealDisplayFigure( 0, 0, DrealGraphicDx, DrealGraphicDy ); + DrealRefreshGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomFit | +| | +\------------------------------------------------------------*/ + +void DrealZoomFit() + +{ + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + if ( DrealComputeBound() == DREAL_FALSE ) + { + DrealErrorMessage( DrealMainWindow, "No element to display !" ); + } + else + { + DrealAddZoom(); + + DrealLambdaGridX = ( DrealBoundXmin / RDS_PHYSICAL_GRID ) - 1; + DrealLambdaGridY = ( DrealBoundYmin / RDS_PHYSICAL_GRID ) - 1; + DrealLambdaGridDx = DrealBoundXmax / RDS_PHYSICAL_GRID; + DrealLambdaGridDy = DrealBoundYmax / RDS_PHYSICAL_GRID; + DrealLambdaGridDx = DrealLambdaGridDx - DrealLambdaGridX + 1; + DrealLambdaGridDy = DrealLambdaGridDy - DrealLambdaGridY + 1; + + DrealComputeLambdaGrid(); + DrealComputeAndDisplayMap(); + DrealDisplayFigure( 0, 0, DrealGraphicDx, DrealGraphicDy ); + DrealRefreshGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + } + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomCenter | +| | +\------------------------------------------------------------*/ + +void DrealZoomCenter( LambdaX, LambdaY ) + + long LambdaX; + long LambdaY; +{ + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + DrealLambdaGridX = LambdaX - ( DrealLambdaGridDx >> 1 ); + DrealLambdaGridY = LambdaY - ( DrealLambdaGridDy >> 1 ); + + DrealComputeLambdaGrid(); + DrealComputeAndDisplayMap(); + DrealDisplayFigure( 0, 0, DrealGraphicDx, DrealGraphicDy ); + DrealRefreshGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomIn | +| | +\------------------------------------------------------------*/ + +void DrealZoomIn( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; +{ + long Swap; + + rdsbegin(); + + if ( ( LambdaX1 != LambdaX2 ) && + ( LambdaY1 != LambdaY2 ) ) + { + if ( LambdaX1 > LambdaX2 ) + { + Swap = LambdaX1; LambdaX1 = LambdaX2; LambdaX2 = Swap; + } + + if ( LambdaY1 > LambdaY2 ) + { + Swap = LambdaY1; LambdaY1 = LambdaY2; LambdaY2 = Swap; + } + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + DrealAddZoom(); + + DrealLambdaGridX = LambdaX1; + DrealLambdaGridY = LambdaY1; + DrealLambdaGridDx = LambdaX2 - LambdaX1; + DrealLambdaGridDy = LambdaY2 - LambdaY1; + + DrealComputeLambdaGrid(); + DrealComputeAndDisplayMap(); + DrealDisplayFigure( 0, 0, DrealGraphicDx, DrealGraphicDy ); + DrealRefreshGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomPan | +| | +\------------------------------------------------------------*/ + +void DrealZoomPan( LambdaX1, LambdaY1, LambdaX2, LambdaY2 ) + + long LambdaX1; + long LambdaY1; + long LambdaX2; + long LambdaY2; +{ + rdsbegin(); + + if ( ( LambdaX1 != LambdaX2 ) || + ( LambdaY1 != LambdaY2 ) ) + { + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + DrealLambdaGridX = DrealLambdaGridX + ( LambdaX1 - LambdaX2 ); + DrealLambdaGridY = DrealLambdaGridY + ( LambdaY1 - LambdaY2 ); + + DrealComputeLambdaGrid(); + DrealComputeAndDisplayMap(); + DrealDisplayFigure( 0, 0, DrealGraphicDx, DrealGraphicDy ); + DrealRefreshGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealZoomRefresh | +| | +\------------------------------------------------------------*/ + +void DrealZoomRefresh() + +{ + rdsbegin(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + DrealDisplayFigure( 0, 0, DrealGraphicDx, DrealGraphicDy ); + DrealRefreshGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMV_view.h b/alliance/src/dreal/src/GMV_view.h new file mode 100644 index 00000000..516f0645 --- /dev/null +++ b/alliance/src/dreal/src/GMV_view.h @@ -0,0 +1,95 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : View.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 25/02/93 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_VIEW +# define DREAL_VIEW + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_PERCENT_ZOOM 30 +# define DREAL_PERCENT_ZOOM_MIN 5 +# define DREAL_PERCENT_ZOOM_MAX 95 + +# define DREAL_PERCENT_MOVE 30 +# define DREAL_PERCENT_MOVE_MIN 5 +# define DREAL_PERCENT_MOVE_MAX 95 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ + + typedef struct drealzoom + { + struct drealzoom *NEXT; + + long X; + long Y; + long DX; + long DY; + + } drealzoom; + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern int DrealPercentZoom; + extern int DrealPercentMove; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GMX.h b/alliance/src/dreal/src/GMX.h new file mode 100644 index 00000000..fc86282f --- /dev/null +++ b/alliance/src/dreal/src/GMX.h @@ -0,0 +1,289 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : gmx101.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GMX +# define DREAL_GMX + +/*------------------------------------------------------------\ +| | +| Graphic Context | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Colors Define | +| | +\------------------------------------------------------------*/ + +# define DREAL_BLACK_COLOR "Black" +# define DREAL_WHITE_COLOR "White" +# define DREAL_TEXT_COLOR "White" +# define DREAL_ACCEPT_COLOR "magenta" +# define DREAL_CURSOR_COLOR "Black" + +/*------------------------------------------------------------\ +| | +| Dreal Message | +| | +\------------------------------------------------------------*/ + +# define DREAL_MAX_MESSAGE 7 + +# define DREAL_MESSAGE_X 0 +# define DREAL_MESSAGE_Y 1 +# define DREAL_MESSAGE_DX 2 +# define DREAL_MESSAGE_DY 3 +# define DREAL_MESSAGE_MODE 4 +# define DREAL_MESSAGE_INFO 5 +# define DREAL_MESSAGE_PROMPT 6 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Dreal Widget | +| | +\------------------------------------------------------------*/ + + extern XtAppContext DrealApplication; + extern Widget DrealTopLevel; + extern Widget DrealMainWindow; + extern Widget DrealMainForm; + + extern Widget DrealMenuBar; + + extern Widget DrealGraphicFrame; + extern Widget DrealGraphicWindow; + extern Display *DrealGraphicDisplay; + + extern Widget DrealMessageMainPaned; + extern Widget DrealMessageMainForm; + extern Widget DrealMessageForm [ DREAL_MAX_MESSAGE ]; + extern Widget DrealMessageText [ DREAL_MAX_MESSAGE ]; + extern Widget DrealMessageLabel [ DREAL_MAX_MESSAGE ]; + extern Widget DrealMessageFrame [ DREAL_MAX_MESSAGE ]; + +/*------------------------------------------------------------\ +| | +| Dreal Graphic Context | +| | +\------------------------------------------------------------*/ + + extern GC DrealLayerFillGC [ RDS_ALL_LAYER ]; + extern GC DrealLayerDrawGC [ RDS_ALL_LAYER ]; + extern GC DrealLayerAcceptGC [ RDS_ALL_LAYER ]; + extern GC DrealLayerEquiGC [ RDS_ALL_LAYER ]; + extern GC DrealAcceptDrawGC; + extern GC DrealEquiDrawGC; + extern GC DrealBackgroundGC; + extern GC DrealGridGC; + extern GC DrealXorGC; + extern GC DrealSmallTextGC; + extern GC DrealMediumTextGC; + extern GC DrealLargeTextGC; + + extern XFontStruct *DrealSmallTextFont; + extern XFontStruct *DrealLargeTextFont; + extern XFontStruct *DrealMediumTextFont; + +/*------------------------------------------------------------\ +| | +| Dreal Graphic Pixmap | +| | +\------------------------------------------------------------*/ + + extern Pixmap DrealGraphicPixmap; + +/*------------------------------------------------------------\ +| | +| Dreal Colormap | +| | +\------------------------------------------------------------*/ + + extern Colormap DrealColorMap; + +/*------------------------------------------------------------\ +| | +| Dreal Graphic Size | +| | +\------------------------------------------------------------*/ + + extern Dimension DrealOldGraphicDx; + extern Dimension DrealOldGraphicDy; + extern Dimension DrealGraphicDx; + extern Dimension DrealGraphicDy; + +/*------------------------------------------------------------\ +| | +| Dreal Lambda Grid | +| | +\------------------------------------------------------------*/ + + extern float DrealLambdaGridStep; + extern long DrealLambdaGridX; + extern long DrealLambdaGridY; + extern long DrealLambdaGridDx; + extern long DrealLambdaGridDy; + extern long DrealPixelGridX; + extern long DrealPixelGridY; + +/*------------------------------------------------------------\ +| | +| User Lambda Grid | +| | +\------------------------------------------------------------*/ + + extern long DrealLambdaUserGridDx; + extern long DrealLambdaUserGridDy; + extern char DrealLambdaUserGrid; + +/*------------------------------------------------------------\ +| | +| Dreal Cursor | +| | +\------------------------------------------------------------*/ + + extern long DrealLambdaCursorX; + extern long DrealLambdaCursorY; + +/*------------------------------------------------------------\ +| | +| Dreal Change Title | +| | +\------------------------------------------------------------*/ + + extern void DrealChangeTopLevelTitle(); + +/*------------------------------------------------------------\ +| | +| Dreal Event | +| | +\------------------------------------------------------------*/ + + extern char DrealCountEventZoom; + extern char DrealCountEventEdit; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealInitializeRessources | +| | +\------------------------------------------------------------*/ + + extern void DrealInitializeRessources(); + +/*------------------------------------------------------------\ +| | +| Dreal Edit Mode | +| | +\------------------------------------------------------------*/ + + extern void DrealChangeEditMode(); + extern void DrealContinueEditMode(); + +/*------------------------------------------------------------\ +| | +| DrealDisplayMessage | +| | +\------------------------------------------------------------*/ + + extern void DrealDisplayMessage(); + extern void DrealPromptEditMeasure(); + +/*------------------------------------------------------------\ +| | +| Dreal Graphic Window | +| | +\------------------------------------------------------------*/ + + extern void DrealClearGraphicWindow(); + extern void DrealResizeGraphicWindow(); + extern void DrealRefreshGraphicWindow(); + +/*------------------------------------------------------------\ +| | +| Dreal Lambda Grid | +| | +\------------------------------------------------------------*/ + + extern void DrealComputeLambdaGrid(); + extern void DrealResizeLambdaGrid(); + +/*------------------------------------------------------------\ +| | +| Dreal Display Figure | +| | +\------------------------------------------------------------*/ + + extern void DrealDisplayFigure(); + extern void DrealDisplayRectangle(); + +/*------------------------------------------------------------\ +| | +| Dreal Cursor | +| | +\------------------------------------------------------------*/ + + extern void DrealDisplayCursor(); + extern void DrealUndisplayCursor(); + +# endif diff --git a/alliance/src/dreal/src/GMX_color.c b/alliance/src/dreal/src/GMX_color.c new file mode 100644 index 00000000..6c361fca --- /dev/null +++ b/alliance/src/dreal/src/GMX_color.c @@ -0,0 +1,703 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Colors.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rds.h" +# include "GSB.h" +# include "GMX.h" +# include "GMX_color.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + GC DrealLayerFillGC [ RDS_ALL_LAYER ]; + GC DrealLayerDrawGC [ RDS_ALL_LAYER ]; + GC DrealLayerAcceptGC [ RDS_ALL_LAYER ]; + GC DrealAcceptDrawGC; + GC DrealBackgroundGC; + GC DrealGridGC; + GC DrealSmallTextGC; + GC DrealMediumTextGC; + GC DrealLargeTextGC; + GC DrealXorGCXor; + GC DrealXorGCInvert; + GC DrealXorGC; + + XFontStruct *DrealLargeTextFont; + XFontStruct *DrealMediumTextFont; + XFontStruct *DrealSmallTextFont; + + Colormap DrealColorMap; + +/*------------------------------------------------------------\ +| | +| Layer Color Define | +| | +\------------------------------------------------------------*/ + + static char DrealLayerPatternDefine[ RDS_ALL_LAYER ] = + + { + 0, /* RDS_NWELL */ + 0, /* RDS_PWELL */ + 0, /* RDS_NIMP */ + 0, /* RDS_PIMP */ + 0, /* RDS_ACTIV */ + 1, /* RDS_NDIF */ + 1, /* RDS_PDIF */ + 1, /* RDS_NTIE */ + 1, /* RDS_PTIE */ + 3, /* RDS_POLY */ + 2, /* RDS_GATE */ + 3, /* RDS_VPOLY */ + 12, /* RDS_TPOLY */ + 2, /* RDS_POLY2 */ + 5, /* RDS_CONT */ + 3, /* RDS_TPOLY2 */ + 5, /* RDS_TCONT */ + 5, /* RDS_CONT2 */ + 4, /* RDS_ALU1 */ + 4, /* RDS_VALU1 */ + 12, /* RDS_TALU1 */ + 5, /* RDS_VIA1 */ + 5, /* RDS_TVIA1 */ + 6, /* RDS_ALU2 */ + 6, /* RDS_VALU2 */ + 12, /* RDS_TALU2 */ + 5, /* RDS_VIA2 */ + 5, /* RDS_TVIA2 */ + 8, /* RDS_ALU3 */ + 8, /* RDS_VALU3 */ + 12, /* RDS_TALU3 */ + 5, /* RDS_VIA3 */ + 5, /* RDS_TVIA3 */ + 9, /* RDS_ALU4 */ + 9, /* RDS_VALU4 */ + 14, /* RDS_TALU4 */ + 5, /* RDS_VIA4 */ + 5, /* RDS_TVIA4 */ + 10, /* RDS_ALU5 */ + 10, /* RDS_VALU5 */ + 12, /* RDS_TALU5 */ + 13, /* RDS_VIA5 */ + 5, /* RDS_TVIA5 */ + 11, /* RDS_ALU6 */ + 11, /* RDS_VALU6 */ + 12, /* RDS_TALU6 */ + 5, /* RDS_VIA6 */ + 5, /* RDS_TVIA6 */ + 8, /* RDS_ALU7 */ + 8, /* RDS_VALU7 */ + 12, /* RDS_TALU7 */ + 5, /* RDS_VIA7 */ + 5, /* RDS_TVIA7 */ + 9, /* RDS_ALU8 */ + 9, /* RDS_VALU8 */ + 12, /* RDS_TALU8 */ + 5, /* RDS_VIA8 */ + 5, /* RDS_TVIA8 */ + 10, /* RDS_ALU9 */ + 7, /* RDS_CPAS */ + 7, /* RDS_REF */ + 0, /* RDS_USER0 */ + 0, /* RDS_USER1 */ + 0, /* RDS_USER2 */ + 0, /* RDS_USER3 */ + 0, /* RDS_USER4 */ + 0, /* RDS_USER5 */ + 0, /* RDS_USER6 */ + 0, /* RDS_USER7 */ + 0, /* RDS_USER8 */ + 0, /* RDS_USER9 */ + 0 /* RDS_ABOX */ + }; + + static char DrealPatternBits[ DREAL_MAX_PATTERN ][ DREAL_PATTERN_SQUARE ] = + + { /* FOR SUBST 0 */ + { + 0x7f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xf7, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf7, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + } + , /* FOR DIF & TIE 1 */ + { + 0x77, 0x77, 0xbb, 0xbb, 0xdd, 0xdd, 0xee, 0xee, 0x77, 0x77, 0xbb, 0xbb, + 0xdd, 0xdd, 0xee, 0xee, 0x77, 0x77, 0xbb, 0xbb, 0xdd, 0xdd, 0xee, 0xee, + 0x77, 0x77, 0xbb, 0xbb, 0xdd, 0xdd, 0xee, 0xee + } + , /* FOR GATE 2 */ + { + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55 + } + , /* FOR POLY 3 */ + { + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa + } + , /* FOR ALU1 4 */ + { + 0x88, 0x88, 0x44, 0x44, 0x22, 0x22, 0x11, 0x11, 0x88, 0x88, 0x44, 0x44, + 0x22, 0x22, 0x11, 0x11, 0x88, 0x88, 0x44, 0x44, 0x22, 0x22, 0x11, 0x11, + 0x88, 0x88, 0x44, 0x44, 0x22, 0x22, 0x11, 0x11 + } + , /* FOR CONT 5 */ + { + 0x55, 0x55, 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, + 0x55, 0x55, 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, + 0x55, 0x55, 0xff, 0xff, 0x55, 0x55, 0xff, 0xff + } + , /* FOR ALU2 6 */ + { + 0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, + 0x44, 0x44, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, + 0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00 + } + , /* FOR REF 7 */ + { + 0xaa, 0xaa, 0x11, 0x11, 0xaa, 0xaa, 0x44, 0x44, 0xaa, 0xaa, 0x11, 0x11, + 0xaa, 0xaa, 0x44, 0x44, 0xaa, 0xaa, 0x11, 0x11, 0xaa, 0xaa, 0x44, 0x44, + 0xaa, 0xaa, 0x11, 0x11, 0xaa, 0xaa, 0x44, 0x44 + } + , /* FOR ALU3 8 */ + { + 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, + 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, + 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11 + } + , /* FOR ALU4 9 */ + { + 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, + 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, + 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22 + } + , /* FOR ALU5 10 */ + { + 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, + 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88, + 0x22, 0x22, 0x88, 0x88, 0x22, 0x22, 0x88, 0x88 + } + , /* FOR ALU6 11 */ + { + 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, + 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, + 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44 + } + , /* FOR TPOLY, TALU1 12 */ + { + 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00 + } + , /* FOR VIA 13 */ + { + 0xff, 0xff, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa, + 0xff, 0xff, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa, + 0xff, 0xff, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa + } + , /* FOR TALUx 14 */ + { + 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00 + } + , /* FOR USER 15 */ + { + 0x44, 0x44, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, + 0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, + 0x44, 0x44, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00 + } + , + { + 0xee, 0xee, 0x77, 0x77, 0xbb, 0xbb, 0xdd, 0xdd, 0xee, 0xee, 0x77, 0x77, + 0xbb, 0xbb, 0xdd, 0xdd, 0xee, 0xee, 0x77, 0x77, 0xbb, 0xbb, 0xdd, 0xdd, + 0xee, 0xee, 0x77, 0x77, 0xbb, 0xbb, 0xdd, 0xdd + } + , + { + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa + } + , + { + 0xdd, 0xdd, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0xd5, 0xd5, 0xaa, 0xaa, + 0x55, 0x55, 0xaa, 0xaa, 0xdd, 0xdd, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, + 0xdd, 0xd5, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa + } + , + { + 0x77, 0x77, 0xaa, 0xaa, 0xd5, 0xd5, 0xaa, 0xaa, 0x77, 0x77, 0xaa, 0xaa, + 0xdd, 0x5d, 0xaa, 0xaa, 0x77, 0x77, 0xaa, 0xaa, 0xd5, 0xd5, 0xaa, 0xaa, + 0x77, 0x77, 0xaa, 0xaa, 0x5d, 0xdd, 0xaa, 0xaa + } + , + { + 0x55, 0x55, 0xbb, 0xbb, 0x55, 0x55, 0xfe, 0xfe, 0x55, 0x55, 0xbb, 0xbb, + 0x55, 0x55, 0xee, 0xef, 0x55, 0x55, 0xbb, 0xbb, 0x55, 0x55, 0xfe, 0xfe, + 0x55, 0x55, 0xbb, 0xbb, 0x55, 0x55, 0xef, 0xef + } + , + { + 0xff, 0xff, 0xaa, 0xaa, 0x77, 0x77, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa, + 0x77, 0x7f, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa, 0x77, 0x77, 0xaa, 0xaa, + 0xff, 0xff, 0xaa, 0xaa, 0x7f, 0x7f, 0xaa, 0xaa + } + , + { + 0xff, 0xff, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa, + 0xff, 0xff, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa, + 0xff, 0xff, 0xaa, 0xaa, 0xff, 0xff, 0xaa, 0xaa + } + , + { + 0x55, 0x55, 0xff, 0xff, 0xdd, 0xdd, 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, + 0x5d, 0xdd, 0xff, 0xff, 0x55, 0x55, 0xff, 0xff, 0xdd, 0xdd, 0xff, 0xff, + 0x55, 0x55, 0xff, 0xff, 0x5d, 0x5d, 0xff, 0xff + } + , + { + 0xee, 0xee, 0xff, 0xff, 0xbb, 0xba, 0xff, 0xff, 0xee, 0xee, 0xff, 0xff, + 0xab, 0xbb, 0xff, 0xff, 0xee, 0xee, 0xff, 0xff, 0xbb, 0xba, 0xff, 0xff, + 0xee, 0xee, 0xff, 0xff, 0xbb, 0xab, 0xff, 0xff + } + , + { + 0xff, 0xff, 0xee, 0xee, 0xff, 0xff, 0xfb, 0xfb, 0xff, 0xff, 0xee, 0xee, + 0xff, 0xff, 0xbf, 0xbb, 0xff, 0xff, 0xee, 0xee, 0xff, 0xff, 0xfb, 0xfb, + 0xff, 0xff, 0xee, 0xee, 0xff, 0xff, 0xbf, 0xbf + } + , + { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbb, 0xbb, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfb, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbb, 0xbb, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xfb + } + , + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08 + } + , + { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x77, 0x77, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xf7, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x77, 0x77, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xf7 + } + , + { + 0x10, 0x10, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x01, 0x11, 0x00, 0x00, + 0x44, 0x44, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, + 0x01, 0x01, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00 + } + , + { + 0x00, 0x00, 0x11, 0x51, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x15, 0x15, + 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x51, 0x11, 0x00, 0x00, 0x44, 0x44, + 0x00, 0x00, 0x15, 0x15, 0x00, 0x00, 0x44, 0x44 + } + , + { + 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x8a, 0x88, 0x00, 0x00, 0xaa, 0xaa, + 0x00, 0x00, 0x88, 0x88, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x8a, 0x8a, + 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x88, 0x88 + } + , + { + 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, + 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, + 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00 + } + , + { + 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0x00, 0x00, + 0x55, 0x55, 0x80, 0x80, 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x88, 0x88, + 0x55, 0x55, 0x00, 0x00, 0x55, 0x55, 0x88, 0x80 + } + , + { + 0x22, 0x22, 0x55, 0x55, 0x80, 0x80, 0x55, 0x55, 0x22, 0x22, 0x55, 0x55, + 0x88, 0x08, 0x55, 0x55, 0x22, 0x22, 0x55, 0x55, 0x80, 0x80, 0x55, 0x55, + 0x22, 0x22, 0x55, 0x55, 0x08, 0x08, 0x55, 0x55 + } + , + { + 0x88, 0x88, 0x55, 0x55, 0x22, 0xa2, 0x55, 0x55, 0x88, 0x88, 0x55, 0x55, + 0x2a, 0x2a, 0x55, 0x55, 0x88, 0x88, 0x55, 0x55, 0xa2, 0x22, 0x55, 0x55, + 0x88, 0x88, 0x55, 0x55, 0x2a, 0x2a, 0x55, 0x55 + } + , + { + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x54, 0x54, 0xaa, 0xaa, 0x55, 0x55, + 0xaa, 0xaa, 0x44, 0x44, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x44, 0x54, + 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x44, 0x44 + } + }; + + static Pixmap DrealPattern[ DREAL_MAX_PATTERN ]; + + static char *DrealColorName[ 5 ] = + + { + DREAL_BLACK_COLOR, + DREAL_WHITE_COLOR, + DREAL_TEXT_COLOR , + DREAL_ACCEPT_COLOR, + DREAL_CURSOR_COLOR + }; + + static int DrealColor[ DREAL_MAX_COLOR ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealSwitchColormap | +| | +\------------------------------------------------------------*/ + +void DrealInitializeColorMap() +{ + Display *ADisplay; + Screen *AScreen; + + ADisplay = XtDisplay( DrealTopLevel ); + AScreen = XtScreen( DrealTopLevel ); + DrealColorMap = DefaultColormapOfScreen( AScreen ); + + if ( DREAL_SWITCH_COLOR_MAP ) + { + DrealColorMap = XCopyColormapAndFree( ADisplay, DrealColorMap ); + XInstallColormap( ADisplay, DrealColorMap ); + XtVaSetValues( DrealTopLevel, XmNcolormap, DrealColorMap, NULL ); + } +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeColors | +| | +\------------------------------------------------------------*/ + +void DrealInitializeColors() + +{ + XColor ForgetIt; + XColor GetIt; + Window Root; + int Counter; + char Error; + char *ColorName; + + rdsbegin(); + + if ( DREAL_CURSOR_COLOR_NAME != (char *)NULL ) + { + DrealColorName[ 4 ] = DREAL_CURSOR_COLOR_NAME; + } + + Error = False; + + for ( Counter = 0; Counter < DREAL_MAX_COLOR; Counter++ ) + { + if ( Counter >= 5 ) + { + ColorName = DREAL_RDS_LAYER_NAME_TABLE[ Counter - 5 ][ 1 ]; + } + else + { + ColorName = DrealColorName[ Counter ]; + } + + if ( ColorName != (char *)NULL ) + { + if ( ! XAllocNamedColor( DrealGraphicDisplay, + DrealColorMap, ColorName, + &GetIt, &ForgetIt ) ) + { + fprintf( stderr, "\nGmx: Unable to allocate color '%s' !\n", + ColorName ); + + Error = True; + } + + DrealColor[ Counter ] = GetIt.pixel; + } + else + { + DrealColor[ Counter ] = DrealColor[ 0 ]; + } + } + + if ( Error == True ) exit( 1 ); + + Root = RootWindowOfScreen ( XtScreen ( DrealGraphicWindow ) ); + + for ( Counter = 0; Counter < DREAL_MAX_PATTERN; Counter++ ) + { + DrealPattern[ Counter ] = + + XCreateBitmapFromData( DrealGraphicDisplay, + Root, + DrealPatternBits[ Counter ], + DREAL_PATTERN_WIDTH, + DREAL_PATTERN_HEIGHT ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealChangeCursorContext | +| | +\------------------------------------------------------------*/ + +void DrealChangeCursorContext() +{ + XGCValues GraphicValue; + + if ( DREAL_XOR_CURSOR == DREAL_TRUE ) + { + DrealXorGC = DrealXorGCXor; + } + else + { + DrealXorGC = DrealXorGCInvert; + } +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeGraphicContext | +| | +\------------------------------------------------------------*/ + +void DrealInitializeGraphicContext() + +{ + XGCValues GraphicValue; + int Counter; + Window Root; + char Pattern; + + rdsbegin(); + + DrealLargeTextFont = XLoadQueryFont( DrealGraphicDisplay, + DREAL_LARGE_TEXT_FONT_NAME ); + + DrealMediumTextFont = XLoadQueryFont( DrealGraphicDisplay, + DREAL_MEDIUM_TEXT_FONT_NAME ); + + DrealSmallTextFont = XLoadQueryFont( DrealGraphicDisplay, + DREAL_SMALL_TEXT_FONT_NAME ); + + GraphicValue.foreground = DrealColor[ 0 ]; /* Black */ + GraphicValue.background = DrealColor[ 0 ]; + GraphicValue.plane_mask = AllPlanes; + + Root = RootWindowOfScreen ( XtScreen ( DrealGraphicWindow ) ), + + DrealBackgroundGC = XCreateGC ( DrealGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + GraphicValue.foreground = DrealColor[ 1 ]; /* White */ + + DrealGridGC = XCreateGC ( DrealGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + GraphicValue.foreground = DrealColor[ 3 ]; + + DrealAcceptDrawGC = XCreateGC ( DrealGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + GraphicValue.foreground = DrealColor[ 2 ]; /* Text */ + + DrealSmallTextGC = XCreateGC ( DrealGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + DrealMediumTextGC = XCreateGC ( DrealGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + DrealLargeTextGC = XCreateGC ( DrealGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + XSetFont( DrealGraphicDisplay, + DrealSmallTextGC, DrealSmallTextFont->fid ); + + XSetFont( DrealGraphicDisplay, + DrealMediumTextGC, DrealMediumTextFont->fid ); + + XSetFont( DrealGraphicDisplay, + DrealLargeTextGC, DrealLargeTextFont->fid ); + + GraphicValue.background = DrealColor[ 4 ]; /* Xor Color */ + GraphicValue.foreground = DrealColor[ 4 ]; /* Xor Color */ + GraphicValue.function = GXxor; + + DrealXorGCXor = XCreateGC ( DrealGraphicDisplay, + Root, + ( GCFunction | + GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + GraphicValue.function = GXinvert; + + DrealXorGCInvert = XCreateGC ( DrealGraphicDisplay, + Root, + ( GCFunction | + GCPlaneMask ), + &GraphicValue ); + DrealChangeCursorContext(); + + GraphicValue.background = DrealColor[ 0 ]; /* Black */ + GraphicValue.foreground = DrealColor[ 1 ]; /* White */ + + for ( Counter = 0; Counter < RDS_ALL_LAYER; Counter++ ) + { + if ( DREAL_RDS_LAYER_NAME_TABLE[ Counter ][ 0 ] != (char *)NULL ) + { + Pattern = DREAL_RDS_LAYER_PATTERN_TABLE[ Counter ]; + + if ( ( Pattern < 0 ) || + ( Pattern >= DREAL_MAX_PATTERN ) ) + { + Pattern = DrealLayerPatternDefine[ Counter ]; + } + + GraphicValue.stipple = DrealPattern[ Pattern ]; + GraphicValue.fill_style = FillStippled; + GraphicValue.foreground = DrealColor[ 3 ]; + + DrealLayerAcceptGC[ Counter ] = + + XCreateGC ( DrealGraphicDisplay, + Root, + ( GCStipple | + GCForeground | + GCBackground | + GCFillStyle | + GCPlaneMask ), + &GraphicValue ); + + GraphicValue.foreground = DrealColor[ Counter + 5 ]; + + DrealLayerFillGC[ Counter ] = + + XCreateGC ( DrealGraphicDisplay, + Root, + ( GCStipple | + GCForeground | + GCBackground | + GCFillStyle | + GCPlaneMask ), + &GraphicValue ); + + DrealLayerDrawGC[ Counter ] = + + XCreateGC ( DrealGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + } + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMX_color.h b/alliance/src/dreal/src/GMX_color.h new file mode 100644 index 00000000..9216630d --- /dev/null +++ b/alliance/src/dreal/src/GMX_color.h @@ -0,0 +1,92 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Color.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_COLOR +# define DREAL_COLOR + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Pattern | +| | +\------------------------------------------------------------*/ + +# define DREAL_PATTERN_WIDTH 16 +# define DREAL_PATTERN_HEIGHT 16 +# define DREAL_PATTERN_SQUARE 32 +# define DREAL_MAX_PATTERN 38 + +# define DREAL_MAX_COLOR ( RDS_ALL_LAYER + 5 ) + +# define DREAL_LARGE_TEXT_FONT_NAME "9x15" +# define DREAL_MEDIUM_TEXT_FONT_NAME "7x13" +# define DREAL_SMALL_TEXT_FONT_NAME "5x8" + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealInitializeGraphicContext(); + extern void DrealInitializeColors(); + extern void DrealChangeCursorContext(); + extern void DrealInitializeColorMap(); + +# endif diff --git a/alliance/src/dreal/src/GMX_cursor.c b/alliance/src/dreal/src/GMX_cursor.c new file mode 100644 index 00000000..6e3d54ea --- /dev/null +++ b/alliance/src/dreal/src/GMX_cursor.c @@ -0,0 +1,538 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Cursor.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GMX.h" +# include "GMX_view.h" +# include "GMX_grid.h" +# include "GMX_cursor.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Buffer | +| | +\------------------------------------------------------------*/ + + static char DrealCursorBuffer[ DREAL_MAX_CURSOR_BUFFER ]; + +/*------------------------------------------------------------\ +| | +| Coordinates | +| | +\------------------------------------------------------------*/ + + Position DrealCursorX = 0; + Position DrealCursorY = 0; + Position DrealCursorSaveX = 0; + Position DrealCursorSaveY = 0; + char DrealCursorSaved = DREAL_FALSE; + char DrealCursorInside = DREAL_FALSE; + char DrealCursorType = DREAL_INPUT_HALF_BOX; + + long DrealLambdaCursorX = 0; + long DrealLambdaCursorY = 0; + long DrealPixelCursorX = 0; + long DrealPixelCursorY = 0; + + long DrealLambdaCursorSaveX[ 2 ] = { 0, 0 }; + long DrealLambdaCursorSaveY[ 2 ] = { 0, 0 }; + char DrealCursorIndex = 0; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealComputeCursor | +| | +\------------------------------------------------------------*/ + +void DrealComputeCursor( X, Y ) + + Position X; + Position Y; +{ + rdsbegin(); + + Y = DrealGraphicDy - Y; + + DrealLambdaCursorX = X + DrealPixelGridX; + DrealLambdaCursorY = Y + DrealPixelGridY; + + if ( DrealLambdaCursorX < 0 ) + { + DrealLambdaCursorX = ((float)(DrealLambdaCursorX) / DrealLambdaGridStep) - 0.5 ; + } + else + { + DrealLambdaCursorX = ((float)(DrealLambdaCursorX) / DrealLambdaGridStep) + 0.5 ; + } + + if ( DrealLambdaCursorY < 0 ) + { + DrealLambdaCursorY = ((float)(DrealLambdaCursorY) / DrealLambdaGridStep) - 0.5 ; + } + else + { + DrealLambdaCursorY = ((float)(DrealLambdaCursorY) / DrealLambdaGridStep) + 0.5 ; + } + + DrealPixelCursorX = ((float)(DrealLambdaCursorX) * DrealLambdaGridStep); + DrealPixelCursorY = ((float)(DrealLambdaCursorY) * DrealLambdaGridStep); + + DrealCursorX = DrealPixelCursorX - DrealPixelGridX; + DrealCursorY = DrealPixelCursorY - DrealPixelGridY; + DrealCursorY = DrealGraphicDy - DrealCursorY; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDisplayCoordinates | +| | +\------------------------------------------------------------*/ + +void DrealDisplayCoordinates() + +{ + rdsbegin(); + + sprintf( DrealCursorBuffer, "%.3f", + (float)( DrealLambdaCursorX ) * DREAL_PHYSICAL_GRID_TO_MICRON ); + DrealDisplayMessage( DREAL_MESSAGE_X, DrealCursorBuffer ); + + sprintf( DrealCursorBuffer, "%.3f", + (float)( DrealLambdaCursorY ) * DREAL_PHYSICAL_GRID_TO_MICRON ); + DrealDisplayMessage( DREAL_MESSAGE_Y, DrealCursorBuffer ); + + sprintf( DrealCursorBuffer, "%.3f", + (float)( DrealLambdaCursorX - DrealLambdaCursorSaveX[0] ) * + DREAL_PHYSICAL_GRID_TO_MICRON ); + DrealDisplayMessage( DREAL_MESSAGE_DX, DrealCursorBuffer ); + + sprintf( DrealCursorBuffer, "%.3f", + (float)( DrealLambdaCursorY - DrealLambdaCursorSaveY[0] ) * + DREAL_PHYSICAL_GRID_TO_MICRON ); + DrealDisplayMessage( DREAL_MESSAGE_DY, DrealCursorBuffer ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealPointCursor | +| | +\------------------------------------------------------------*/ + +void DrealPointCursor() + +{ + rdsbegin(); + + DrealUndisplayCursor(); + + DrealLambdaCursorSaveX[ DrealCursorIndex ] = DrealLambdaCursorX; + DrealLambdaCursorSaveY[ DrealCursorIndex ] = DrealLambdaCursorY; + + DrealCursorIndex = DrealCursorIndex + 1; + + DrealDisplayCursor(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealResetCursor | +| | +\------------------------------------------------------------*/ + +void DrealResetCursor() + +{ + rdsbegin(); + + DrealUndisplayCursor(); + + DrealCursorIndex = DrealCursorIndex - 1; + + DrealDisplayCursor(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealChangeCursor | +| | +\------------------------------------------------------------*/ + +void DrealChangeCursorType( ArrayX, ArrayY, Index, Type ) + + long *ArrayX; + long *ArrayY; + char Index; + char Type; +{ + rdsbegin(); + + DrealUndisplayCursor(); + + DrealCursorType = Type; + DrealCursorIndex = Index; + + if ( Index != 0 ) + { + DrealLambdaCursorSaveX[ 0 ] = ArrayX[0]; + DrealLambdaCursorSaveY[ 0 ] = ArrayY[0]; + DrealLambdaCursorSaveX[ 1 ] = ArrayX[1]; + DrealLambdaCursorSaveY[ 1 ] = ArrayY[1]; + } + + DrealDisplayCursor(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDrawCursor | +| | +\------------------------------------------------------------*/ + +void DrealDrawCursor() + +{ + long X1; + long Y1; + long X2; + long Y2; + long DeltaX; + long DeltaY; + long Swap; + char DrawLine; + + rdsbegin(); + + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + DrealCursorSaveX - DREAL_CURSOR_SIZE, + DrealCursorSaveY - DREAL_CURSOR_SIZE, + DrealCursorSaveX + DREAL_CURSOR_SIZE, + DrealCursorSaveY + DREAL_CURSOR_SIZE ); + + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + DrealCursorSaveX - DREAL_CURSOR_SIZE, + DrealCursorSaveY + DREAL_CURSOR_SIZE, + DrealCursorSaveX + DREAL_CURSOR_SIZE, + DrealCursorSaveY - DREAL_CURSOR_SIZE ); + + if ( DrealCursorIndex > 0 ) + { + X1 = (float)(DrealLambdaCursorSaveX[0]) * DrealLambdaGridStep; + Y1 = (float)(DrealLambdaCursorSaveY[0]) * DrealLambdaGridStep; + X1 = X1 - DrealPixelGridX; + Y1 = Y1 - DrealPixelGridY; + Y1 = DrealGraphicDy - Y1; + + if ( DrealCursorIndex == 1 ) + { + X2 = DrealCursorSaveX; + Y2 = DrealCursorSaveY; + } + else + { + X2 = (float)(DrealLambdaCursorSaveX[1]) * DrealLambdaGridStep; + Y2 = (float)(DrealLambdaCursorSaveY[1]) * DrealLambdaGridStep; + X2 = X2 - DrealPixelGridX; + Y2 = Y2 - DrealPixelGridY; + Y2 = DrealGraphicDy - Y2; + } + + switch( DrealCursorType ) + { + case DREAL_INPUT_POINT : + + break; + + case DREAL_INPUT_LINE : + + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + X1, Y1, X2, Y2 ); + break; + + case DREAL_INPUT_HALF_BOX : + + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + X1, Y1, X2, Y1 ); + + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + X2, Y1, X2, Y2 ); + break; + + case DREAL_INPUT_ORTHO : + case DREAL_INPUT_SORTHO : + case DREAL_INPUT_LSTRING : + + DeltaX = X2 - X1; if ( DeltaX < 0 ) DeltaX = - DeltaX; + DeltaY = Y2 - Y1; if ( DeltaY < 0 ) DeltaY = - DeltaY; + + if ( DeltaX > DeltaY ) + { + Y2 = Y1; + + if ( X1 > X2 ) { Swap = X1; X1 = X2; X2 = Swap; } + + if ( X1 < 0 ) X1 = 0; + if ( X2 > DrealGraphicDx ) X2 = DrealGraphicDx; + + if ( ( X1 < X2 ) && + ( Y1 >= 0 ) && + ( Y1 <= DrealGraphicDy ) ) + { + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + X1, Y1, X2, Y2 ); + } + } + else + { + X2 = X1; + + if ( Y1 > Y2 ) { Swap = Y1; Y1 = Y2; Y2 = Swap; } + + if ( Y1 < 0 ) Y1 = 0; + if ( Y2 > DrealGraphicDy ) Y2 = DrealGraphicDy; + + if ( ( Y1 < Y2 ) && + ( X1 >= 0 ) && + ( X1 <= DrealGraphicDx ) ) + { + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + X1, Y1, X2, Y2 ); + } + } + + break; + + case DREAL_INPUT_BOX : + + if ( X1 > X2 ) { Swap = X1; X1 = X2; X2 = Swap; } + if ( Y1 > Y2 ) { Swap = Y1; Y1 = Y2; Y2 = Swap; } + + DrawLine = 0; + + if ( X1 < 0 ) + { + X1 = 0; DrawLine |= DREAL_WEST_MASK; + } + + if ( X2 > DrealGraphicDx ) + { + X2 = DrealGraphicDx; DrawLine |= DREAL_EAST_MASK; + } + + if ( Y1 < 0 ) + { + Y1 = 0; DrawLine |= DREAL_SOUTH_MASK; + } + + if ( Y2 > DrealGraphicDy ) + { + Y2 = DrealGraphicDy; DrawLine |= DREAL_NORTH_MASK; + } + + if ( DrawLine == 0 ) + { + XDrawRectangle( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + X1, Y1, + X2 - X1, Y2 - Y1 ); + } + else + { + if ( ( DrawLine & DREAL_WEST_MASK ) == 0 ) + { + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + X1, Y2, + X1, Y1 ); + } + + if ( ( DrawLine & DREAL_EAST_MASK ) == 0 ) + { + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + X2, Y2, + X2, Y1 ); + } + + if ( ( DrawLine & DREAL_SOUTH_MASK ) == 0 ) + { + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + X1, Y1, + X2, Y1 ); + } + + if ( ( DrawLine & DREAL_NORTH_MASK ) == 0 ) + { + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealXorGC, + X1, Y2, + X2, Y2 ); + } + } + + break; + + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealUndisplayCursor | +| | +\------------------------------------------------------------*/ + +void DrealUndisplayCursor() + +{ + rdsbegin(); + + if ( DrealCursorInside == DREAL_TRUE ) + { + if ( DrealCursorSaved == DREAL_TRUE ) + { + DrealDrawCursor(); + } + + DrealCursorSaved = DREAL_FALSE; + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDisplayCursor | +| | +\------------------------------------------------------------*/ + +void DrealDisplayCursor() + +{ + rdsbegin(); + + if ( DrealCursorInside == DREAL_TRUE ) + { + if ( DrealCursorSaved == DREAL_TRUE ) + { + DrealDrawCursor(); + + DrealCursorSaved = DREAL_FALSE; + } + + if ( ( DrealCursorY >= 0 ) && + ( DrealCursorX <= DrealGraphicDx ) ) + { + DrealCursorSaveX = DrealCursorX; + DrealCursorSaveY = DrealCursorY; + + DrealDrawCursor(); + + DrealCursorSaved = DREAL_TRUE; + } + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMX_cursor.h b/alliance/src/dreal/src/GMX_cursor.h new file mode 100644 index 00000000..3173b90a --- /dev/null +++ b/alliance/src/dreal/src/GMX_cursor.h @@ -0,0 +1,95 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Cursor.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_CURSOR +# define DREAL_CURSOR + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_MAX_CURSOR_BUFFER 128 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern Position DrealCursorX; + extern Position DrealCursorY; + extern Position DrealCursorSaveX; + extern Position DrealCursorSaveY; + extern char DrealCursorSaved; + extern char DrealCursorInside; + extern long DrealLambdaCursorX; + extern long DrealLambdaCursorY; + + extern long DrealPixelCursorX; + extern long DrealPixelCursorY; + + extern long DrealPixelCursorX1; + extern long DrealPixelCursorY1; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealComputeCursor(); + extern void DrealChangeCursorType(); + extern void DrealPointCursor(); + extern void DrealResetCursor(); + extern void DrealDisplayCoordinates(); + +# endif diff --git a/alliance/src/dreal/src/GMX_dialog.c b/alliance/src/dreal/src/GMX_dialog.c new file mode 100644 index 00000000..df78c66a --- /dev/null +++ b/alliance/src/dreal/src/GMX_dialog.c @@ -0,0 +1,105 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GTB.h" +# include "GMF.h" +# include "GMV.h" +# include "GMT.h" +# include "GMS.h" +# include "GMH.h" +# include "GMX.h" + +# include "GMX_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealInitializeDialog | +| | +\------------------------------------------------------------*/ + +void DrealInitializeDialog() + +{ + rdsbegin(); + + DrealBuildFileDialog(); + DrealBuildEditDialog(); + DrealBuildViewDialog(); + DrealBuildCreateDialog(); + DrealBuildToolsDialog(); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMX_dialog.h b/alliance/src/dreal/src/GMX_dialog.h new file mode 100644 index 00000000..70a5f541 --- /dev/null +++ b/alliance/src/dreal/src/GMX_dialog.h @@ -0,0 +1,72 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_DIALOG +# define DREAL_DIALOG + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealInitializeDialog(); + +# endif diff --git a/alliance/src/dreal/src/GMX_event.c b/alliance/src/dreal/src/GMX_event.c new file mode 100644 index 00000000..c16f6bbd --- /dev/null +++ b/alliance/src/dreal/src/GMX_event.c @@ -0,0 +1,937 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Event.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GRD.h" +# include "GMX.h" +# include "GTB.h" +# include "GMV.h" +# include "GMS.h" +# include "GMH.h" +# include "GMX_motif.h" +# include "GMX_grid.h" +# include "GMX_cursor.h" +# include "GMX_event.h" +# include "GMX_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Translation | +| | +\------------------------------------------------------------*/ + + static String DrealEventTranslation = + + ": CallbackEvent( 0 )\n\ + : CallbackEvent( 1 )\n\ + : CallbackEvent( 2 )\n\ + : CallbackEvent( 3 )\n\ + : CallbackEvent( 4 )\n\ + osfUp: CallbackEvent( 5 )\n\ + osfDown: CallbackEvent( 6 )\n\ + osfLeft: CallbackEvent( 7 )\n\ + osfRight: CallbackEvent( 8 )\n\ + Z: CallbackEvent( 9 )\n\ + M: CallbackEvent( 10 )\n\ + F: CallbackEvent( 11 )\n\ + R: CallbackEvent( 12 )\n\ + U: CallbackEvent( 13 )\n\ + I: CallbackEvent( 14 )\n\ + C: CallbackEvent( 15 )\n\ + P: CallbackEvent( 16 )\n\ + ShiftTab: CallbackEvent( 17 )\n\ + Tab: CallbackEvent( 18 )"; + +/*------------------------------------------------------------\ +| | +| Event Count | +| | +\------------------------------------------------------------*/ + + static char DrealMaxEventEditTable[] = + + { + 2, /* DREAL_EDIT_MEASURE */ + 2, /* DREAL_CREATE_RECTANGLE */ + 2, /* DREAL_CREATE_ABUTMENTBOX */ + 1, /* DREAL_SELECT_POINT_IDENTIFY */ + 1, /* DREAL_SELECT_POINT_COPY */ + 1, /* DREAL_SELECT_POINT_MOVE */ + 1, /* DREAL_SELECT_POINT_DELETE */ + 1, /* DREAL_SELECT_POINT_STRETCH */ + 1, /* DREAL_SELECT_POINT_MODIFY */ + 2, /* DREAL_SELECT_WINDOW_IDENTIFY */ + 2, /* DREAL_SELECT_WINDOW_COPY */ + 2, /* DREAL_SELECT_WINDOW_MOVE */ + 2, /* DREAL_SELECT_WINDOW_DELETE */ + 2, /* DREAL_SELECT_WINDOW_MODIFY */ + 2, /* DREAL_EDIT_COPY_POINT */ + 2, /* DREAL_EDIT_COPY_WINDOW */ + 2, /* DREAL_EDIT_MOVE_POINT */ + 2, /* DREAL_EDIT_MOVE_WINDOW */ + 2 /* DREAL_EDIT_STRETCH_POINT */ + }; + + static char DrealInputEventEditTable[] = + + { + DREAL_INPUT_HALF_BOX, /* DREAL_EDIT_MEASURE */ + DREAL_INPUT_BOX, /* DREAL_CREATE_RECTANGLE */ + DREAL_INPUT_BOX, /* DREAL_CREATE_ABUTMENTBOX */ + DREAL_INPUT_POINT, /* DREAL_SELECT_POINT_IDENTIFY */ + DREAL_INPUT_POINT, /* DREAL_SELECT_POINT_COPY */ + DREAL_INPUT_POINT, /* DREAL_SELECT_POINT_MOVE */ + DREAL_INPUT_POINT, /* DREAL_SELECT_POINT_DELETE */ + DREAL_INPUT_POINT, /* DREAL_SELECT_POINT_STRETCH */ + DREAL_INPUT_POINT, /* DREAL_SELECT_POINT_MODIFY */ + DREAL_INPUT_BOX, /* DREAL_SELECT_WINDOW_IDENTIFY */ + DREAL_INPUT_BOX, /* DREAL_SELECT_WINDOW_COPY */ + DREAL_INPUT_BOX, /* DREAL_SELECT_WINDOW_MOVE */ + DREAL_INPUT_BOX, /* DREAL_SELECT_WINDOW_DELETE */ + DREAL_INPUT_BOX, /* DREAL_SELECT_WINDOW_MODIFY */ + DREAL_INPUT_LINE, /* DREAL_EDIT_COPY_POINT */ + DREAL_INPUT_LINE, /* DREAL_EDIT_COPY_WINDOW */ + DREAL_INPUT_LINE, /* DREAL_EDIT_MOVE_POINT */ + DREAL_INPUT_LINE, /* DREAL_EDIT_MOVE_WINDOW */ + DREAL_INPUT_ORTHO /* DREAL_EDIT_STRETCH_POINT */ + }; + + static char DrealMaxEventZoomTable[] = + + { + 1, /* DREAL_ZOOM_CENTER */ + 2, /* DREAL_ZOOM_IN */ + 2 /* DREAL_ZOOM_PAN */ + }; + + static char DrealInputEventZoomTable[] = + + { + DREAL_INPUT_POINT, /* DREAL_ZOOM_CENTER */ + DREAL_INPUT_BOX, /* DREAL_ZOOM_IN */ + DREAL_INPUT_LINE /* DREAL_ZOOM_PAN */ + }; + +/*------------------------------------------------------------\ +| | +| Translation | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Expose Edit Zoom | +| | +\------------------------------------------------------------*/ + + static long DrealLambdaEventZoomX[ 2 ] = { 0, 0 }; + static long DrealLambdaEventZoomY[ 2 ] = { 0, 0 }; + static char DrealMaxEventZoom = 0; + char DrealCountEventZoom = 0; + + static long DrealLambdaEventEditX[ 2 ] = { 0, 0 }; + static long DrealLambdaEventEditY[ 2 ] = { 0, 0 }; + static char DrealMaxEventEdit = 2; + char DrealCountEventEdit = 0; + + static char DrealFirstExpose = DREAL_TRUE; + +/*------------------------------------------------------------\ +| | +| Input | +| | +\------------------------------------------------------------*/ + + static char DrealInputMode = DREAL_INPUT_HALF_BOX; + static char DrealSaveInputMode = DREAL_INPUT_HALF_BOX; + static char DrealEditMode = DREAL_EDIT_MEASURE; + static char DrealSaveEditMode = DREAL_EDIT_MEASURE; + +/*------------------------------------------------------------\ +| | +| Edit Message | +| | +\------------------------------------------------------------*/ + + static void (*DrealPromptMessage)() = DrealPromptEditMeasure; + static void (*DrealSavePromptMessage)() = DrealPromptEditMeasure; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealChangeEditMode | +| | +\------------------------------------------------------------*/ + +void DrealChangeEditMode( EditMode , PromptMessage ) + + char EditMode; + void (*PromptMessage)(); +{ + rdsbegin(); + + if ( EditMode & DREAL_ZOOM_MARK ) + { + EditMode = EditMode & ~DREAL_ZOOM_MARK; + + DrealCountEventZoom = 0; + DrealMaxEventZoom = DrealMaxEventZoomTable[ EditMode ]; + + if ( ! ( DrealEditMode & DREAL_ZOOM_MARK ) ) + { + DrealSaveEditMode = DrealEditMode; + DrealSaveInputMode = DrealInputMode; + DrealSavePromptMessage = DrealPromptMessage; + } + + DrealInputMode = DrealInputEventZoomTable[ EditMode ]; + DrealPromptMessage = PromptMessage; + DrealEditMode = EditMode | DREAL_ZOOM_MARK; + + DrealChangeCursorType( NULL, NULL, 0, DrealInputMode ); + } + else + { + if ( DrealEditMode & DREAL_ZOOM_MARK ) + { + DrealSaveEditMode = EditMode; + DrealSaveInputMode = DrealInputEventEditTable[ EditMode ]; + DrealSavePromptMessage = PromptMessage; + DrealCountEventEdit = 0; + DrealMaxEventEdit = DrealMaxEventEditTable[ EditMode ]; + } + else + { + if ( DrealEditMode != EditMode ) + { + DrealCountEventEdit = 0; + DrealMaxEventEdit = DrealMaxEventEditTable[ EditMode ]; + DrealEditMode = EditMode; + DrealInputMode = DrealInputEventEditTable[ EditMode ]; + DrealPromptMessage = PromptMessage; + + DrealChangeCursorType( NULL, NULL, 0, DrealInputMode ); + } + } + + DrealEditUnselectAll(); + } + + DrealPromptMessage(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealContinueEditMode | +| | +\------------------------------------------------------------*/ + +void DrealContinueEditMode( EditMode , PromptMessage, CountEvent ) + + char EditMode; + void (*PromptMessage)(); + char CountEvent; +{ + rdsbegin(); + + if ( DrealEditMode & DREAL_ZOOM_MARK ) + { + DrealSaveEditMode = EditMode; + DrealSaveInputMode = DrealInputEventEditTable[ EditMode ]; + DrealSavePromptMessage = PromptMessage; + DrealCountEventEdit = CountEvent; + DrealMaxEventEdit = DrealMaxEventEditTable[ EditMode ]; + } + else + { + DrealCountEventEdit = CountEvent; + DrealMaxEventEdit = DrealMaxEventEditTable[ EditMode ]; + DrealEditMode = EditMode; + DrealInputMode = DrealInputEventEditTable[ EditMode ]; + DrealPromptMessage = PromptMessage; + + DrealChangeCursorType( DrealLambdaEventEditX, + DrealLambdaEventEditY, + DrealCountEventEdit, + DrealInputMode ); + + } + + DrealPromptMessage(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealTreatEventZoom | +| | +\------------------------------------------------------------*/ + +void DrealTreatEventZoom() + +{ + rdsbegin(); + + switch ( DrealEditMode ) + { + case DREAL_ZOOM_CENTER : + + DrealZoomCenter( DrealLambdaEventZoomX[ 0 ], + DrealLambdaEventZoomY[ 0 ] ); + break; + + case DREAL_ZOOM_IN : + + DrealZoomIn( DrealLambdaEventZoomX[ 0 ], + DrealLambdaEventZoomY[ 0 ], + DrealLambdaEventZoomX[ 1 ], + DrealLambdaEventZoomY[ 1 ] ); + break; + + case DREAL_ZOOM_PAN : + + DrealZoomPan( DrealLambdaEventZoomX[ 0 ], + DrealLambdaEventZoomY[ 0 ], + DrealLambdaEventZoomX[ 1 ], + DrealLambdaEventZoomY[ 1 ] ); + break; + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealTreatEventEdit | +| | +\------------------------------------------------------------*/ + +void DrealTreatEventEdit() + +{ + long DeltaX; + long DeltaY; + long X1; + long X2; + long Y1; + long Y2; + + rdsend(); + + X1 = DrealLambdaEventEditX[0]; + X2 = DrealLambdaEventEditX[1]; + Y1 = DrealLambdaEventEditY[0]; + Y2 = DrealLambdaEventEditY[1]; + + if ( ( DrealInputMode == DREAL_INPUT_LSTRING ) || + ( DrealInputMode == DREAL_INPUT_ORTHO ) || + ( DrealInputMode == DREAL_INPUT_SORTHO ) ) + { + DeltaX = X1 - X2; + DeltaY = Y1 - Y2; + + if ( DeltaX < 0 ) DeltaX = - DeltaX; + if ( DeltaY < 0 ) DeltaY = - DeltaY; + + if ( DeltaX > DeltaY ) + { + Y2 = Y1; + + DrealLambdaEventEditX[0] = X2; + DrealLambdaEventEditY[0] = Y2; + } + else + { + X2 = X1; + + DrealLambdaEventEditX[0] = X2; + DrealLambdaEventEditY[0] = Y2; + } + } + + if ( DrealInputMode == DREAL_INPUT_LSTRING ) + { + DrealChangeCursorType( DrealLambdaEventEditX, + DrealLambdaEventEditY, + 1, DrealInputMode ); + + DrealCountEventEdit = 1; + } + else + { + DrealChangeCursorType( NULL, NULL, 0, + DrealInputMode ); + + DrealCountEventEdit = 0; + } + + switch ( DrealEditMode ) + { + case DREAL_EDIT_MEASURE : + + break; + + case DREAL_CREATE_RECTANGLE : + + DrealCreateRectangleRds( X1, Y1, X2, Y2 ); + + break; + + case DREAL_CREATE_ABUTMENTBOX : + + DrealCreateAbutmentBoxRds( X1, Y1, X2, Y2 ); + + break; + + case DREAL_SELECT_POINT_IDENTIFY : + + DrealEditSelectPoint( X1, Y1 ); + DrealEditIdentify(); + + break; + + case DREAL_SELECT_WINDOW_IDENTIFY : + + DrealEditSelectFence( X1, Y1, X2, Y2 ); + DrealEditIdentify(); + + break; + + case DREAL_SELECT_POINT_COPY : + + DrealEditSelectPointCopy( X1, Y1 ); + + break; + + case DREAL_SELECT_WINDOW_COPY : + + DrealEditSelectWindowCopy( X1, Y1, X2, Y2 ); + + break; + + case DREAL_EDIT_COPY_POINT : + + DrealEditCopy( X1, Y1, X2, Y2, 0 ); + + break; + + case DREAL_EDIT_COPY_WINDOW : + + DrealEditCopy( X1, Y1, X2, Y2, 1 ); + + break; + + case DREAL_SELECT_POINT_MOVE : + + DrealEditSelectPointMove( X1, Y1 ); + + break; + + case DREAL_SELECT_WINDOW_MOVE : + + DrealEditSelectWindowMove( X1, Y1, X2, Y2 ); + + break; + + case DREAL_EDIT_MOVE_POINT : + + DrealEditMove( X1, Y1, X2, Y2, 0 ); + + break; + + case DREAL_EDIT_MOVE_WINDOW : + + DrealEditMove( X1, Y1, X2, Y2, 1 ); + + break; + + case DREAL_SELECT_POINT_DELETE : + + DrealEditSelectPointDelete( X1, Y1 ); + + break; + + case DREAL_SELECT_WINDOW_DELETE : + + DrealEditSelectWindowDelete( X1, Y1, X2, Y2 ); + + break; + + case DREAL_SELECT_POINT_STRETCH : + + DrealEditSelectPointStretch( X1, Y1 ); + + break; + + case DREAL_EDIT_STRETCH_POINT : + + DrealEditStretch( X1, Y1, X2, Y2 ); + + break; + + case DREAL_SELECT_POINT_MODIFY : + + DrealEditSelectPointModify( X1, Y1 ); + + break; + + case DREAL_SELECT_WINDOW_MODIFY : + + DrealEditSelectWindowModify( X1, Y1, X2, Y2 ); + + break; + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEvent | +| | +\------------------------------------------------------------*/ + +void CallbackEvent ( MyWidget, Event, Args, Argc ) + + Widget MyWidget; + XButtonEvent *Event; + String *Args; + int *Argc; +{ + Display *EventDisplay; + char MouseEvent; + int FlagUp; + Position OldLambdaCursorX; + Position OldLambdaCursorY; + + rdsbegin(); + + EventDisplay = Event->display; + + MouseEvent = atoi( Args[ 0 ] ); + + if ( MouseEvent == DREAL_LEAVE ) + { + DrealUndisplayCursor(); + DrealCursorInside = DREAL_FALSE; + } + else + { + OldLambdaCursorX = DrealLambdaCursorX; + OldLambdaCursorY = DrealLambdaCursorY; + + DrealComputeCursor( Event->x, Event->y ); + + switch ( MouseEvent ) + { + case DREAL_B1DN : + + if ( DrealEditMode & DREAL_ZOOM_MARK ) + { + if ( DrealCountEventZoom < DrealMaxEventZoom ) + { + DrealLambdaEventZoomX[ DrealCountEventZoom ] = DrealLambdaCursorX; + DrealLambdaEventZoomY[ DrealCountEventZoom ] = DrealLambdaCursorY; + + DrealCountEventZoom = DrealCountEventZoom + 1; + + DrealPointCursor(); + + if ( DrealCountEventZoom == DrealMaxEventZoom ) + { + DrealChangeCursorType( NULL, NULL, 0, DrealInputMode ); + + DrealTreatEventZoom(); + + DrealInputMode = DrealSaveInputMode; + DrealEditMode = DrealSaveEditMode; + DrealPromptMessage = DrealSavePromptMessage; + DrealSaveEditMode = DREAL_EDIT_MEASURE; + DrealSaveInputMode = DREAL_INPUT_HALF_BOX; + DrealCountEventZoom = 0; + DrealMaxEventZoom = 0; + + DrealChangeCursorType( DrealLambdaEventEditX, + DrealLambdaEventEditY, + DrealCountEventEdit, + DrealInputMode ); + + DrealComputeCursor( Event->x, Event->y ); + DrealDisplayCursor(); + } + } + } + else + { + if ( DrealCountEventEdit < DrealMaxEventEdit ) + { + DrealLambdaEventEditX[ DrealCountEventEdit ] = DrealLambdaCursorX; + DrealLambdaEventEditY[ DrealCountEventEdit ] = DrealLambdaCursorY; + + DrealCountEventEdit = DrealCountEventEdit + 1; + + DrealPointCursor(); + + if ( DrealCountEventEdit == DrealMaxEventEdit ) + { + DrealTreatEventEdit(); + + DrealDisplayCursor(); + } + } + } + + DrealPromptMessage(); + + break; + + case DREAL_B3DN : + + if ( DrealEditMode & DREAL_ZOOM_MARK ) + { + if ( DrealCountEventZoom != 0 ) + { + DrealCountEventZoom = DrealCountEventZoom - 1; + + DrealResetCursor(); + } + else + { + DrealChangeCursorType( DrealLambdaEventEditX, + DrealLambdaEventEditY, + DrealCountEventEdit, + DrealSaveInputMode ); + + DrealInputMode = DrealSaveInputMode; + DrealEditMode = DrealSaveEditMode; + DrealPromptMessage = DrealSavePromptMessage; + DrealSaveEditMode = DREAL_EDIT_MEASURE; + DrealSaveInputMode = DREAL_INPUT_HALF_BOX; + DrealSavePromptMessage = DrealPromptEditMeasure; + DrealCountEventZoom = 0; + DrealMaxEventZoom = 0; + } + } + else + { + if ( DrealCountEventEdit != 0 ) + { + DrealCountEventEdit = DrealCountEventEdit - 1; + + DrealResetCursor(); + } + else + { + DrealEditUnselectAll(); + + DrealChangeCursorType( NULL, NULL, 0, + DREAL_INPUT_HALF_BOX ); + + DrealInputMode = DREAL_INPUT_HALF_BOX; + DrealEditMode = DREAL_EDIT_MEASURE; + DrealPromptMessage = DrealPromptEditMeasure; + DrealCountEventEdit = 0; + DrealMaxEventEdit = 2; + } + } + + DrealPromptMessage(); + + break; + + case DREAL_MOTION : + + break; + + case DREAL_ENTER : + + DrealCursorInside = DREAL_TRUE; + DrealDisplayCursor(); + + break; + + case DREAL_KEY_UP : DrealZoomUp(); + + break; + + case DREAL_KEY_DN : DrealZoomDown(); + + break; + + case DREAL_KEY_LEFT : DrealZoomLeft(); + + break; + + case DREAL_KEY_RIGHT : DrealZoomRight(); + + break; + + case DREAL_KEY_MORE : DrealZoomMore(); + + break; + + case DREAL_KEY_LESS : DrealZoomLess(); + + break; + + case DREAL_KEY_FIT : DrealZoomFit(); + + break; + + case DREAL_KEY_REFRESH : DrealZoomRefresh(); + + break; + + case DREAL_KEY_UNZOOM : DrealZoomUndo(); + + break; + + case DREAL_KEY_ZOOM_IN : + + DrealChangeEditMode( DREAL_ZOOM_IN, DrealPromptZoomIn ); + + break; + + case DREAL_KEY_CENTER : + + DrealChangeEditMode( DREAL_ZOOM_CENTER, DrealPromptZoomCenter ); + + break; + + case DREAL_KEY_PAN : + + DrealChangeEditMode( DREAL_ZOOM_PAN, DrealPromptZoomPan ); + + break; + + case DREAL_KEY_UP_LAYER : + case DREAL_KEY_DN_LAYER : + + if ( ! ( DrealEditMode & DREAL_ZOOM_MARK ) ) + { + FlagUp = ( MouseEvent == DREAL_KEY_UP_LAYER ); + + switch ( DrealEditMode ) + { + case DREAL_CREATE_RECTANGLE : DrealChangeRectangleLayer( FlagUp ); + break; + } + + DrealPromptMessage(); + } + + break; + } + + if ( MouseEvent >= DREAL_KEY_UP ) + { + DrealComputeCursor( Event->x, Event->y ); + DrealDisplayCursor(); + } + + if ( ( OldLambdaCursorX != DrealLambdaCursorX ) || + ( OldLambdaCursorY != DrealLambdaCursorY ) ) + { + DrealDisplayCoordinates(); + DrealDisplayCursor(); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackResize | +| | +\------------------------------------------------------------*/ + +void CallbackResize( MyWidget, ClientData, CallData ) + + Widget MyWidget; + XtPointer ClientData; + XmDrawingAreaCallbackStruct *CallData; +{ + rdsbegin(); + + if ( DrealFirstExpose == DREAL_FALSE ) + { + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + DrealUndisplayCursor(); + + DrealResizeGraphicWindow(); + DrealRefreshGraphicWindow( 0, 0, + DrealGraphicDx, DrealGraphicDy ); + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + DrealDisplayCursor(); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackExpose | +| | +\------------------------------------------------------------*/ + +void CallbackExpose( MyWidget, ClientData, CallData ) + + Widget MyWidget; + XtPointer ClientData; + XmDrawingAreaCallbackStruct *CallData; +{ + XExposeEvent *ExposeEvent; + + rdsbegin(); + + ExposeEvent = (XExposeEvent *)CallData->event; + + if ( DrealFirstExpose == DREAL_TRUE ) + { + DrealFirstExpose = DREAL_FALSE; + + DrealInitializeGraphicWindow(); + DrealUndisplayCursor(); + + DrealLoadConfig( DREAL_FALSE ); + + if ( DrealFigureRds != (rdsfig_list *)NULL ) + { + DrealSetMouseCursor( DrealGraphicWindow, DREAL_WATCH_CURSOR ); + + DrealChangeTopLevelTitle( DrealFigureRds->NAME ); + DrealInitializeZoom(); + DrealDisplayToolsMessage(); + DrealDisplayFigure( 0, 0, DrealGraphicDx, DrealGraphicDy ); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + } + else + { + DrealChangeTopLevelTitle( (char *)NULL ); + } + + DrealRefreshGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + DrealDisplayCursor(); + + DrealEnterPresentPanel(); + } + else + { + DrealUndisplayCursor(); + DrealRefreshGraphicWindow( ExposeEvent->x, ExposeEvent->y, + ExposeEvent->width, ExposeEvent->height ); + DrealDisplayCursor(); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeEvent | +| | +\------------------------------------------------------------*/ + +void DrealInitializeEvent() + +{ + XtActionsRec NewActions; + + rdsbegin(); + + XtVaSetValues( DrealGraphicWindow, + XmNtranslations, + XtParseTranslationTable( DrealEventTranslation ), + NULL + ); + + NewActions.string = "CallbackEvent"; + NewActions.proc = CallbackEvent; + + XtAppAddActions( DrealApplication, &NewActions, 1 ); + + XtAddCallback( DrealGraphicWindow, + XmNresizeCallback, + CallbackResize, NULL ); + + XtAddCallback( DrealGraphicWindow, + XmNexposeCallback, + CallbackExpose, NULL ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMX_event.h b/alliance/src/dreal/src/GMX_event.h new file mode 100644 index 00000000..a2008c8c --- /dev/null +++ b/alliance/src/dreal/src/GMX_event.h @@ -0,0 +1,101 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Event.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_EVENT +# define DREAL_EVENT + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_B1DN 0 +# define DREAL_B3DN 1 +# define DREAL_MOTION 2 +# define DREAL_ENTER 3 +# define DREAL_LEAVE 4 + +# define DREAL_KEY_UP 5 +# define DREAL_KEY_DN 6 +# define DREAL_KEY_LEFT 7 +# define DREAL_KEY_RIGHT 8 + +# define DREAL_KEY_MORE 9 +# define DREAL_KEY_LESS 10 + +# define DREAL_KEY_FIT 11 +# define DREAL_KEY_REFRESH 12 +# define DREAL_KEY_UNZOOM 13 + +# define DREAL_KEY_ZOOM_IN 14 +# define DREAL_KEY_CENTER 15 +# define DREAL_KEY_PAN 16 + +# define DREAL_KEY_DN_LAYER 17 +# define DREAL_KEY_UP_LAYER 18 + +# define DREAL_MAX_EVENT_BUFFER 128 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealInitializeEvent(); + extern void DrealDisplayEditMeasure(); + +# endif diff --git a/alliance/src/dreal/src/GMX_graphic.c b/alliance/src/dreal/src/GMX_graphic.c new file mode 100644 index 00000000..92d9276b --- /dev/null +++ b/alliance/src/dreal/src/GMX_graphic.c @@ -0,0 +1,316 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Graphic.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GTB.h" +# include "GMX.h" + +# include "GMX_graphic.h" +# include "GMX_view.h" +# include "GMX_grid.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + Widget DrealGraphicFrame; + Widget DrealGraphicWindow; + Display *DrealGraphicDisplay = (Display *)NULL; + + Dimension DrealGraphicDx = 0; + Dimension DrealGraphicDy = 0; + Dimension DrealOldGraphicDx = 0; + Dimension DrealOldGraphicDy = 0; + + Pixmap DrealGraphicPixmap = (Pixmap)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealInitializeGraphicWindow | +| | +\------------------------------------------------------------*/ + +void DrealInitializeGraphicWindow() + +{ + rdsbegin(); + + XtVaGetValues( DrealGraphicWindow, + XmNwidth, &DrealGraphicDx, + XmNheight, &DrealGraphicDy, + NULL + ); + + DrealOldGraphicDx = DrealGraphicDx; + DrealOldGraphicDy = DrealGraphicDy; + + DrealGraphicPixmap = + + XCreatePixmap ( DrealGraphicDisplay, + RootWindowOfScreen( XtScreen ( DrealGraphicWindow ) ), + DrealGraphicDx, + DrealGraphicDy, + DefaultDepthOfScreen ( XtScreen ( DrealGraphicWindow ) ) + ); + + DrealClearGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + DrealInitializeLambdaGrid(); + + DrealSetMouseCursor( DrealGraphicWindow, DREAL_NORMAL_CURSOR ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealClearGraphicWindow | +| | +\------------------------------------------------------------*/ + +void DrealClearGraphicWindow( GraphicX, GraphicY, GraphicDx, GraphicDy ) + + long GraphicX; + long GraphicY; + long GraphicDx; + long GraphicDy; +{ + XFillRectangle( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealBackgroundGC, + GraphicX, GraphicY, + GraphicDx, + GraphicDy ); +} + +/*------------------------------------------------------------\ +| | +| DrealRefreshGraphicWindow | +| | +\------------------------------------------------------------*/ + +void DrealRefreshGraphicWindow( GraphicX, GraphicY, GraphicDx, GraphicDy ) + + Dimension GraphicX; + Dimension GraphicY; + Dimension GraphicDx; + Dimension GraphicDy; +{ + rdsbegin(); + + DrealUndisplayCursor(); + + XCopyArea( DrealGraphicDisplay, + DrealGraphicPixmap, + XtWindow ( DrealGraphicWindow ), + DrealBackgroundGC, + GraphicX, GraphicY, + GraphicDx, GraphicDy, + GraphicX, GraphicY + ); + + DrealDisplayLambdaGrid( GraphicX, GraphicY, + GraphicX + GraphicDx, + GraphicY + GraphicDy ); + DrealUndisplayCursor(); + + rdsend(); +} + + +/*------------------------------------------------------------\ +| | +| DrealResizeGraphicWindow | +| | +\------------------------------------------------------------*/ + +void DrealResizeGraphicWindow() + +{ + Pixmap OldPixmap; + Dimension SourceY; + Dimension TargetY; + Dimension TargetDx; + Dimension TargetDy; + + rdsbegin(); + + DrealOldGraphicDx = DrealGraphicDx; + DrealOldGraphicDy = DrealGraphicDy; + + XtVaGetValues( DrealGraphicWindow, + XmNwidth, &DrealGraphicDx, + XmNheight, &DrealGraphicDy, + NULL + ); + + if ( ( DrealOldGraphicDx != DrealGraphicDx ) || + ( DrealOldGraphicDy != DrealGraphicDy ) ) + { + OldPixmap = DrealGraphicPixmap; + + DrealGraphicPixmap = + + XCreatePixmap ( DrealGraphicDisplay, + RootWindowOfScreen( XtScreen ( DrealGraphicWindow ) ), + DrealGraphicDx, + DrealGraphicDy, + DefaultDepthOfScreen ( XtScreen ( DrealGraphicWindow ) ) + ); + + DrealClearGraphicWindow( 0, 0, DrealGraphicDx, DrealGraphicDy ); + + DrealResizeLambdaGrid(); + + if ( DrealOldGraphicDx < DrealGraphicDx ) + { + TargetDx = DrealOldGraphicDx; + + DrealDisplayFigure( TargetDx, 0, + DrealGraphicDx, DrealGraphicDy ); + } + else + { + TargetDx = DrealGraphicDx; + } + + if ( DrealOldGraphicDy < DrealGraphicDy ) + { + SourceY = 0; + TargetDy = DrealOldGraphicDy; + TargetY = DrealGraphicDy - DrealOldGraphicDy; + + DrealDisplayFigure( 0, TargetDy, + TargetDx, DrealGraphicDy ); + } + else + { + TargetDy = DrealGraphicDy; + TargetY = 0; + SourceY = DrealOldGraphicDy - DrealGraphicDy; + } + + XCopyArea( DrealGraphicDisplay, + OldPixmap, + DrealGraphicPixmap, + DrealBackgroundGC, + 0, SourceY, + TargetDx, TargetDy, + 0, TargetY + ); + + XFreePixmap( DrealGraphicDisplay, OldPixmap ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeGraphic | +| | +\------------------------------------------------------------*/ + +void DrealInitializeGraphic() + +{ + rdsbegin(); + + DrealGraphicFrame = XtVaCreateManagedWidget( "DrealGraphicFrame", + xmFrameWidgetClass, + DrealMainForm, + XmNshadowType , XmSHADOW_ETCHED_IN, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 1, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 191, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 1, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 199, + NULL ); + + DrealGraphicWindow = XtVaCreateManagedWidget( + "DrealGraphicWindow", + xmDrawingAreaWidgetClass, + DrealGraphicFrame, + XmNtopAttachment, XmATTACH_FORM, + XmNrightAttachment, XmATTACH_FORM, + XmNbottomAttachment, XmATTACH_FORM, + XmNleftAttachment, XmATTACH_FORM, + XmNbackground, 1, + XmNforeground, 0, + NULL + ); + DrealGraphicDisplay = XtDisplay( DrealGraphicWindow ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMX_graphic.h b/alliance/src/dreal/src/GMX_graphic.h new file mode 100644 index 00000000..fa907902 --- /dev/null +++ b/alliance/src/dreal/src/GMX_graphic.h @@ -0,0 +1,72 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Graphic.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GRAPHIC +# define DREAL_GRAPHIC + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealInitializeGraphic(); + +# endif diff --git a/alliance/src/dreal/src/GMX_grid.c b/alliance/src/dreal/src/GMX_grid.c new file mode 100644 index 00000000..7aca6968 --- /dev/null +++ b/alliance/src/dreal/src/GMX_grid.c @@ -0,0 +1,316 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Grid.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GRD.h" +# include "GMX.h" + +# include "GMX_grid.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Lambda Grid | +| | +\------------------------------------------------------------*/ + + float DrealLambdaGridStep; + + long DrealLambdaGridX; + long DrealLambdaGridY; + long DrealLambdaGridDx; + long DrealLambdaGridDy; + + long DrealPixelGridX; + long DrealPixelGridY; + +/*------------------------------------------------------------\ +| | +| User Lambda Grid | +| | +\------------------------------------------------------------*/ + + long DrealLambdaUserGridDx; + long DrealLambdaUserGridDy; + char DrealLambdaUserGrid; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealInitializeLambdaGrid | +| | +\------------------------------------------------------------*/ + +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(); +} + +/*------------------------------------------------------------\ +| | +| DrealComputeLambdaGrid | +| | +\------------------------------------------------------------*/ + +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(); +} + +/*------------------------------------------------------------\ +| | +| DrealResizeLambdaGrid | +| | +\------------------------------------------------------------*/ + +void DrealResizeLambdaGrid() + +{ + rdsbegin(); + + DrealLambdaGridDx = 1 + ( DrealGraphicDx / DrealLambdaGridStep ); + DrealLambdaGridDy = 1 + ( DrealGraphicDy / DrealLambdaGridStep ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDisplayLambdaGrid | +| | +\------------------------------------------------------------*/ + +char DrealDisplayLambdaGrid( GraphicX1, GraphicY1, GraphicX2, GraphicY2 ) + + Dimension GraphicX1; + Dimension GraphicY1; + Dimension GraphicX2; + Dimension GraphicY2; +{ + long X; + long Y; + long MaxGridX; + long MaxGridY; + long PixelX; + long PixelY; + long Xmin; + long Ymin; + char UserGrid; + char LambdaGrid; + char TraceCroix; + char TracePoint; + float Check; + + rdsbegin(); + + if ( DrealLambdaGridStep < DREAL_LOWER_GRID_STEP ) + { + LambdaGrid = 0; + } + else + { + LambdaGrid = 1; + } + + if ( DrealLambdaUserGrid == 1 ) + { + if ( DrealLambdaUserGridDx > DrealLambdaUserGridDy ) + { + Check = ( DREAL_LOWER_GRID_STEP * 2 / DrealLambdaUserGridDy ); + } + else + { + Check = ( DREAL_LOWER_GRID_STEP * 2 / DrealLambdaUserGridDy ); + } + + if ( DrealLambdaGridStep < Check ) UserGrid = 0; + else UserGrid = 1; + } + else + { + UserGrid = 0; + } + + if ( ( UserGrid == 0 ) && + ( LambdaGrid == 0 ) ) + { + rdsend(); + return( DREAL_FALSE ); + } + + MaxGridX = DrealLambdaGridX + DrealLambdaGridDx; + MaxGridY = DrealLambdaGridY + DrealLambdaGridDy; + + if ( LambdaGrid ) + { + for ( X = DrealLambdaGridX; X < MaxGridX; X = X + 1 ) + { + PixelX = ((float)(X) * DrealLambdaGridStep); + PixelX = PixelX - DrealPixelGridX; + + if ( ( PixelX <= GraphicX2 ) && + ( PixelX >= GraphicX1 ) ) + + for ( Y = DrealLambdaGridY; Y < MaxGridY; Y = Y + 1 ) + { + PixelY = ((float)(Y) * DrealLambdaGridStep); + PixelY = PixelY - DrealPixelGridY; + PixelY = DrealGraphicDy - PixelY; + + if ( ( PixelY <= GraphicY2 ) && + ( PixelY >= GraphicY1 ) ) + { + XDrawPoint( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealGridGC, + PixelX, PixelY ); + } + } + } + } + + if ( UserGrid ) + { + Xmin = ( DrealLambdaGridX / DrealLambdaUserGridDx ) * DrealLambdaUserGridDx; + Ymin = ( DrealLambdaGridY / DrealLambdaUserGridDy ) * DrealLambdaUserGridDy; + + for ( X = Xmin; X < MaxGridX ; X = X + DrealLambdaUserGridDx ) + { + PixelX = ((float)(X) * DrealLambdaGridStep); + PixelX = PixelX - DrealPixelGridX; + + if ( ( PixelX <= GraphicX2 ) && + ( PixelX >= GraphicX1 ) ) + + for ( Y = Ymin; Y < MaxGridY; Y = Y + DrealLambdaUserGridDy ) + { + PixelY = ((float)(Y) * DrealLambdaGridStep); + PixelY = PixelY - DrealPixelGridY; + PixelY = DrealGraphicDy - PixelY; + + if ( ( PixelY <= GraphicY2 ) && + ( PixelY >= GraphicY1 ) ) + { + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealGridGC, + PixelX - 2, PixelY, + PixelX + 2, PixelY ); + + XDrawLine( DrealGraphicDisplay, + XtWindow( DrealGraphicWindow ), + DrealGridGC, + PixelX, PixelY + 2, + PixelX, PixelY - 2 ); + } + } + } + } + + + rdsend(); + return( DREAL_TRUE ); +} diff --git a/alliance/src/dreal/src/GMX_grid.h b/alliance/src/dreal/src/GMX_grid.h new file mode 100644 index 00000000..18963635 --- /dev/null +++ b/alliance/src/dreal/src/GMX_grid.h @@ -0,0 +1,76 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Grid.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GRID +# define DREAL_GRID + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_DEFAULT_GRID_X 0 +# define DREAL_DEFAULT_GRID_Y 0 +# define DREAL_DEFAULT_GRID_DX 40 +# define DREAL_DEFAULT_GRID_DY 40 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GMX_icon.c b/alliance/src/dreal/src/GMX_icon.c new file mode 100644 index 00000000..15d57091 --- /dev/null +++ b/alliance/src/dreal/src/GMX_icon.c @@ -0,0 +1,132 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Icon.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GTB.h" +# include "GMX.h" + +# include "GMX_icon.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static char IconBits[] = + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, + 0x78, 0x00, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x40, 0x00, 0x10, 0x18, 0x00, + 0x00, 0x00, 0x40, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x40, 0x00, 0x10, + 0x10, 0x00, 0x00, 0x00, 0x40, 0x00, 0x10, 0x30, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x10, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x10, 0xa0, 0x33, 0x7c, + 0xf0, 0x41, 0x00, 0x10, 0x20, 0x4a, 0xc6, 0x18, 0x42, 0x00, 0x10, 0x20, + 0x46, 0x83, 0x09, 0x42, 0x00, 0x10, 0x20, 0x02, 0x01, 0x01, 0x42, 0x00, + 0x10, 0x20, 0x02, 0x01, 0x01, 0x42, 0x00, 0x10, 0x20, 0x02, 0x01, 0xe1, + 0x43, 0x00, 0x10, 0x20, 0x02, 0xff, 0x19, 0x42, 0x00, 0x10, 0x20, 0x02, + 0x01, 0x04, 0x42, 0x00, 0x10, 0x20, 0x02, 0x01, 0x04, 0x42, 0x00, 0x10, + 0x30, 0x02, 0x01, 0x05, 0x42, 0x00, 0x10, 0x18, 0x02, 0x83, 0x05, 0x42, + 0x00, 0x10, 0x0c, 0x02, 0xc6, 0x04, 0x42, 0x00, 0xfe, 0x87, 0x0f, 0x7c, + 0xf8, 0xf7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, + 0x20, 0x00, 0x00, 0x00, 0x80, 0x01, 0x10, 0x40, 0x00, 0x06, 0x00, 0x00, + 0x02, 0x10, 0x40, 0x00, 0x01, 0x00, 0x00, 0x02, 0x10, 0x40, 0x00, 0x01, + 0x00, 0x00, 0x06, 0x20, 0x20, 0x80, 0x01, 0x00, 0x00, 0x04, 0x20, 0x20, + 0x80, 0x00, 0x00, 0x00, 0x0c, 0xc0, 0x18, 0xc0, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x07, 0x78, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x0c, 0x00, 0x00, + 0x00, 0x80, 0x07, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xc0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0c, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0xfe, + 0xff, 0xff, 0xff, 0x01, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealInitializeIcon | +| | +\------------------------------------------------------------*/ + +void DrealInitializeIcon() + +{ + rdsbegin(); + + DrealSetIcon( DrealTopLevel, + IconBits, IconWidth, IconHeight ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMX_icon.h b/alliance/src/dreal/src/GMX_icon.h new file mode 100644 index 00000000..8e98d775 --- /dev/null +++ b/alliance/src/dreal/src/GMX_icon.h @@ -0,0 +1,76 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Icon.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_ICON +# define DREAL_ICON + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define IconWidth 50 +# define IconHeight 50 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealInitializeIcon(); + +# endif diff --git a/alliance/src/dreal/src/GMX_menu.c b/alliance/src/dreal/src/GMX_menu.c new file mode 100644 index 00000000..9ca16b91 --- /dev/null +++ b/alliance/src/dreal/src/GMX_menu.c @@ -0,0 +1,236 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GTB.h" +# include "GSB.h" +# include "GMF.h" +# include "GME.h" +# include "GMC.h" +# include "GMV.h" +# include "GMT.h" +# include "GMS.h" +# include "GMH.h" +# include "GMX.h" + +# include "GMX_menu.h" + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + Widget DrealMenuBar; + + DrealMenuItem DrealMainMenu[] = + + { + { + "File", + 'F', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + DrealFileMenu + } + , + { + "Edit", + 'E', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + DrealEditMenu + } + , + { + "Window", + 'W', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + DrealWindowMenu + } + , + { + "Create", + 'C', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + DrealCreateMenu + } + , + { + "View", + 'V', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + DrealViewMenu + } + , + { + "Tools", + 'T', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + DrealToolsMenu + } + , + { + "Setup", + 'S', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + DrealSetupMenu + } + , + { + "Help", + 'H', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + True, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + DrealHelpMenu + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealInitializeMenu | +| | +\------------------------------------------------------------*/ + +void DrealInitializeMenu() + +{ + rdsbegin(); + + DrealMenuBar = XmCreateMenuBar( DrealMainWindow, + "DrealMenuBar", NULL, 0 ); + + DrealBuildMenus( DrealMenuBar, DrealMainMenu ); + + XtManageChild( DrealMenuBar ); + + rdsend(); +} + diff --git a/alliance/src/dreal/src/GMX_menu.h b/alliance/src/dreal/src/GMX_menu.h new file mode 100644 index 00000000..ea888fa3 --- /dev/null +++ b/alliance/src/dreal/src/GMX_menu.h @@ -0,0 +1,75 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MENU +# define DREAL_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern DrealMenuItem DrealMainMenu[]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealInitializeMenu(); + +# endif diff --git a/alliance/src/dreal/src/GMX_message.c b/alliance/src/dreal/src/GMX_message.c new file mode 100644 index 00000000..1c35150e --- /dev/null +++ b/alliance/src/dreal/src/GMX_message.c @@ -0,0 +1,290 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Message.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GTB.h" +# include "GMX.h" +# include "GMX_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + Widget DrealMessageMainForm; + Widget DrealMessageText [ DREAL_MAX_MESSAGE ]; + Widget DrealMessageLabel [ DREAL_MAX_MESSAGE ]; + Widget DrealMessageFrame [ DREAL_MAX_MESSAGE ]; + Widget DrealMessageForm [ DREAL_MAX_MESSAGE ]; + + static char *DrealMessageLabelName [ DREAL_MAX_MESSAGE ] = + + { + "X :", + "Y :", + "Dx :", + "Dy :", + NULL, + NULL, + NULL + }; + + static char *DrealMessageTextName [ DREAL_MAX_MESSAGE ] = + + { + "0", + "0", + "0", + "0", + "Measure", + "Select point", + "Enter base point" + }; + + static char *DrealMessageFormName [ DREAL_MAX_MESSAGE ] = + + { + "DrealMessageFormX", + "DrealMessageFormY", + "DrealMessageFormDx", + "DrealMessageFormDy", + "DrealMessageFormMode", + "DrealMessageFormInfo", + "DrealMessageFormPrompt" + }; + + static char *DrealMessageFrameName [ DREAL_MAX_MESSAGE ] = + + { + "DrealMessageFrameX", + "DrealMessageFrameY", + "DrealMessageFrameDx", + "DrealMessageFrameDy", + "DrealMessageFrameMode", + "DrealMessageFrameInfo", + "DrealMessageFramePrompt" + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealDisplayMessage | +| | +\------------------------------------------------------------*/ + +void DrealDisplayMessage( Where, Text ) + + char Where; + char *Text; +{ + XmString TextString; + + rdsbegin(); + + TextString = XmStringCreateSimple( Text ); + + XtVaSetValues( DrealMessageText[ Where ], XmNlabelString, TextString, NULL ); + + XmStringFree( TextString ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealPromptEditMeasure | +| | +\------------------------------------------------------------*/ + +void DrealPromptEditMeasure() + +{ + rdsbegin(); + + DrealDisplayMessage( DREAL_MESSAGE_MODE , "Measure" ); + DrealDisplayMessage( DREAL_MESSAGE_PROMPT, "Enter base point" ); + DrealDisplayMessage( DREAL_MESSAGE_INFO , "Select point" ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeMessage | +| | +\------------------------------------------------------------*/ + +void DrealInitializeMessage() + +{ + int Counter; + int Column; + int Left; + int Width; + + rdsbegin(); + + DrealMessageMainForm = + + XtVaCreateManagedWidget( "DrealMessageMainForm", + xmFormWidgetClass , + DrealMainForm , + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 193, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 199, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 0, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 200, + XmNfractionBase , 200, + NULL ); + + Column = 1; + Width = 17; + + for ( Counter = 0; Counter < DREAL_MAX_MESSAGE; Counter++ ) + { + if ( Counter == 4 ) Width = 22; + if ( Counter == 5 ) Width = 68; + if ( Counter == 6 ) Width = 40; + + DrealMessageFrame[ Counter ] = + + XtVaCreateManagedWidget( DrealMessageFrameName[ Counter ], + xmFrameWidgetClass, + DrealMessageMainForm, + XmNshadowType , XmSHADOW_ETCHED_IN, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , Column, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , Column + Width, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + NULL + ); + + DrealMessageForm[ Counter ] = + + XtVaCreateManagedWidget( DrealMessageFormName[ Counter ], + xmFormWidgetClass , + DrealMessageFrame[ Counter ], + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNfractionBase , 18, + NULL + ); + + if ( DrealMessageLabelName[ Counter ] != (char *)NULL ) + { + DrealMessageLabel [ Counter ] = + + XtVaCreateManagedWidget( DrealMessageLabelName[ Counter ], + xmLabelWidgetClass, + DrealMessageForm [ Counter ], + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 6, + XmNbottomAttachment , XmATTACH_FORM, + XmNtopAttachment , XmATTACH_FORM, + XmNrecomputeSize , False, + NULL + ); + Left = 6; + } + else + { + Left = 0; + } + + DrealMessageText [ Counter ] = + + XtVaCreateManagedWidget( DrealMessageTextName[ Counter ], + xmLabelWidgetClass, + DrealMessageForm [ Counter ], + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , Left, + XmNrecomputeSize , False, + NULL + ); + + Column = Column + Width; + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMX_message.h b/alliance/src/dreal/src/GMX_message.h new file mode 100644 index 00000000..d03e01f7 --- /dev/null +++ b/alliance/src/dreal/src/GMX_message.h @@ -0,0 +1,73 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Message.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MESSAGE +# define DREAL_MESSAGE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealInitializeMessage(); + extern void DrealPromptEditMeasure(); + +# endif diff --git a/alliance/src/dreal/src/GMX_motif.c b/alliance/src/dreal/src/GMX_motif.c new file mode 100644 index 00000000..2fc89e2a --- /dev/null +++ b/alliance/src/dreal/src/GMX_motif.c @@ -0,0 +1,198 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Motif.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GTB.h" +# include "GSB.h" +# include "GMX.h" +# include "GMS.h" + +# include "GMX_motif.h" +# include "GMX_graphic.h" +# include "GMX_event.h" +# include "GMX_message.h" +# include "GMX_menu.h" +# include "GMX_color.h" +# include "GMX_panel.h" +# include "GMX_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + XtAppContext DrealApplication; + Widget DrealTopLevel; + Widget DrealMainWindow; + Widget DrealMainForm; + + static String DrealFallBacks [] = + + { + "*.DrealMainWindow.iconName : Dreal", + "*DrealMenuBar*fontList : -*-helvetica-bold-r-*--14-*", + "*foreground : black", + "*background : gray", + "*fontList : -*-helvetica-medium-r-*--12-*", + NULL + }; + + static char DrealTopLevelTitle[ 128 ] = "Dreal : "; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealChangeTopLevelTitle | +| | +\------------------------------------------------------------*/ + +void DrealChangeTopLevelTitle( Title ) + + char *Title; +{ + rdsbegin(); + + if ( Title != (char *)NULL ) + { + strcpy( DrealTopLevelTitle + 8, Title ); + } + else + { + DrealTopLevelTitle[ 8 ] = '\0'; + } + + XtVaSetValues( DrealTopLevel, XmNtitle, DrealTopLevelTitle, NULL ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeRessources | +| | +\------------------------------------------------------------*/ + +void DrealInitializeRessources( argc, argv ) + + int *argc; + char *argv[]; +{ + Arg Args[ 2 ]; + + rdsbegin(); + + DrealTopLevel = XtVaAppInitialize( + &DrealApplication, + "dreal.xrdb", + NULL, + 0, + argc, + argv, + DrealFallBacks, + NULL + ); + + DrealLoadTopLevelConfig(); + + DrealInitializeColorMap(); + + DrealMainWindow = XtVaCreateManagedWidget( "DrealMainWindow", + xmMainWindowWidgetClass, + DrealTopLevel, + NULL); + + DrealMainForm = XtVaCreateManagedWidget( "DrealMainForm", + xmFormWidgetClass, + DrealMainWindow, + XmNfractionBase, + 200, + NULL ); + + DrealInitializeMenu(); + DrealInitializeMessage(); + DrealInitializePanel(); + DrealInitializeGraphic(); + DrealInitializeEvent(); + DrealBuildPanelMap(); + DrealInitializeMapEvent(); + DrealInitializeColors(); + DrealInitializeGraphicContext(); + DrealInitializeDialog(); + DrealBuildPanelLibrary(); + DrealInitializeIcon(); + + XtSetArg( Args[0], XmNallowShellResize, True ); + XtSetArg( Args[1], XmNdeleteResponse, XmDO_NOTHING ); + + XtSetValues( DrealTopLevel, Args, 1 ); + + XtRealizeWidget( DrealTopLevel ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMX_motif.h b/alliance/src/dreal/src/GMX_motif.h new file mode 100644 index 00000000..475e30fa --- /dev/null +++ b/alliance/src/dreal/src/GMX_motif.h @@ -0,0 +1,70 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Motif.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MOTIF +# define DREAL_MOTIF + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GMX_panel.c b/alliance/src/dreal/src/GMX_panel.c new file mode 100644 index 00000000..0378e491 --- /dev/null +++ b/alliance/src/dreal/src/GMX_panel.c @@ -0,0 +1,126 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "GSB.h" +# include "GTB.h" +# include "GMF.h" +# include "GME.h" +# include "GMC.h" +# include "GMV.h" +# include "GMT.h" +# include "GMS.h" +# include "GMH.h" +# include "GMX.h" + +# include "GMX_panel.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealInitializePanel | +| | +\------------------------------------------------------------*/ + +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(); +} diff --git a/alliance/src/dreal/src/GMX_panel.h b/alliance/src/dreal/src/GMX_panel.h new file mode 100644 index 00000000..373ee06d --- /dev/null +++ b/alliance/src/dreal/src/GMX_panel.h @@ -0,0 +1,72 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_PANEL +# define DREAL_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealInitializeIcon(); + +# endif diff --git a/alliance/src/dreal/src/GMX_view.c b/alliance/src/dreal/src/GMX_view.c new file mode 100644 index 00000000..51343218 --- /dev/null +++ b/alliance/src/dreal/src/GMX_view.c @@ -0,0 +1,973 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : View.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GSB.h" +# include "GRD.h" +# include "GMX.h" + +# include "GMX_view.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static long DrealGraphicX1; + static long DrealGraphicX2; + static long DrealGraphicY1; + static long DrealGraphicY2; + static XFontStruct *DrealTextFont; + static GC DrealTextGC; + static GC DrealDrawGC; + static GC DrealFillGC; + static drealview *DrealHeadView = (drealview *)NULL; + static drealview *DrealHeadViewString = (drealview *)NULL; + static char DrealInterrupt = 0; + static char DrealCheckInt = 0; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Alloc Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealAllocView | +| | +\------------------------------------------------------------*/ + + drealview *DrealAllocView() + { + return((drealview *)rdsallocheap( sizeof(drealview) ) ); + } + +/*------------------------------------------------------------\ +| | +| Free Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealFreeView | +| | +\------------------------------------------------------------*/ + +void DrealFreeView( FreeView ) + + drealview *FreeView; +{ + rdsfreeheap((char *)FreeView, sizeof(drealview)); +} + +/*------------------------------------------------------------\ +| | +| DrealAddViewLater | +| | +\------------------------------------------------------------*/ + +void DrealAddViewLater( Rectangle ) + + rdsrec_list *Rectangle; +{ + drealview *View; + + rdsbegin(); + + View = DrealAllocView(); + + View->RECTANGLE = Rectangle; + View->NEXT = DrealHeadView; + DrealHeadView = View; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealAddViewString | +| | +\------------------------------------------------------------*/ + +void DrealAddViewString( Rectangle ) + + rdsrec_list *Rectangle; +{ + drealview *View; + + rdsbegin(); + + View = DrealAllocView(); + + View->RECTANGLE = Rectangle; + View->NEXT = DrealHeadViewString; + DrealHeadViewString = View; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDelView | +| | +\------------------------------------------------------------*/ + +void DrealDelView() +{ + drealview *DelView; + drealview *View; + + rdsbegin(); + + View = DrealHeadView; + DrealHeadView = (drealview *)NULL; + + while( View != (drealview *)NULL ) + { + DelView = View; + View = View->NEXT; + + DrealFreeView( DelView ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDelViewString | +| | +\------------------------------------------------------------*/ + +void DrealDelViewString() +{ + drealview *DelView; + drealview *View; + + rdsbegin(); + + View = DrealHeadViewString; + DrealHeadViewString = (drealview *)NULL; + + while( View != (drealview *)NULL ) + { + DelView = View; + View = View->NEXT; + + DrealFreeView( DelView ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDisplayOneRectangle | +| | +\------------------------------------------------------------*/ + + +void DrealDisplayOneRectangle( Rec ) + + rdsrec_list *Rec; +{ + long X1r; + long X2r; + long Y1r; + long Y2r; + long DeltaX; + long DeltaY; + long Xcr; + long Ycr; + char DrawLine; + char Tiny; + char Small; + char RdsLayer; + + rdsbegin(); + + RdsLayer = GetRdsLayer( Rec ); + + X1r = (float)( Rec->X ) * DrealLambdaGridStep; + Y1r = (float)( Rec->Y ) * DrealLambdaGridStep; + X2r = (float)( Rec->X + Rec->DX ) * DrealLambdaGridStep; + Y2r = (float)( Rec->Y + Rec->DY ) * DrealLambdaGridStep; + + X1r = ( X1r / RDS_PHYSICAL_GRID ) - DrealPixelGridX; + X2r = ( X2r / RDS_PHYSICAL_GRID ) - DrealPixelGridX; + Y1r = ( Y1r / RDS_PHYSICAL_GRID ) - DrealPixelGridY; + Y2r = ( Y2r / RDS_PHYSICAL_GRID ) - DrealPixelGridY; + + if ( ( X1r <= X2r ) && + ( Y1r <= Y2r ) ) + { + DrawLine = 0; + Tiny = 0; + Small = 0; + + DeltaX = X2r - X1r; + DeltaY = Y2r - Y1r; + + if ( ( DeltaX <= 1 ) || + ( DeltaY <= 1 ) ) Tiny = 1; + else + if ( DREAL_FILL_MODE != DREAL_FILL_MODE_FILL ) + { + if ( ( DeltaX <= 4 ) || + ( DeltaY <= 4 ) ) + { + Small = ! DREAL_FORCE_DISPLAY; + } + } + + if ( Tiny ) + { + if ( ( DeltaX <= 1 ) && + ( DeltaY <= 1 ) ) + { + XDrawPoint( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealDrawGC, + X1r, DrealGraphicDy - Y1r ); + } + else + if ( DeltaX <= 1 ) + { + Xcr = ( X1r + X2r ) >> 1; + + XDrawLine( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealDrawGC, + Xcr, DrealGraphicDy - Y1r, + Xcr, DrealGraphicDy - Y2r ); + } + else + { + Ycr = ( Y1r + Y2r ) >> 1; + + XDrawLine( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealDrawGC, + X1r, DrealGraphicDy - Ycr, + X2r, DrealGraphicDy - Ycr ); + } + } + else + { + if ( ! Small ) + { + if ( X1r < DrealGraphicX1 ) + { + X1r = DrealGraphicX1; DrawLine |= DREAL_WEST_MASK; + } + + if ( X2r > DrealGraphicX2 ) + { + X2r = DrealGraphicX2; DrawLine |= DREAL_EAST_MASK; + } + + if ( Y1r < DrealGraphicY1 ) + { + Y1r = DrealGraphicY1; DrawLine |= DREAL_SOUTH_MASK; + } + + if ( Y2r > DrealGraphicY2 ) + { + Y2r = DrealGraphicY2; DrawLine |= DREAL_NORTH_MASK; + } + } + + if ( ( X1r <= X2r ) && + ( Y1r <= Y2r ) ) + { + if ( ( X1r == X2r ) && + ( Y1r == Y2r ) ) + { + X2r++; + Y2r++; + } + + if ( DrawLine == 0 ) + { + XDrawRectangle( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealDrawGC, + X1r, DrealGraphicDy - Y2r, + X2r - X1r, + Y2r - Y1r ); + } + else + { + if ( ( DrawLine & DREAL_WEST_MASK ) == 0 ) + { + XDrawLine( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealDrawGC, + X1r, DrealGraphicDy - Y2r, + X1r, DrealGraphicDy - Y1r ); + } + + if ( ( DrawLine & DREAL_EAST_MASK ) == 0 ) + { + XDrawLine( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealDrawGC, + X2r, DrealGraphicDy - Y2r, + X2r, DrealGraphicDy - Y1r ); + } + + if ( ( DrawLine & DREAL_SOUTH_MASK ) == 0 ) + { + XDrawLine( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealDrawGC, + X1r, DrealGraphicDy - Y1r, + X2r, DrealGraphicDy - Y1r ); + } + + if ( ( DrawLine & DREAL_NORTH_MASK ) == 0 ) + { + XDrawLine( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealDrawGC, + X1r, DrealGraphicDy - Y2r, + X2r, DrealGraphicDy - Y2r ); + } + } + + if ( ( ! Small ) && + ( RdsLayer != RDS_ABOX ) && + ( DREAL_FILL_MODE != DREAL_FILL_MODE_OUTLINE ) ) + { + if ( DREAL_FILL_MODE == DREAL_FILL_MODE_PATTERN ) + { + XSetFillStyle( DrealGraphicDisplay, + DrealFillGC, + FillStippled ); + } + else + { + XSetFillStyle( DrealGraphicDisplay, + DrealFillGC, + FillSolid ); + } + + XFillRectangle( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealFillGC, + X1r, DrealGraphicDy - Y2r, + X2r - X1r, + Y2r - Y1r ); + } + } + } + + if ( ( DrawLine != 0 ) || + ( Rec->NAME == NULL ) ) + { + ClearDrealDrawText( Rec ); + } + } + else + { + ClearDrealDrawText( Rec ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDisplayOneString | +| | +\------------------------------------------------------------*/ + +void DrealDisplayOneString( Rec ) + + rdsrec_list *Rec; +{ + long X1r; + long X2r; + long Y1r; + long Y2r; + long WidthText; + long HeightText; + + rdsbegin(); + + X1r = (float)( Rec->X ) * DrealLambdaGridStep; + Y1r = (float)( Rec->Y ) * DrealLambdaGridStep; + X2r = (float)( Rec->X + Rec->DX ) * DrealLambdaGridStep; + Y2r = (float)( Rec->Y + Rec->DY ) * DrealLambdaGridStep; + + X1r = ( X1r / RDS_PHYSICAL_GRID ) - DrealPixelGridX; + X2r = ( X2r / RDS_PHYSICAL_GRID ) - DrealPixelGridX; + Y1r = ( Y1r / RDS_PHYSICAL_GRID ) - DrealPixelGridY; + Y2r = ( Y2r / RDS_PHYSICAL_GRID ) - DrealPixelGridY; + + HeightText = DrealTextFont->ascent; + WidthText = XTextWidth( DrealTextFont, + Rec->NAME, strlen( Rec->NAME ) ); + + WidthText = XTextWidth( DrealTextFont, + Rec->NAME, strlen( Rec->NAME ) ); + + if ( DREAL_BLACK_BOX_STRING ) + { + XDrawImageString( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealTextGC, + (( X1r + X2r - WidthText ) >> 1), + DrealGraphicDy - (( Y1r + Y2r - HeightText ) >> 1), + Rec->NAME, strlen( Rec->NAME ) ); + } + else + { + XDrawString( DrealGraphicDisplay, + DrealGraphicPixmap, + DrealTextGC, + (( X1r + X2r - WidthText ) >> 1), + DrealGraphicDy - (( Y1r + Y2r - HeightText ) >> 1), + Rec->NAME, strlen( Rec->NAME ) ); + } + + ClearDrealDrawText( Rec ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealCheckInterrupt | +| | +\------------------------------------------------------------*/ + +char DrealCheckInterrupt() +{ + XEvent Event; + KeySym Key; + char Text[ 2 ]; + + rdsbegin(); + + if ( DrealCheckInt ) + { + if ( XCheckTypedEvent( DrealGraphicDisplay, KeyPress, &Event ) ) + { + XLookupString( &Event.xkey, Text, 1, &Key, 0 ); + + if ( Text[ 0 ] == '\003' ) + { + DrealInterrupt = 1; + + XBell( DrealGraphicDisplay, 0 ); + } + } + } + + DrealCheckInt = 0; + + rdsend(); + + return( DrealInterrupt ); +} + +/*------------------------------------------------------------\ +| | +| DrealInterruptDisplay | +| | +\------------------------------------------------------------*/ + +void DrealInterruptDisplay() +{ + rdsbegin(); + + DrealCheckInt = 1; + + signal( SIGALRM, DrealInterruptDisplay ); + alarm( 1 ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealFlushEventDisplay | +| | +\------------------------------------------------------------*/ + +void DrealFlushEventDisplay() +{ + XEvent Event; + + rdsbegin(); + + while ( XCheckTypedEvent( DrealGraphicDisplay, KeyPress, &Event ) ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDisplayFigure | +| | +\------------------------------------------------------------*/ + +void DrealDisplayFigure( GraphicX1, GraphicY1, GraphicX2, GraphicY2 ) + + long GraphicX1; + long GraphicY1; + long GraphicX2; + long GraphicY2; +{ + long Offset; + drealwin *ScanWin; + drealwinrec *ScanWinRec; + rdsrec_list *Rec; + char ScanRec; + char Layer; + char StaticLayer; + char DrawLine; + long Xmin; + long Ymin; + long Xmax; + long Ymax; + long X1; + long Y1; + long X2; + long Y2; + long X; + long Y; + long LambdaGridX; + long LambdaGridY; + long X1r; + long Y1r; + long X2r; + long Y2r; + long LambdaMin; + char DrawText; + char DrawTextFig; + char DrawTextFigSeg; + char DrawTextFigCon; + char DrawTextFigRef; + char DrawTextIns; + char DrawTextInsSeg; + char DrawTextInsCon; + char DrawTextInsRef; + drealview *View; + + rdsbegin(); + + DrealTextGC = DrealSmallTextGC; + DrealTextFont = DrealSmallTextFont; + DrawTextFig = 0; + DrawTextFigCon = 0; + DrawTextFigSeg = 0; + DrawTextFigRef = 0; + DrawTextIns = 0; + DrawTextInsCon = 0; + DrawTextInsSeg = 0; + DrawTextInsRef = 0; + DrealGraphicX1 = GraphicX1; + DrealGraphicX2 = GraphicX2; + DrealGraphicY1 = GraphicY1; + DrealGraphicY2 = GraphicY2; + + if ( ( DrealLambdaGridStep > DREAL_LOWER_FIGURE_STEP ) || + ( DREAL_FORCE_DISPLAY ) ) + { + DrawTextFig = DREAL_RDS_ACTIVE_NAME_TABLE[ DREAL_FIGURE_NAME ]; + } + + if ( ( DrealLambdaGridStep > DREAL_LOWER_INSTANCE_STEP ) || + ( DREAL_FORCE_DISPLAY ) ) + { + DrawTextIns = DREAL_RDS_ACTIVE_NAME_TABLE[ DREAL_INSTANCE_NAME ]; + } + + if ( ( DrealLambdaGridStep > DREAL_LOWER_CONNECTOR_STEP ) || + ( DREAL_FORCE_DISPLAY ) ) + { + DrawTextInsCon = DREAL_RDS_ACTIVE_NAME_TABLE[ DREAL_INSTANCE_CONNECTOR_NAME ]; + DrawTextFigCon = DREAL_RDS_ACTIVE_NAME_TABLE[ DREAL_FIGURE_CONNECTOR_NAME ]; + } + + if ( ( DrealLambdaGridStep > DREAL_LOWER_SEGMENT_STEP ) || + ( DREAL_FORCE_DISPLAY ) ) + { + DrawTextFigSeg = DREAL_RDS_ACTIVE_NAME_TABLE[ DREAL_FIGURE_SEGMENT_NAME ]; + DrawTextInsSeg = DREAL_RDS_ACTIVE_NAME_TABLE[ DREAL_INSTANCE_SEGMENT_NAME ]; + } + + if ( ( DrealLambdaGridStep > DREAL_LOWER_REFERENCE_STEP ) || + ( DREAL_FORCE_DISPLAY ) ) + { + DrawTextFigRef = DREAL_RDS_ACTIVE_NAME_TABLE[ DREAL_FIGURE_REFERENCE_NAME ]; + DrawTextInsRef = DREAL_RDS_ACTIVE_NAME_TABLE[ DREAL_INSTANCE_REFERENCE_NAME ]; + } + + if ( DrealLambdaGridStep > DREAL_LOWER_CONNECTOR_STEP ) + { + DrealTextGC = DrealMediumTextGC; + DrealTextFont = DrealMediumTextFont; + } + + if ( DrealLambdaGridStep > DREAL_LOWER_REFERENCE_STEP ) + { + DrealTextGC = DrealLargeTextGC; + DrealTextFont = DrealLargeTextFont; + } + + DrealClearGraphicWindow( GraphicX1, + DrealGraphicDy - GraphicY2, + GraphicX2 - GraphicX1, + GraphicY2 - GraphicY1 ); + + if ( DrealFigureRds == (rdsfig_list *)NULL ) + { + rdsend(); + return; + } + + LambdaMin = (float)(4.0 / ( DrealLambdaGridStep )); + + X1 = GraphicX1 + DrealPixelGridX; + X2 = GraphicX2 + DrealPixelGridX; + Y1 = GraphicY1 + DrealPixelGridY; + Y2 = GraphicY2 + DrealPixelGridY; + + X1 = ( X1 / DrealLambdaGridStep ); + Y1 = ( Y1 / DrealLambdaGridStep ); + X2 = ( X2 / DrealLambdaGridStep ); + Y2 = ( Y2 / DrealLambdaGridStep ); + + if ( X2 >= 0 ) { X2 = X2 + 1; } + if ( Y2 >= 0 ) { Y2 = Y2 + 1; } + if ( X1 <= 0 ) { X1 = X1 - 1; } + if ( Y1 <= 0 ) { Y1 = Y1 - 1; } + + X1 = X1 * RDS_PHYSICAL_GRID; + X2 = X2 * RDS_PHYSICAL_GRID; + Y1 = Y1 * RDS_PHYSICAL_GRID; + Y2 = Y2 * RDS_PHYSICAL_GRID; + + LambdaGridX = DrealLambdaGridX * RDS_PHYSICAL_GRID; + LambdaGridY = DrealLambdaGridY * RDS_PHYSICAL_GRID; + + Xmin = ( X1 - DrealWindowXmin ) / DrealWindowSide; + Xmax = ( X2 - DrealWindowXmin ) / DrealWindowSide; + Ymin = ( Y1 - DrealWindowYmin ) / DrealWindowSide; + Ymax = ( Y2 - DrealWindowYmin ) / DrealWindowSide; + + if ( Xmin < 0 ) Xmin = 0; + if ( Ymin < 0 ) Ymin = 0; + if ( Xmin >= DrealWindowDx ) Xmin = DrealWindowDx - 1; + if ( Ymin >= DrealWindowDy ) Ymin = DrealWindowDy - 1; + + if ( Xmax < 0 ) Xmax = 0; + if ( Ymax < 0 ) Ymax = 0; + if ( Xmax >= DrealWindowDx ) Xmax = DrealWindowDx - 1; + if ( Ymax >= DrealWindowDy ) Ymax = DrealWindowDy - 1; + + DrealInterrupt = 0; + DrealCheckInt = 0; + + signal( SIGALRM, DrealInterruptDisplay ); + alarm( 1 ); + + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + if ( DrealCheckInterrupt() ) break; + + StaticLayer = RDS_STATIC_LAYER[ Layer ]; + + if ( DREAL_RDS_ACTIVE_LAYER_TABLE[ StaticLayer ] != 1 ) continue; + + Y = Ymin; + + while ( Y <= Ymax ) + { + if ( DrealCheckInterrupt() ) break; + + X = Xmin; + + while ( X <= Xmax ) + { + if ( DrealCheckInterrupt() ) break; + + Offset = Y * DrealWindowDx + X; + + ScanWin = &DrealWindowTable[ Offset ]; + + if ( ScanWin->LAYERTAB != (drealwinrec **)NULL ) + { + for ( ScanWinRec = ScanWin->LAYERTAB[ Layer ]; + ScanWinRec != (drealwinrec *)NULL; + ScanWinRec = ScanWinRec->NEXT ) + { + for ( ScanRec = 0; ScanRec < DREAL_MAX_REC ; ScanRec++ ) + { + Rec = ScanWinRec->RECTAB[ ScanRec ]; + + if ( ( Rec != (rdsrec_list *)NULL ) && + ( ! IsDrealDeleted( Rec ) ) && + ( Rec->X <= X2 ) && + ( Rec->Y <= Y2 ) && + ( ( Rec->X + Rec->DX ) >= X1 ) && + ( ( Rec->Y + Rec->DY ) >= Y1 ) ) + { + if ( ( ! DREAL_INSTANCE_INTERFACE ) && + ( ! IsRdsFigRec( Rec ) ) && + ( ! IsRdsInstance( Rec ) ) ) continue; + + if ( ( Rec->DX < LambdaMin ) && + ( Rec->DY < LambdaMin ) ) + { + if ( ! DREAL_FORCE_DISPLAY ) continue; + } + + if ( ! IsDrealOneWindow( Rec ) ) + { + X1r = ( Rec->X - DrealWindowXmin ) / DrealWindowSide; + Y1r = ( Rec->Y - DrealWindowYmin ) / DrealWindowSide; + + if ( X1r < 0 ) X1r = 0; + if ( Y1r < 0 ) Y1r = 0; + if ( X1r >= DrealWindowDx ) X1r = DrealWindowDx - 1; + if ( Y1r >= DrealWindowDy ) Y1r = DrealWindowDy - 1; + + if ( X1r < Xmin ) X1r = Xmin; + if ( Y1r < Ymin ) Y1r = Ymin; + + if ( ( X1r != X ) || ( Y1r != Y ) ) + { + if ( ! DREAL_FORCE_DISPLAY ) continue; + } + } + + if ( ! IsRdsFigRec( Rec ) ) + { + if ( IsRdsConnector( Rec ) ) + { + DrawText = DrawTextInsCon; + } + else + if ( IsRdsReference( Rec ) ) + { + DrawText = DrawTextInsRef; + } + else + if ( IsRdsSegment( Rec ) ) + { + DrawText = DrawTextInsSeg; + } + else + { + DrawText = DrawTextIns; + } + } + else + { + if ( IsRdsConnector( Rec ) ) + { + DrawText = DrawTextFigCon; + } + else + if ( IsRdsReference( Rec ) ) + { + DrawText = DrawTextFigRef; + } + else + if ( IsRdsSegment( Rec ) ) + { + DrawText = DrawTextFigSeg; + } + else + { + DrawText = DrawTextFig; + } + } + + if ( DrawText ) SetDrealDrawText( Rec ); + + if ( IsDrealAccepted( Rec ) != 0 ) + { + DrealAddViewLater( Rec ); + } + else + { + DrealDrawGC = DrealLayerDrawGC[ StaticLayer ]; + DrealFillGC = DrealLayerFillGC[ StaticLayer ]; + + DrealDisplayOneRectangle( Rec ); + + if ( IsDrealDrawText( Rec ) ) + { + DrealAddViewString( Rec ); + } + } + } + } + } + } + + X = X + 1; + } + + Y = Y + 1; + } + + for ( View = DrealHeadView; + View != (drealview *)NULL; + View = View->NEXT ) + { + Rec = View->RECTANGLE; + + if ( IsDrealAccepted( Rec ) != 0 ) + { + DrealDrawGC = DrealAcceptDrawGC; + DrealFillGC = DrealLayerAcceptGC[ StaticLayer ]; + } + + DrealDisplayOneRectangle( Rec ); + } + + DrealDelView(); + } + + for ( View = DrealHeadViewString; + View != (drealview *)NULL; + View = View->NEXT ) + { + Rec = View->RECTANGLE; + + DrealDisplayOneString( Rec ); + } + + DrealDelViewString(); + + alarm( 0 ); + DrealFlushEventDisplay(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDisplayRectangle | +| | +\------------------------------------------------------------*/ + +void DrealDisplayRectangle( Rectangle ) + + rdsrec_list *Rectangle; +{ + rdsrec_list *ScanRec; + long Xmin; + long Ymin; + long Xmax; + long Ymax; + char Layer; + + rdsbegin(); + + Xmin = Rectangle->X; + Ymin = Rectangle->Y; + Xmax = Xmin + Rectangle->DX; + Ymax = Ymin + Rectangle->DY; + + Xmin = (float)( Xmin ) * DrealLambdaGridStep; + Ymin = (float)( Ymin ) * DrealLambdaGridStep; + Xmax = (float)( Xmax ) * DrealLambdaGridStep; + Ymax = (float)( Ymax ) * DrealLambdaGridStep; + + Xmin = ( Xmin / RDS_PHYSICAL_GRID ) - DrealPixelGridX - 1; + Xmax = ( Xmax / RDS_PHYSICAL_GRID ) - DrealPixelGridX + 1; + Ymin = ( Ymin / RDS_PHYSICAL_GRID ) - DrealPixelGridY - 1; + Ymax = ( Ymax / RDS_PHYSICAL_GRID ) - DrealPixelGridY + 1; + + if ( Xmin < 0 ) Xmin = 0; + if ( Ymin < 0 ) Ymin = 0; + + if ( Xmax > DrealGraphicDx ) Xmax = DrealGraphicDx; + if ( Ymax > DrealGraphicDy ) Ymax = DrealGraphicDy; + + if ( ( Xmax > 0 ) && + ( Ymax > 0 ) && + ( Xmin < DrealGraphicDx ) && + ( Ymin < DrealGraphicDy ) ) + { + DrealDisplayFigure( Xmin, Ymin , Xmax, Ymax ); + + DrealRefreshGraphicWindow( Xmin, DrealGraphicDy - Ymax, + Xmax - Xmin, Ymax - Ymin ); + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GMX_view.h b/alliance/src/dreal/src/GMX_view.h new file mode 100644 index 00000000..932e8313 --- /dev/null +++ b/alliance/src/dreal/src/GMX_view.h @@ -0,0 +1,85 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : View.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_VIEW +# define DREAL_VIEW + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Dreal View | +| | +\------------------------------------------------------------*/ + + typedef struct drealview + + { + struct drealview *NEXT; + rdsrec_list *RECTANGLE; + + } drealview ; + + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GRD.h b/alliance/src/dreal/src/GRD.h new file mode 100644 index 00000000..30adcdbd --- /dev/null +++ b/alliance/src/dreal/src/GRD.h @@ -0,0 +1,392 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : GRD101.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GRD +# define DREAL_GRD + +# define DREAL_SIZE (sizeof( drealrec )) + +# define DREAL_MAX_REC 8 +# define DREAL_ONE_WINDOW (long)0x00010000 +# define DREAL_DELETED (long)0x00020000 +# define DREAL_ACCEPTED (long)0x00040000 +# define DREAL_SELECTED (long)0x00100000 +# define DREAL_DRAW_TEXT (long)0x00200000 + +/*------------------------------------------------------------\ +| | +| Macros | +| | +\------------------------------------------------------------*/ + +# define DREAL_PREVIOUS( R ) \ + \ + ((rdsrec_list **)((R)->USER)) + +# define DREAL_WINDOW( R ) \ + \ + (((drealrec *)((char *)(R)+sizeof(rdsrec_list)))->WINDOW ) + +/*------------------------------------------------------------\ +| | +| Macros | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Windows | +| | +\------------------------------------------------------------*/ + +# define IsDrealOneWindow( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS & DREAL_ONE_WINDOW ) + +# define SetDrealOneWindow( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS |= DREAL_ONE_WINDOW ) + +# define ClearDrealOneWindow( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS &= ~DREAL_ONE_WINDOW ) + +/*------------------------------------------------------------\ +| | +| Deleted | +| | +\------------------------------------------------------------*/ + +# define IsDrealDeleted( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS & DREAL_DELETED ) + +# define SetDrealDeleted( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS |= DREAL_DELETED ) + +# define ClearDrealDeleted( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS &= ~DREAL_DELETED ) + +/*------------------------------------------------------------\ +| | +| Accepted | +| | +\------------------------------------------------------------*/ + +# define IsDrealAccepted( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS & DREAL_ACCEPTED ) + +# define SetDrealAccepted( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS |= DREAL_ACCEPTED ) + +# define ClearDrealAccepted( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS &= ~DREAL_ACCEPTED) + +/*------------------------------------------------------------\ +| | +| Selected | +| | +\------------------------------------------------------------*/ + +# define IsDrealSelected( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS & DREAL_SELECTED ) + +# define SetDrealSelected( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS |= DREAL_SELECTED ) + +# define ClearDrealSelected( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS &= ~DREAL_SELECTED) + +/*------------------------------------------------------------\ +| | +| DrawText | +| | +\------------------------------------------------------------*/ + +# define IsDrealDrawText( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS & DREAL_DRAW_TEXT ) + +# define SetDrealDrawText( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS |= DREAL_DRAW_TEXT ) + +# define ClearDrealDrawText( Rectangle ) \ + \ + ( ( Rectangle )->FLAGS &= ~DREAL_DRAW_TEXT ) + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Dreal Windows | +| | +\------------------------------------------------------------*/ + + typedef struct drealwinrec + + { + struct drealwinrec *NEXT; + rdsrec_list *RECTAB[ DREAL_MAX_REC ]; + + } drealwinrec; + + typedef struct drealwin + { + drealwinrec **LAYERTAB; + + } drealwin; + + typedef struct drealrecwin + + { + struct drealrecwin *NEXT; + drealwin *WINDOW; + + } drealrecwin; + +/*------------------------------------------------------------\ +| | +| Dreal Undo | +| | +\------------------------------------------------------------*/ + + typedef struct drealundorec + + { + struct drealundorec *NEXT; + rdsrec_list *RECTANGLE; + + } drealundorec; + + typedef struct drealundo + + { + struct drealundo *NEXT; + drealundorec *UNDO; + + } drealundo; + +/*------------------------------------------------------------\ +| | +| Dreal Select | +| | +\------------------------------------------------------------*/ + + typedef struct drealselect + + { + struct drealselect *NEXT; + rdsrec_list *RECTANGLE; + + } drealselect ; + +/*------------------------------------------------------------\ +| | +| Dreal Search | +| | +\------------------------------------------------------------*/ + + typedef struct drealsearch + + { + struct drealsearch *NEXT; + rdsrec_list *RECTANGLE; + + } drealsearch; + +/*------------------------------------------------------------\ +| | +| X Rectangle | +| | +\------------------------------------------------------------*/ + + typedef struct drealrec + + { + drealrecwin *WINDOW; + + } drealrec; + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char DrealRecomputeBound; + extern long DrealBoundXmin; + extern long DrealBoundYmin; + extern long DrealBoundXmax; + extern long DrealBoundYmax; + extern long DrealWindowXmin; + extern long DrealWindowYmin; + extern long DrealWindowXmax; + extern long DrealWindowYmax; + extern long DrealWindowDx; + extern long DrealWindowDy; + extern long DrealWindowSide; + extern long DrealWindowSize; + extern drealwin *DrealWindowTable; + extern rdsfig_list *DrealFigureRds; + + extern long DrealFigureXAB1; + extern long DrealFigureXAB2; + extern long DrealFigureYAB1; + extern long DrealFigureYAB2; + + extern drealundo *DrealHeadRedo; + extern drealundo *DrealHeadUndo; + extern drealselect *DrealHeadSelect; + extern drealsearch *DrealHeadSearch; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealAddFigure(); + extern rdsrec_list *DrealAddRectangle(); + extern rdsrec_list *DrealAddAbox(); + + extern void DrealNewFigure(); + + extern void DrealDelFigure(); + extern void DrealDelRectangle(); + + extern char DrealSaveFigure(); + extern void DrealFlattenFigure(); + + extern char Drealsaverdsfig(); + extern rdsfig_list *Drealgetrdsfig(); + +/*------------------------------------------------------------\ +| | +| Undo Acces Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealAddUndo(); + extern void DrealDelUndo(); + extern void DrealAddUndoRec(); + extern void DrealInitializeUndo(); + +/*------------------------------------------------------------\ +| | +| Flag Set & Clear Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealDeleteRectangle(); + extern void DrealUndeleteRectangle(); + extern void DrealSelectRectangle(); + extern void DrealUnselectRectangle(); + extern void DrealAcceptRectangle(); + extern void DrealRejectRectangle(); + +/*------------------------------------------------------------\ +| | +| Select Acces Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealAddSelect(); + extern void DrealDelSelect(); + extern void DrealPurgeSelect(); + +/*------------------------------------------------------------\ +| | +| Search Acces Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealAddSearch(); + extern void DrealDelSearch(); + +/*------------------------------------------------------------\ +| | +| Bound Compute | +| | +\------------------------------------------------------------*/ + + extern char DrealComputeBound(); + +/*------------------------------------------------------------\ +| | +| Window Acces Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealInitializeWindowTable(); + +/*------------------------------------------------------------\ +| | +| Error Message Functions | +| | +\------------------------------------------------------------*/ + + extern char *DrealGetErrorMessage(); + extern void DrealExitErrorMessage(); + +/*------------------------------------------------------------\ +| | +| Informations Functions | +| | +\------------------------------------------------------------*/ + + extern char *DrealGetInformations(); + +# endif diff --git a/alliance/src/dreal/src/GRD_error.c b/alliance/src/dreal/src/GRD_error.c new file mode 100644 index 00000000..e6a71bd4 --- /dev/null +++ b/alliance/src/dreal/src/GRD_error.c @@ -0,0 +1,406 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Error.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "rtl.h" +# include "GSB.h" +# include "GRD.h" +# include "GRD_error.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static FILE *DrealStreamErr; + static FILE *DrealStreamOut; + static FILE *DrealStreamAll; + + static char DrealErrFileName[ 40 ]; + static char DrealOutFileName[ 40 ]; + static char DrealAllFileName[ 40 ]; + + static char DrealNormalMode = 1; + +/*------------------------------------------------------------\ +| | +| Dreal Error Message | +| | +\------------------------------------------------------------*/ + + static char *DrealErrorBuffer = (char *)NULL; + +/*------------------------------------------------------------\ +| | +| Dreal Informations | +| | +\------------------------------------------------------------*/ + + static char DrealInformationsBuffer[ DREAL_INFORMATIONS_BUFFER_SIZE ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Dreal Error Message Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealExitCloseStream | +| | +\------------------------------------------------------------*/ + +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(); +} + +/*------------------------------------------------------------\ +| | +| DrealExitFatalError | +| | +\------------------------------------------------------------*/ + +void DrealExitFatalError() +{ + rdsbegin(); + + DrealExitCloseStream(); + + if ( DrealHeadUndo != (drealundo *)NULL ) + { + DrealFigureRds->NAME = namealloc( "dreal_dump" ); + DrealSaveFigure(); + } + + exit( 2 ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealExitErrorMessage | +| | +\------------------------------------------------------------*/ + +void DrealExitErrorMessage( Error ) + + int Error; +{ + rdsbegin(); + + DrealExitCloseStream(); + + if ( DrealHeadUndo != (drealundo *)NULL ) + { + CallbackFileSaveAs( NULL, NULL, NULL ); + } + + exit( Error ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeErrorMessage | +| | +\------------------------------------------------------------*/ + +void DrealInitializeErrorMessage( Debug ) + + char Debug; +{ + rdsbegin(); + + DrealNormalMode = ! Debug; + + if ( DrealNormalMode ) + { + sprintf( DrealOutFileName, "/tmp/%s_out_%d", DREAL_TOOL_NAME, getpid() ); + } + + sprintf( DrealErrFileName, "/tmp/%s_err_%d", DREAL_TOOL_NAME, getpid() ); + sprintf( DrealAllFileName, "/tmp/%s_all_%d", DREAL_TOOL_NAME, getpid() ); + + DrealStreamErr = freopen( DrealErrFileName, "w+", stderr); + DrealStreamAll = fopen ( DrealAllFileName, "w+" ); + + if ( DrealNormalMode ) + { + DrealStreamOut = freopen( DrealOutFileName, "w+", stdout); + } + else + { + DrealStreamOut = DrealStreamErr; + } + + if ( ( DrealStreamAll == (FILE *)NULL ) || + ( DrealStreamOut == (FILE *)NULL ) || + ( DrealStreamErr == (FILE *)NULL ) ) + { + fprintf( stdout, "Grm: Unable to open trace window !\n"); + exit( 1 ); + } + + if ( DrealNormalMode ) + { + unlink( DrealOutFileName ); + } + + unlink( DrealErrFileName ); + + signal( SIGINT, DrealExitErrorMessage ); + + if ( ! Debug ) + { + signal( SIGSEGV, DrealExitFatalError ); + signal( SIGUSR1, DrealExitFatalError ); + signal( SIGUSR2, DrealExitFatalError ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealFlushErrorMessage | +| | +\------------------------------------------------------------*/ + +void DrealFlushErrorMessage() +{ + int Data; + + rdsbegin(); + + fflush( DrealStreamErr ); + fseek( DrealStreamErr, 0L, 0 ); + + while( ( Data = fgetc( DrealStreamErr ) ) != EOF ) + { + fputc( Data, DrealStreamAll ); + } + + fclose( DrealStreamErr ); + + DrealStreamErr = freopen( DrealErrFileName, "w+", stderr ); + + if ( DrealNormalMode ) + { + fflush( DrealStreamOut ); + fseek( DrealStreamOut, 0L, 0 ); + + while( ( Data = fgetc( DrealStreamOut ) ) != EOF ) + { + fputc( Data, DrealStreamAll ); + } + + fclose( DrealStreamOut ); + + DrealStreamOut = freopen( DrealOutFileName, "w+", stdout ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealGetErrorMessage | +| | +\------------------------------------------------------------*/ + +char *DrealGetErrorMessage() +{ + char *Message; + long Length; + long Index; + int Data; + + rdsbegin(); + + DrealFlushErrorMessage(); + + fflush( DrealStreamAll ); + + Length = ftell( DrealStreamAll ); + + if ( DrealErrorBuffer != (char *)NULL ) + { + rdsfreeblock( DrealErrorBuffer ); + } + + DrealErrorBuffer = rdsallocblock( Length + 1 ); + Index = 0; + + while ( ( ( Data = fgetc( DrealStreamAll ) ) != EOF ) && + ( Index < Length ) ) + { + DrealErrorBuffer[ Index++ ] = (char)Data; + } + + rewind( DrealStreamAll ); + + DrealErrorBuffer[ Index ] = '\0'; + + if ( Index == 0 ) + { + Message = (char *)NULL; + } + else + { + Message = DrealErrorBuffer; + } + + rdsend(); + return( Message ); +} + +/*------------------------------------------------------------\ +| | +| DrealGetInformations | +| | +\------------------------------------------------------------*/ + +char *DrealGetInformations() + +{ + char *Scan; + + rdsbegin(); + + DrealComputeBound(); + + Scan = DrealInformationsBuffer; + + if ( DrealFigureRds != (rdsfig_list *)NULL ) + { + sprintf( Scan, " FIGURE : %s\n\n XAB1 : %.3f\n YAB1 : %.3f\n XAB2 : %.3f\n YAB2 : %.3f\n\n", + DrealFigureRds->NAME, + DrealFigureXAB1 * DREAL_RDS_UNIT_TO_MICRON, + DrealFigureYAB1 * DREAL_RDS_UNIT_TO_MICRON, + DrealFigureXAB2 * DREAL_RDS_UNIT_TO_MICRON, + DrealFigureYAB2 * DREAL_RDS_UNIT_TO_MICRON ); + } + else + { + sprintf( Scan, " FIGURE : No current figure !\n\n" ); + } + + Scan = Scan + strlen( Scan ); + + sprintf( Scan, " BOUNDING BOX : \n\n XMIN : %.3f\n YMIN : %.3f\n XMAX : %.3f\n YMAX : %.3f\n\n", + (float)( DrealBoundXmin ) * DREAL_RDS_UNIT_TO_MICRON, + (float)( DrealBoundYmin ) * DREAL_RDS_UNIT_TO_MICRON, + (float)( DrealBoundXmax ) * DREAL_RDS_UNIT_TO_MICRON, + (float)( DrealBoundYmax ) * DREAL_RDS_UNIT_TO_MICRON ); + + Scan = Scan + strlen( Scan ); + + sprintf( Scan, " WINDOWS : \n\n XMIN : %.3f\n YMIN : %.3f\n XMAX : %.3f\n YMAX : %.3f\n DX : %d\n DY : %d\n SIDE : %.3f\n\n", + (float)( DrealWindowXmin ) * DREAL_RDS_UNIT_TO_MICRON, + (float)( DrealWindowYmin ) * DREAL_RDS_UNIT_TO_MICRON, + (float)( DrealWindowXmax ) * DREAL_RDS_UNIT_TO_MICRON, + (float)( DrealWindowYmax ) * DREAL_RDS_UNIT_TO_MICRON, + DrealWindowDx, + DrealWindowDy, + (float)( DrealWindowSide ) * DREAL_RDS_UNIT_TO_MICRON ); + + Scan = Scan + strlen( Scan ); + + sprintf( Scan, " RDS TECHNOLOGY : %s\n\n", RDS_TECHNO_NAME ); + + Scan = Scan + strlen( Scan ); + + sprintf( Scan, " DREAL TECHNOLOGY : %s\n\n", DREAL_TECHNO_NAME ); + + + rdsend(); + return( DrealInformationsBuffer ); +} diff --git a/alliance/src/dreal/src/GRD_error.h b/alliance/src/dreal/src/GRD_error.h new file mode 100644 index 00000000..710d4731 --- /dev/null +++ b/alliance/src/dreal/src/GRD_error.h @@ -0,0 +1,74 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Error.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef GRD_ERROR +# define GRD_ERROR + +# define DREAL_INFORMATIONS_BUFFER_SIZE 1024 + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealFlushErrorMessage(); + +# endif diff --git a/alliance/src/dreal/src/GRD_rds.c b/alliance/src/dreal/src/GRD_rds.c new file mode 100644 index 00000000..9eb11c50 --- /dev/null +++ b/alliance/src/dreal/src/GRD_rds.c @@ -0,0 +1,611 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Rds.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rwi.h" +# include "rut.h" +# include "rtl.h" +# include "rpr.h" +# include "rfm.h" +# include "GSB.h" +# include "GRD.h" +# include "GRD_error.h" +# include "GRD_window.h" +# include "GRD_rds.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| For Set Long Jump | +| | +\------------------------------------------------------------*/ + + static jmp_buf DrealJumpBuffer; + static void (*OldExitHandler)() = NULL; + +/*------------------------------------------------------------\ +| | +| Dreal Figure | +| | +\------------------------------------------------------------*/ + + rdsfig_list *DrealFigureRds = (rdsfig_list *)NULL; + +/*------------------------------------------------------------\ +| | +| Dreal Abox | +| | +\------------------------------------------------------------*/ + + long DrealFigureXAB1 = 0; + long DrealFigureXAB2 = 0; + long DrealFigureYAB1 = 0; + long DrealFigureYAB2 = 0; + +/*------------------------------------------------------------\ +| | +| Dreal Exit Handler Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealExitHandler | +| | +\------------------------------------------------------------*/ + +void DrealExitHandler() +{ + DrealFlushErrorMessage(); + + longjmp( DrealJumpBuffer, 1); +} + +/*------------------------------------------------------------\ +| | +| DrealActiveExitHandler | +| | +\------------------------------------------------------------*/ + +void DrealActiveExitHandler() +{ + MBK_EXIT_FUNCTION = DrealExitHandler; +} + +/*------------------------------------------------------------\ +| | +| DrealResetExitHandler | +| | +\------------------------------------------------------------*/ + +void DrealResetExitHandler() +{ + MBK_EXIT_FUNCTION = NULL; +} + +/*------------------------------------------------------------\ +| | +| Dreal Add Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Dreal New Figure | +| | +\------------------------------------------------------------*/ + +void DrealNewFigure( Name ) + + char *Name; +{ + rdsbegin(); + + DrealFigureRds = addrdsfig( Name, DREAL_SIZE ); + + DrealFigureXAB1 = 0; + DrealFigureXAB2 = 0; + DrealFigureYAB1 = 0; + DrealFigureYAB2 = 0; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Dreal Add Figure | +| | +\------------------------------------------------------------*/ + +void DrealAddFigure( Name ) + + char *Name; +{ + char Layer; + rdsrec_list *Rectangle; + rdsrec_list *Abox; + rdsrec_list **Previous; + rdsins_list *Instance; + + rdsbegin(); + + DrealFigureRds = Drealgetrdsfig( Name, 'V', DREAL_SIZE ); + + if ( DrealFigureRds != (rdsfig_list *)NULL ) + { + Abox = DrealFigureRds->LAYERTAB[ RDS_ABOX ]; + + if ( Abox != (rdsrec_list *)0 ) + { + DrealCheckWindow( Abox->X , Abox->Y, + Abox->X + Abox->DX, Abox->Y + Abox->DY ); + + DrealFigureXAB1 = Abox->X; + DrealFigureXAB2 = Abox->X + Abox->DX; + DrealFigureYAB1 = Abox->Y; + DrealFigureYAB2 = Abox->Y + Abox->DY; + } + + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + Previous = &DrealFigureRds->LAYERTAB[ Layer ]; + + for ( Rectangle = DrealFigureRds->LAYERTAB[ Layer ]; + Rectangle != (rdsrec_list *)NULL; + Rectangle = Rectangle->NEXT ) + { + DREAL_PREVIOUS( Rectangle ) = Previous; + Previous = &Rectangle->NEXT; + + DrealInsertRectangle( Rectangle ); + } + } + + for ( Instance = DrealFigureRds->INSTANCE; + Instance != (rdsins_list *)NULL; + Instance = Instance->NEXT ) + { + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + for ( Rectangle = Instance->LAYERTAB[ Layer ]; + Rectangle != (rdsrec_list *)NULL; + Rectangle = Rectangle->NEXT ) + { + DREAL_PREVIOUS( Rectangle ) = (rdsrec_list **)Instance; + + DrealInsertRectangle( Rectangle ); + } + } + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Dreal Add Rectangle | +| | +\------------------------------------------------------------*/ + +rdsrec_list *DrealAddRectangle( Name, Layer, X, Y, Dx, Dy ) + + char *Name; + char Layer; + long X; + long Y; + long Dx; + long Dy; +{ + rdsrec_list *ScanRec; + + rdsbegin(); + + ScanRec = addrdsfigrec( DrealFigureRds, Name, Layer, X, Y, Dx, Dy ); + + DrealInsertRectangle( ScanRec ); + + if ( ScanRec->NEXT != (rdsrec_list *)0 ) + { + DREAL_PREVIOUS( ScanRec->NEXT ) = &ScanRec->NEXT; + } + + DREAL_PREVIOUS( ScanRec ) = &DrealFigureRds->LAYERTAB[ Layer ]; + + rdsend(); + return( ScanRec ); +} + +/*------------------------------------------------------------\ +| | +| Dreal Add Abox | +| | +\------------------------------------------------------------*/ + +rdsrec_list *DrealAddAbox( X, Y, Dx, Dy ) + + long X; + long Y; + long Dx; + long Dy; +{ + rdsrec_list *ScanRec; + + rdsbegin(); + + ScanRec = addrdsfigrec( DrealFigureRds, DrealFigureRds->NAME, RDS_ABOX, X, Y, Dx, Dy ); + + SetRdsFigure( ScanRec ); + + DrealFigureXAB1 = X; + DrealFigureXAB2 = X + Dx; + DrealFigureYAB1 = Y; + DrealFigureYAB2 = Y + Dy; + + DrealInsertRectangle( ScanRec ); + + if ( ScanRec->NEXT != (rdsrec_list *)0 ) + { + DREAL_PREVIOUS( ScanRec->NEXT ) = &ScanRec->NEXT; + } + + DREAL_PREVIOUS( ScanRec ) = &DrealFigureRds->LAYERTAB[ RDS_ABOX ]; + + rdsend(); + return( ScanRec ); +} + +/*------------------------------------------------------------\ +| | +| Dreal Delete Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Dreal Del Figure | +| | +\------------------------------------------------------------*/ + +void DrealDelFigure() + +{ + char Layer; + rdsrec_list *DelRec; + rdsrec_list *ScanRec; + rdsins_list *ScanIns; + rdsins_list *DelIns; + rdsfig_list *ScanFig; + + rdsbegin(); + + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + ScanRec = DrealFigureRds->LAYERTAB[ Layer ]; + + while ( ScanRec != (rdsrec_list *)NULL ) + { + DelRec = ScanRec; + ScanRec = ScanRec->NEXT; + + DrealEraseRecWin( DelRec ); + + freerdsrec( DelRec, DREAL_SIZE ); + } + + DrealFigureRds->LAYERTAB[ Layer ] = (rdsrec_list *)NULL; + } + + ScanIns = DrealFigureRds->INSTANCE; + + while ( ScanIns != (rdsins_list *)NULL ) + { + DelIns = ScanIns; + ScanIns = ScanIns->NEXT; + + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + ScanRec = DrealFigureRds->LAYERTAB[ Layer ]; + + while ( ScanRec != (rdsrec_list *)NULL ) + { + DelRec = ScanRec; + ScanRec = ScanRec->NEXT; + + DrealEraseRecWin( DelRec ); + + freerdsrec( DelRec, DREAL_SIZE ); + } + } + + freerdsins( DelIns ); + } + + DrealFigureRds->INSTANCE = (rdsins_list *)NULL; + DrealEraseWindow(); + + while ( HEAD_RDSFIG != (rdsfig_list *)NULL ) + { + delrdsfig( HEAD_RDSFIG->NAME ); + } + + DrealFigureRds = (rdsfig_list *)NULL; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Dreal Del Rectangle | +| | +\------------------------------------------------------------*/ + +void DrealDelRectangle( DelRec ) + + rdsrec_list *DelRec; +{ + *DREAL_PREVIOUS( DelRec ) = DelRec->NEXT; + + if ( DelRec->NEXT != (rdsrec_list *)0 ) + { + DREAL_PREVIOUS( DelRec->NEXT ) = DREAL_PREVIOUS( DelRec ); + } + + DrealEraseRectangle( DelRec ); + + freerdsrec( DelRec, DREAL_SIZE ); +} + +/*------------------------------------------------------------\ +| | +| Dreal Flatten Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Dreal Flatten Figure | +| | +\------------------------------------------------------------*/ + +void DrealFlattenFigure() +{ + rdsfig_list *Figure; + rdsins_list *ScanIns; + rdsrec_list *ScanRec; + rdsrec_list *DelRec; + rdsrec_list **Previous; + char Layer; + + rdsbegin(); + + for ( ScanIns = DrealFigureRds->INSTANCE; + ScanIns != (rdsins_list *)NULL; + ScanIns = ScanIns->NEXT ) + { + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + ScanRec = ScanIns->LAYERTAB[ Layer ]; + + ScanIns->LAYERTAB[ Layer ] = (rdsrec_list *)NULL; + + while ( ScanRec != (rdsrec_list *)NULL ) + { + DelRec = ScanRec; + ScanRec = ScanRec->NEXT; + + DrealEraseRectangle( DelRec ); + + freerdsrec( DelRec, DREAL_SIZE ); + } + } + } + + Figure = addrdsfig( "_ludo_", DREAL_SIZE ); + Figure->INSTANCE = DrealFigureRds->INSTANCE; + DrealFigureRds->INSTANCE = (rdsins_list *)NULL; + + Drealrflattenrdsfig( Figure, RDS_YES, RDS_NO ); + + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + Previous = &DrealFigureRds->LAYERTAB[ Layer ]; + ScanRec = Figure->LAYERTAB[ Layer ]; + + while ( ScanRec != (rdsrec_list *)NULL ) + { + DREAL_PREVIOUS( ScanRec ) = Previous; + Previous = &ScanRec->NEXT; + + DrealInsertRectangle( ScanRec ); + + if ( ScanRec->NEXT == (rdsrec_list *)NULL ) + { + ScanRec->NEXT = DrealFigureRds->LAYERTAB[ Layer ]; + DrealFigureRds->LAYERTAB[ Layer ] = Figure->LAYERTAB[ Layer ]; + Figure->LAYERTAB[ Layer ] = (rdsrec_list *)NULL; + + if ( ScanRec->NEXT != (rdsrec_list *)NULL ) + { + DREAL_PREVIOUS( ScanRec->NEXT ) = &ScanRec->NEXT; + } + + break; + } + + ScanRec = ScanRec->NEXT; + } + } + + delrdsfig( "_ludo_" ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Dreal Save Figure | +| | +\------------------------------------------------------------*/ + +char DrealSaveFigure() + +{ + rdsbegin(); + + DrealDelUndo( &DrealHeadRedo ); + DrealDelUndo( &DrealHeadUndo ); + + rdsend(); + return( Drealsaverdsfig( DrealFigureRds ) ); +} + +/*------------------------------------------------------------\ +| | +| Drealgetrdsfig | +| | +\------------------------------------------------------------*/ + +rdsfig_list *Drealgetrdsfig( FigureName, Mode ) + + char *FigureName; + char Mode; +{ + rdsfig_list *FigureRds; + + rdsbegin(); + + FigureName = namealloc( FigureName ); + + DrealActiveExitHandler(); + + if ( setjmp( DrealJumpBuffer ) == 0 ) + { + FigureRds = getrdsfig( FigureName, Mode, DREAL_SIZE ); + + DrealResetExitHandler(); + + rdsend(); + return( FigureRds ); + } + + DrealResetExitHandler(); + + delrdsfig( FigureName ); + + rdsend(); + return( (rdsfig_list *)NULL ); +} + +/*------------------------------------------------------------\ +| | +| Drealrflattenrdsfig | +| | +\------------------------------------------------------------*/ + +void Drealrflattenrdsfig( Figure, Concat, Catal ) + + rdsfig_list *Figure; + char Concat; + char Catal; +{ + rdsbegin(); + + DrealActiveExitHandler(); + + if ( setjmp( DrealJumpBuffer ) == 0 ) + { + rflattenrdsfig( Figure, Concat, Catal ); + } + + DrealResetExitHandler(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Drealsaverdsfig | +| | +\------------------------------------------------------------*/ + +char Drealsaverdsfig( FigureRds ) + + rdsfig_list *FigureRds; +{ + rdsbegin(); + + DrealActiveExitHandler(); + + if ( setjmp( DrealJumpBuffer ) == 0 ) + { + saverdsfig( FigureRds ); + + DrealResetExitHandler(); + + rdsend(); + return( DREAL_TRUE ); + } + + DrealResetExitHandler(); + + rdsend(); + return( DREAL_FALSE ); +} diff --git a/alliance/src/dreal/src/GRD_rds.h b/alliance/src/dreal/src/GRD_rds.h new file mode 100644 index 00000000..9e9e160a --- /dev/null +++ b/alliance/src/dreal/src/GRD_rds.h @@ -0,0 +1,73 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Rds.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef GRD_RDS +# define GRD_RDS + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern rdsfig_list *Drealgetrdsfig(); + extern void Drealrflattenrdsfig(); + +# endif diff --git a/alliance/src/dreal/src/GRD_search.c b/alliance/src/dreal/src/GRD_search.c new file mode 100644 index 00000000..e7cfb653 --- /dev/null +++ b/alliance/src/dreal/src/GRD_search.c @@ -0,0 +1,145 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| File : Search.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GSB.h" +# include "GRD_search.h" + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + drealsearch *DrealHeadSearch = (drealsearch *)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Alloc Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealAllocSearch | +| | +\------------------------------------------------------------*/ + +drealsearch *DrealAllocSearch() +{ + return((drealsearch *)rdsalloc(sizeof(drealsearch), 1)); +} + +/*------------------------------------------------------------\ +| | +| Free Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealFreeSearch | +| | +\------------------------------------------------------------*/ + +void DrealFreeSearch( FreeSearch ) + + drealsearch *FreeSearch; +{ + rdsfree((char *)FreeSearch, sizeof(drealsearch)); +} + +/*------------------------------------------------------------\ +| | +| DrealAddSearch | +| | +\------------------------------------------------------------*/ + +void DrealAddSearch( Rectangle ) + + rdsrec_list *Rectangle; +{ + drealsearch *Search; + + rdsbegin(); + + Search = DrealAllocSearch(); + + Search->RECTANGLE = Rectangle; + Search->NEXT = DrealHeadSearch; + DrealHeadSearch = Search; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDelSearch | +| | +\------------------------------------------------------------*/ + +void DrealDelSearch() + +{ + drealsearch *Search; + + rdsbegin(); + + while ( DrealHeadSearch != (drealsearch *)NULL ) + { + Search = DrealHeadSearch; + DrealHeadSearch = DrealHeadSearch->NEXT; + + DrealFreeSearch( Search ); + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GRD_search.h b/alliance/src/dreal/src/GRD_search.h new file mode 100644 index 00000000..8db545ea --- /dev/null +++ b/alliance/src/dreal/src/GRD_search.h @@ -0,0 +1,70 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Search.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef GRD_SEARCH +# define GRD_SEARCH + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GRD_select.c b/alliance/src/dreal/src/GRD_select.c new file mode 100644 index 00000000..af5f5d46 --- /dev/null +++ b/alliance/src/dreal/src/GRD_select.c @@ -0,0 +1,295 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Select.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GSB.h" + +# include "GRD_window.h" +# include "GRD_select.h" + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + drealselect *DrealHeadSelect = (drealselect *)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Alloc Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealAllocSelect | +| | +\------------------------------------------------------------*/ + +drealselect *DrealAllocSelect() +{ + return((drealselect *)rdsalloc(sizeof(drealselect), 1)); +} + +/*------------------------------------------------------------\ +| | +| Free Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealFreeSelect | +| | +\------------------------------------------------------------*/ + +void DrealFreeSelect( FreeSelect ) + + drealselect *FreeSelect; +{ + rdsfree((char *)FreeSelect, sizeof(drealselect)); +} + +/*------------------------------------------------------------\ +| | +| DrealAcceptRectangle | +| | +\------------------------------------------------------------*/ + +void DrealAcceptRectangle( Rectangle ) + + rdsrec_list *Rectangle; +{ + rdsbegin(); + + SetDrealAccepted( Rectangle ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealRejectRectangle | +| | +\------------------------------------------------------------*/ + +void DrealRejectRectangle( Rectangle ) + + rdsrec_list *Rectangle; +{ + rdsbegin(); + + ClearDrealAccepted( Rectangle ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealSelectRectangle | +| | +\------------------------------------------------------------*/ + +void DrealSelectRectangle( Rectangle ) + + rdsrec_list *Rectangle; +{ + rdsbegin(); + + SetDrealSelected( Rectangle ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealUnselectRectangle | +| | +\------------------------------------------------------------*/ + +void DrealUnselectRectangle( Rectangle ) + + rdsrec_list *Rectangle; +{ + rdsbegin(); + + ClearDrealSelected( Rectangle ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDeleteRectangle | +| | +\------------------------------------------------------------*/ + +void DrealDeleteRectangle( Rectangle ) + + rdsrec_list *Rectangle; +{ + rdsbegin(); + + SetDrealDeleted( Rectangle ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealUndeleteRectangle | +| | +\------------------------------------------------------------*/ + +void DrealUndeleteRectangle( Rectangle ) + + rdsrec_list *Rectangle; +{ + rdsbegin(); + + ClearDrealDeleted( Rectangle ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealAddSelect | +| | +\------------------------------------------------------------*/ + +void DrealAddSelect( Rectangle ) + + rdsrec_list *Rectangle; +{ + drealselect *Select; + + rdsbegin(); + + Select = DrealAllocSelect(); + + Select->RECTANGLE = Rectangle; + Select->NEXT = DrealHeadSelect; + DrealHeadSelect = Select; + + DrealSelectRectangle( Rectangle ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDelSelect | +| | +\------------------------------------------------------------*/ + +void DrealDelSelect() +{ + drealselect *DelSelect; + drealselect *Select; + + rdsbegin(); + + Select = DrealHeadSelect; + DrealHeadSelect = (drealselect *)NULL; + + while( Select != (drealselect *)NULL ) + { + DrealRejectRectangle( Select->RECTANGLE ); + + DelSelect = Select; + Select = Select->NEXT; + + DrealFreeSelect( DelSelect ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealPurgeSelect | +| | +\------------------------------------------------------------*/ + +void DrealPurgeSelect() +{ + drealselect *DelSelect; + drealselect *Select; + drealselect **Previous; + + rdsbegin(); + + Previous = &DrealHeadSelect; + Select = DrealHeadSelect; + + while( Select != (drealselect *)NULL ) + { + if ( ! IsDrealAccepted( Select->RECTANGLE ) ) + { + DelSelect = Select; + Select = Select->NEXT; + *Previous = Select; + + DrealFreeSelect( DelSelect ); + } + else + { + Previous = &Select->NEXT; + Select = Select->NEXT; + } + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GRD_select.h b/alliance/src/dreal/src/GRD_select.h new file mode 100644 index 00000000..7c0cbe95 --- /dev/null +++ b/alliance/src/dreal/src/GRD_select.h @@ -0,0 +1,70 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Select.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef GRD_SELECT +# define GRD_SELECT + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GRD_undo.c b/alliance/src/dreal/src/GRD_undo.c new file mode 100644 index 00000000..da23c243 --- /dev/null +++ b/alliance/src/dreal/src/GRD_undo.c @@ -0,0 +1,298 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Undo.c | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GRD.h" +# include "GSB.h" +# include "GRD_undo.h" + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + drealundo *DrealHeadUndo = (drealundo *)NULL; + drealundo *DrealHeadRedo = (drealundo *)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Alloc Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealAllocUndo | +| | +\------------------------------------------------------------*/ + +drealundo *DrealAllocUndo() +{ + return((drealundo *)rdsalloc(sizeof(drealundo), 1)); +} + +/*------------------------------------------------------------\ +| | +| DrealAllocUndoRec | +| | +\------------------------------------------------------------*/ + +drealundorec *DrealAllocUndoRec() +{ + return((drealundorec *)rdsalloc(sizeof(drealundorec), 1)); +} + +/*------------------------------------------------------------\ +| | +| Free Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealFreeUndo | +| | +\------------------------------------------------------------*/ + +void DrealFreeUndo( FreeUndo ) + + drealundo *FreeUndo; +{ + rdsfree((char *)FreeUndo, sizeof(drealundo)); +} + +/*------------------------------------------------------------\ +| | +| DrealFreeUndoRec | +| | +\------------------------------------------------------------*/ + +void DrealFreeUndoRec( FreeUndoRec ) + + drealundorec *FreeUndoRec; +{ + rdsfree((char *)FreeUndoRec, sizeof(drealundorec)); +} + +/*------------------------------------------------------------\ +| | +| DrealAddUndoRec | +| | +\------------------------------------------------------------*/ + +void DrealAddUndoRec( Rectangle ) + + rdsrec_list *Rectangle; +{ + drealundorec *UndoRec; + + rdsbegin(); + + UndoRec = DrealAllocUndoRec(); + UndoRec->RECTANGLE = Rectangle; + UndoRec->NEXT = DrealHeadUndo->UNDO; + DrealHeadUndo->UNDO = UndoRec; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealAddUndo | +| | +\------------------------------------------------------------*/ + +void DrealAddUndo() + +{ + drealundo *NewUndo; + + rdsbegin(); + + DrealDelUndo( &DrealHeadRedo ); + + NewUndo = DrealAllocUndo(); + NewUndo->NEXT = DrealHeadUndo; + DrealHeadUndo = NewUndo; + + DrealRecomputeBound = DREAL_TRUE; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEraseUndo | +| | +\------------------------------------------------------------*/ + +void DrealEraseUndo( HeadUndo ) + + drealundo **HeadUndo; +{ + drealundo *ScanUndo; + drealundo *DelUndo; + drealundorec *ScanUndoRec; + drealundorec *DelUndoRec; + + rdsbegin(); + + ScanUndo = *HeadUndo; + *HeadUndo = (drealundo *)NULL; + + while ( ScanUndo != (drealundo *)NULL ) + { + ScanUndoRec = ScanUndo->UNDO; + + while( ScanUndoRec != (drealundorec *)NULL ) + { + DelUndoRec = ScanUndoRec; + ScanUndoRec = ScanUndoRec->NEXT; + + DrealFreeUndoRec( DelUndoRec ); + } + + DelUndo = ScanUndo; + ScanUndo = ScanUndo->NEXT; + + DrealFreeUndo( DelUndo ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeUndo | +| | +\------------------------------------------------------------*/ + +void DrealInitializeUndo() + +{ + rdsbegin(); + + DrealEraseUndo( &DrealHeadUndo ); + DrealEraseUndo( &DrealHeadRedo ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealDelUndo | +| | +\------------------------------------------------------------*/ + +void DrealDelUndo( HeadUndo ) + + drealundo **HeadUndo; +{ + drealundo *ScanUndo; + drealundo *DelUndo; + drealundorec *ScanUndoRec; + drealundorec *DelUndoRec; + rdsrec_list *ScanRec; + drealundorec *HeadDelete; + drealundorec *Delete; + + rdsbegin(); + + HeadDelete = (drealundorec *)NULL; + ScanUndo = *HeadUndo; + *HeadUndo = (drealundo *)NULL; + + while ( ScanUndo != (drealundo *)NULL ) + { + ScanUndoRec = ScanUndo->UNDO; + + while( ScanUndoRec != (drealundorec *)NULL ) + { + ScanRec = ScanUndoRec->RECTANGLE; + + if ( IsDrealDeleted( ScanRec ) ) + { + DrealUndeleteRectangle( ScanRec ); + + Delete = ScanUndoRec; + ScanUndoRec = ScanUndoRec->NEXT; + Delete->NEXT = HeadDelete; + HeadDelete = Delete; + } + else + { + DelUndoRec = ScanUndoRec; + ScanUndoRec = ScanUndoRec->NEXT; + + DrealFreeUndoRec( DelUndoRec ); + } + } + + DelUndo = ScanUndo; + ScanUndo = ScanUndo->NEXT; + + DrealFreeUndo( DelUndo ); + } + + while( HeadDelete != (drealundorec *)NULL ) + { + Delete = HeadDelete; + HeadDelete = HeadDelete->NEXT; + + DrealDelRectangle( Delete->RECTANGLE ); + + DrealFreeUndoRec( Delete ); + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GRD_undo.h b/alliance/src/dreal/src/GRD_undo.h new file mode 100644 index 00000000..18767f37 --- /dev/null +++ b/alliance/src/dreal/src/GRD_undo.h @@ -0,0 +1,70 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Undo.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef GRD_UNDO +# define GRD_UNDO + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GRD_window.c b/alliance/src/dreal/src/GRD_window.c new file mode 100644 index 00000000..e465c868 --- /dev/null +++ b/alliance/src/dreal/src/GRD_window.c @@ -0,0 +1,1009 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Window.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rfm.h" +# include "GSB.h" +# include "GRD.h" +# include "GRD_window.h" + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + long DrealWindowXmin = 0; + long DrealWindowYmin = 0; + long DrealWindowXmax = 0; + long DrealWindowYmax = 0; + long DrealWindowDx = 0; + long DrealWindowDy = 0; + long DrealWindowSide = 0; + long DrealWindowSize = 0; + drealwin *DrealWindowTable = (drealwin *)NULL; + + long DrealBoundXmin = 0; + long DrealBoundYmin = 0; + long DrealBoundXmax = 0; + long DrealBoundYmax = 0; + + char DrealRecomputeBound = DREAL_TRUE; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Alloc Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealAllocWinLayer | +| | +\------------------------------------------------------------*/ + +drealwin *DrealAllocWinLayer( DrealWin ) + + drealwin *DrealWin; +{ + if ( DrealWin->LAYERTAB == (drealwinrec **)NULL ) + { + DrealWin->LAYERTAB = + + (drealwinrec **)rdsallocblock( sizeof(drealwinrec *) * RDS_MAX_LAYER ); + } +} + +/*------------------------------------------------------------\ +| | +| DrealAllocWinRec | +| | +\------------------------------------------------------------*/ + +drealwinrec *DrealAllocWinRec() +{ + return((drealwinrec *)rdsallocheap( sizeof(drealwinrec) ) ); +} + +/*------------------------------------------------------------\ +| | +| DrealAllocRecWin | +| | +\------------------------------------------------------------*/ + +drealrecwin *DrealAllocRecWin() +{ + return((drealrecwin *)rdsallocheap( sizeof(drealrecwin) ) ); +} + +/*------------------------------------------------------------\ +| | +| Free Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealFreeWinLayer | +| | +\------------------------------------------------------------*/ + +void DrealFreeWinLayer( FreeWin ) + + drealwin *FreeWin; +{ + if ( FreeWin->LAYERTAB != (drealwinrec **)NULL ) + { + rdsfreeblock( (char *)FreeWin->LAYERTAB ); + FreeWin->LAYERTAB = (drealwinrec **)NULL; + } +} + +/*------------------------------------------------------------\ +| | +| DrealFreeWinRec | +| | +\------------------------------------------------------------*/ + +void DrealFreeWinRec( FreeWinRec ) + + drealwinrec *FreeWinRec; +{ + rdsfreeheap( (char *)FreeWinRec, sizeof(drealwinrec) ); +} + +/*------------------------------------------------------------\ +| | +| DrealFreeRecWin | +| | +\------------------------------------------------------------*/ + +void DrealFreeRecWin( FreeRecWin ) + + drealrecwin *FreeRecWin; +{ + rdsfreeheap((char *)FreeRecWin, sizeof(drealrecwin) ); +} + +/*------------------------------------------------------------\ +| | +| Init Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Drealgetenv | +| | +\------------------------------------------------------------*/ + +long Drealgetenv( Name ) + + char *Name; +{ + char *String; + + rdsbegin(); + + String = mbkgetenv( Name ); + + if ( String == (char *)NULL ) + { + rdsend(); + return( 0 ); + } + + rdsend(); + return( atoi( String ) ); +} + +/*------------------------------------------------------------\ +| | +| DrealInitializeWindow | +| | +\------------------------------------------------------------*/ + +void DrealInitializeWindow() +{ + rdsbegin(); + + if ( DrealWindowTable == (drealwin *)NULL ) + { + DrealWindowDx = Drealgetenv( DREAL_WINDOW_DX ); + DrealWindowDy = Drealgetenv( DREAL_WINDOW_DY ); + DrealWindowXmin = Drealgetenv( DREAL_WINDOW_XMIN ); + DrealWindowYmin = Drealgetenv( DREAL_WINDOW_YMIN ); + DrealWindowSide = Drealgetenv( DREAL_WINDOW_SIDE ); + + if ( ( DrealWindowDx <= 0 ) || + ( DrealWindowDy <= 0 ) || + ( DrealWindowSide <= 0 ) ) + { + DrealWindowDx = DREAL_DEFAULT_WINDOW_DX; + DrealWindowDy = DREAL_DEFAULT_WINDOW_DY; + DrealWindowSize = DREAL_DEFAULT_WINDOW_DX * DREAL_DEFAULT_WINDOW_DY; + DrealWindowXmin = DREAL_DEFAULT_WINDOW_XMIN * RDS_PHYSICAL_GRID; + DrealWindowYmin = DREAL_DEFAULT_WINDOW_YMIN * RDS_PHYSICAL_GRID; + DrealWindowXmax = DREAL_DEFAULT_WINDOW_XMAX * RDS_PHYSICAL_GRID; + DrealWindowYmax = DREAL_DEFAULT_WINDOW_YMAX * RDS_PHYSICAL_GRID; + DrealWindowSide = DREAL_DEFAULT_WINDOW_SIDE * RDS_PHYSICAL_GRID; + } + else + { + DrealWindowSize = DrealWindowDx * DrealWindowDy; + DrealWindowSide = DrealWindowSide * RDS_PHYSICAL_GRID; + DrealWindowXmin = DrealWindowXmin * RDS_PHYSICAL_GRID; + DrealWindowYmin = DrealWindowYmin * RDS_PHYSICAL_GRID; + DrealWindowXmax = DrealWindowXmin + ( DrealWindowDx * DrealWindowSide ); + DrealWindowYmax = DrealWindowYmin + ( DrealWindowDy * DrealWindowSide ); + } + + DrealWindowTable = + + (drealwin *)rdsallocblock( sizeof(drealwin) * DrealWindowSize ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Purge Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealEraseWindow | +| | +\------------------------------------------------------------*/ + +void DrealEraseWindow() + +{ + long Offset; + drealwin *ScanWin; + drealwin *DelWin; + drealwinrec *ScanWinRec; + drealwinrec *DelWinRec; + char Layer; + + rdsbegin(); + + for ( Offset = 0; Offset < DrealWindowSize; Offset++ ) + { + ScanWin = &DrealWindowTable[ Offset ]; + + if ( ScanWin->LAYERTAB != (drealwinrec **)NULL ) + { + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + ScanWinRec = ScanWin->LAYERTAB[ Layer ]; + + while ( ScanWinRec != (drealwinrec *)NULL ) + { + DelWinRec = ScanWinRec; + ScanWinRec = ScanWinRec->NEXT; + + DrealFreeWinRec( DelWinRec ); + } + } + + DrealFreeWinLayer( ScanWin ); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealInsertRectangle | +| | +\------------------------------------------------------------*/ + +void DrealInsertRectangle( Rectangle ) + + rdsrec_list *Rectangle; +{ + drealwin *LinkWin; + drealrecwin *RecWin; + drealwinrec *WinRec; + char Layer; + char Index; + long Offset; + + long X1; + long X2; + long Y1; + long Y2; + long FirstX; + + rdsbegin(); + + Y1 = ( Rectangle->Y - 1 - DrealWindowYmin ) / DrealWindowSide; + Y2 = ( Rectangle->Y + Rectangle->DY - DrealWindowYmin ) / DrealWindowSide; + X1 = ( Rectangle->X - 1 - DrealWindowXmin ) / DrealWindowSide; + X2 = ( Rectangle->X + Rectangle->DX - DrealWindowXmin ) / DrealWindowSide; + + if ( X1 < 0 ) X1 = 0; + if ( X2 < 0 ) X2 = 0; + if ( X1 >= DrealWindowDx ) X1 = DrealWindowDx - 1; + if ( X2 >= DrealWindowDx ) X2 = DrealWindowDx - 1; + + if ( Y1 < 0 ) Y1 = 0; + if ( Y2 < 0 ) Y2 = 0; + if ( Y1 >= DrealWindowDy ) Y1 = DrealWindowDy - 1; + if ( Y2 >= DrealWindowDy ) Y2 = DrealWindowDy - 1; + + FirstX = X1; + + while ( Y1 <= Y2 ) + { + X1 = FirstX; + + while ( X1 <= X2 ) + { + Offset = Y1 * DrealWindowDx + X1; + + LinkWin = &DrealWindowTable[ Offset ]; + + if ( LinkWin->LAYERTAB == (drealwinrec **)NULL ) + { + DrealAllocWinLayer( LinkWin ); + } + + if ( DREAL_WINDOW( Rectangle ) == (drealrecwin *)NULL ) + { + DREAL_WINDOW( Rectangle ) = (drealrecwin *)LinkWin; + + SetDrealOneWindow( Rectangle ); + } + else + { + if ( IsDrealOneWindow( Rectangle ) ) + { + ClearDrealOneWindow( Rectangle ); + + RecWin = DrealAllocRecWin(); + RecWin->WINDOW = (drealwin *)DREAL_WINDOW( Rectangle ); + DREAL_WINDOW( Rectangle ) = RecWin; + } + + RecWin = DrealAllocRecWin(); + RecWin->WINDOW = LinkWin; + RecWin->NEXT = DREAL_WINDOW( Rectangle ); + DREAL_WINDOW( Rectangle ) = RecWin; + } + + Layer = GetRdsLayer( Rectangle ); + + WinRec = LinkWin->LAYERTAB[ Layer ]; + + if ( WinRec == (drealwinrec *)NULL ) + { + WinRec = DrealAllocWinRec(); + LinkWin->LAYERTAB[ Layer ] = WinRec; + WinRec->RECTAB[ 0 ] = Rectangle; + } + else + { + for ( Index = 0; Index < DREAL_MAX_REC; Index++ ) + { + if ( WinRec->RECTAB[ Index ] == (rdsrec_list *)NULL ) break; + } + + if ( Index == DREAL_MAX_REC ) + { + WinRec = DrealAllocWinRec(); + WinRec->NEXT = LinkWin->LAYERTAB[ Layer ]; + LinkWin->LAYERTAB[ Layer ] = WinRec; + WinRec->RECTAB[ 0 ] = Rectangle; + } + else + { + WinRec->RECTAB[ Index ] = Rectangle; + } + } + + X1 = X1 + 1; + } + + Y1 = Y1 + 1; + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEraseRectangle | +| | +\------------------------------------------------------------*/ + +void DrealEraseRectangle( Rectangle ) + + rdsrec_list *Rectangle; +{ + drealrecwin StaticRecWin; + drealrecwin *ScanRecWin; + drealrecwin *DelRecWin; + drealwinrec *ScanWinRec; + drealwinrec *FirstWinRec; + drealwin *ScanWin; + + char Layer; + char Index; + char Found; + + rdsbegin(); + + if ( IsDrealOneWindow( Rectangle ) ) + { + StaticRecWin.NEXT = (drealrecwin *)NULL; + StaticRecWin.WINDOW = (drealwin *)DREAL_WINDOW( Rectangle ); + ScanRecWin = &StaticRecWin; + } + else + { + ScanRecWin = DREAL_WINDOW( Rectangle ); + } + + Layer = GetRdsLayer( Rectangle ); + + while ( ScanRecWin != (drealrecwin *)NULL ) + { + DelRecWin = ScanRecWin; + ScanRecWin = ScanRecWin->NEXT; + + ScanWin = DelRecWin->WINDOW; + Found = DREAL_MAX_REC; + + FirstWinRec = ScanWin->LAYERTAB[ Layer ]; + + for ( ScanWinRec = FirstWinRec; + ScanWinRec != (drealwinrec *)NULL; + ScanWinRec = ScanWinRec->NEXT ) + { + for ( Index = 0; Index < DREAL_MAX_REC; Index++ ) + { + if ( ScanWinRec->RECTAB[ Index ] == Rectangle ) + { + Found = Index; break; + } + } + + if ( Found != DREAL_MAX_REC ) break; + } + + if ( ScanWinRec == FirstWinRec ) + { + ScanWinRec->RECTAB[ Found ] = (rdsrec_list *)NULL; + } + else + { + for ( Index = 0; Index < DREAL_MAX_REC; Index++ ) + { + if ( FirstWinRec->RECTAB[ Index ] != (rdsrec_list *)NULL ) break; + } + + ScanWinRec->RECTAB[ Found ] = FirstWinRec->RECTAB[ Index ]; + FirstWinRec->RECTAB[ Index ] = (rdsrec_list *)NULL; + } + + for ( Index = 0; Index < DREAL_MAX_REC; Index++ ) + { + if ( FirstWinRec->RECTAB[ Index ] != (rdsrec_list *)NULL ) break; + } + + if ( Index == DREAL_MAX_REC ) + { + ScanWin->LAYERTAB[ Layer ] = FirstWinRec->NEXT; + + DrealFreeWinRec( FirstWinRec ); + } + + if ( DelRecWin != &StaticRecWin ) + { + DrealFreeRecWin( DelRecWin ); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEraseRecWin | +| | +\------------------------------------------------------------*/ + +void DrealEraseRecWin( Rectangle ) + + rdsrec_list *Rectangle; +{ + drealrecwin *ScanRecWin; + drealrecwin *DelRecWin; + + rdsbegin(); + + if ( ! IsDrealOneWindow( Rectangle ) ) + { + ScanRecWin = DREAL_WINDOW( Rectangle ); + + do + { + DelRecWin = ScanRecWin; + ScanRecWin = ScanRecWin->NEXT; + + DrealFreeRecWin( DelRecWin ); + } + while ( ScanRecWin != (drealrecwin *)NULL ); + } + + DREAL_WINDOW( Rectangle ) = (drealrecwin *)NULL; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealViewWindow | +| | +\------------------------------------------------------------*/ + +# ifdef DEBUG + +void DrealViewWindow() +{ + drealwin *ScanWin; + drealwinrec *ScanWinRec; + rdsrec_list *Rectangle; + long X; + long Y; + long Xmin; + long Ymin; + long Xmax; + long Ymax; + long Counter; + long MaskCounter; + char Layer; + char ScanRec; + + rdsbegin(); + + fprintf( stdout, "\n\t--> Window\n" ); + fprintf( stdout, "\n\tXMIN : %d" , DrealWindowXmin ); + fprintf( stdout, "\n\tXMAX : %d" , DrealWindowXmax ); + fprintf( stdout, "\n\tYMIN : %d" , DrealWindowYmin ); + fprintf( stdout, "\n\tYMAX : %d" , DrealWindowYmax ); + fprintf( stdout, "\n\tDX : %d" , DrealWindowDx ); + fprintf( stdout, "\n\tDY : %d" , DrealWindowDy ); + fprintf( stdout, "\n\tSIDE : %d" , DrealWindowSide ); + fprintf( stdout, "\n\tSIZE : %d\n", DrealWindowSize ); + + fprintf( stdout, "\n\t--> Dump all windows\n" ); + + Ymin = DrealWindowYmin; + Ymax = Ymin + DrealWindowSide; + Y = 0; + + MaskCounter = 0; + + while ( Y < DrealWindowDy ) + { + Xmin = DrealWindowXmin; + Xmax = Xmin + DrealWindowSide ; + X = 0; + + ScanWin = DrealWindowTable[ Y * DrealWindowDx ]; + + while ( X < DrealWindowDx ) + { + fprintf( stdout, "\n\t--> Window[ %d, %d ]\n", X, Y ); + + fprintf( stdout, "\n\tXMIN : %d" , Xmin ); + fprintf( stdout, "\n\tYMIN : %d" , Ymin ); + fprintf( stdout, "\n\tXMAX : %d" , Xmax ); + fprintf( stdout, "\n\tYMAX : %d\n", Ymax ); + + if ( ScanWin != (drealwin *)NULL ) + { + Counter = 0; + + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + for ( ScanWinRec = ScanWin->LAYERTAB[ Layer ]; + ScanWinRec != (drealwinrec *)NULL; + ScanWinRec = ScanWinRec->NEXT ) + { + for ( ScanRec = 0; ScanRec < DREAL_MAX_REC ; ScanRec++ ) + { + Rectangle = ScanWinRec->RECTAB[ ScanRec ]; + + if ( Rectangle != (rdsrec_list *)NULL ) + { + if ( ( Rectangle->X > Xmax ) || + ( Rectangle->Y > Ymax ) || + ( Rectangle->X + Rectangle->DX < Xmin ) || + ( Rectangle->Y + Rectangle->DY < Ymin ) ) + { + viewrdsrec( Rectangle ); + } + else + { + Counter = Counter + 1; + } + } + } + } + } + + MaskCounter = MaskCounter + Counter; + + fprintf( stdout, "\n\t<-- Total rectangles %d", Counter ); + } + + Xmin = Xmax; + Xmax = Xmax + DrealWindowSide; + X = X + 1; + + ScanWin = DrealWindowTable[ Y * DrealWindowDx + X ]; + } + + Ymin = Ymax; + Ymax = Ymax + DrealWindowSide; + Y = Y + 1; + } + + fprintf( stdout, "\n<-- Total Rectangles %d\n", MaskCounter ); + + rdsend(); +} + +# endif + +/*------------------------------------------------------------\ +| | +| DrealComputeBound | +| | +\------------------------------------------------------------*/ + +char DrealComputeBound() + +{ + drealwin *ScanWin; + drealwinrec *ScanWinRec; + rdsrec_list *Rec; + long Offset; + long X; + long Y; + char Layer; + char FirstBound; + char ScanRec; + + if ( DrealFigureRds == (rdsfig_list *)NULL ) + { + return( DREAL_FALSE ); + } + + if ( DrealRecomputeBound == DREAL_FALSE ) + { + return( DREAL_TRUE ); + } + + rdsbegin(); + + DrealBoundXmin = 0; + DrealBoundXmax = 0; + DrealBoundYmin = 0; + DrealBoundYmax = 0; + + Y = 0; + + FirstBound = 1; + + while ( ( Y < DrealWindowDy ) && + ( FirstBound == 1 ) ) + { + Offset = Y * DrealWindowDx; + X = 0; + + while ( X < DrealWindowDx ) + { + ScanWin = &DrealWindowTable[ Offset ]; + + if ( ScanWin->LAYERTAB != (drealwinrec **)NULL ) + { + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + for ( ScanWinRec = ScanWin->LAYERTAB[ Layer ]; + ScanWinRec != (drealwinrec *)NULL; + ScanWinRec = ScanWinRec->NEXT ) + { + for ( ScanRec = 0; ScanRec < DREAL_MAX_REC ; ScanRec++ ) + { + Rec = ScanWinRec->RECTAB[ ScanRec ]; + + if ( ( Rec != (rdsrec_list *)NULL ) && + ( ! IsDrealDeleted( Rec ) ) ) + { + if ( FirstBound == 1 ) + { + FirstBound = 0; + DrealBoundYmin = Rec->Y; + } + else + if ( Rec->Y < DrealBoundYmin ) + { + DrealBoundYmin = Rec->Y; + } + } + } + } + } + } + + X = X + 1; + Offset = Offset + 1; + } + + Y = Y + 1; + } + + if ( FirstBound == 1 ) + { + rdsend(); + return( DREAL_FALSE ); + } + + FirstBound = 1; + + Y = DrealWindowDy - 1; + + while ( ( Y >= 0 ) && + ( FirstBound == 1 ) ) + { + Offset = Y * DrealWindowDx; + X = 0; + + while ( X < DrealWindowDx ) + { + ScanWin = &DrealWindowTable[ Offset ]; + + if ( ScanWin->LAYERTAB != (drealwinrec **)NULL ) + { + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + for ( ScanWinRec = ScanWin->LAYERTAB[ Layer ]; + ScanWinRec != (drealwinrec *)NULL; + ScanWinRec = ScanWinRec->NEXT ) + { + for ( ScanRec = 0; ScanRec < DREAL_MAX_REC ; ScanRec++ ) + { + Rec = ScanWinRec->RECTAB[ ScanRec ]; + + if ( ( Rec != (rdsrec_list *)NULL ) && + ( ! IsDrealDeleted( Rec ) ) ) + { + if ( FirstBound == 1 ) + { + FirstBound = 0; + DrealBoundYmax = Rec->Y + Rec->DY; + } + else + if ( ( Rec->Y + Rec->DY ) > DrealBoundYmax ) + { + DrealBoundYmax = Rec->Y + Rec->DY; + } + } + } + } + } + } + + X = X + 1; + Offset = Offset + 1; + } + + Y = Y - 1; + } + + FirstBound = 1; + + X = DrealWindowDx - 1; + + while ( ( X >= 0 ) && + ( FirstBound == 1 ) ) + { + Offset = X; + Y = 0; + + while ( Y < DrealWindowDy ) + { + ScanWin = &DrealWindowTable[ Offset ]; + + if ( ScanWin->LAYERTAB != (drealwinrec **)NULL ) + { + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + for ( ScanWinRec = ScanWin->LAYERTAB[ Layer ]; + ScanWinRec != (drealwinrec *)NULL; + ScanWinRec = ScanWinRec->NEXT ) + { + for ( ScanRec = 0; ScanRec < DREAL_MAX_REC ; ScanRec++ ) + { + Rec = ScanWinRec->RECTAB[ ScanRec ]; + + if ( ( Rec != (rdsrec_list *)NULL ) && + ( ! IsDrealDeleted( Rec ) ) ) + { + if ( FirstBound == 1 ) + { + FirstBound = 0; + DrealBoundXmax = Rec->X + Rec->DX; + } + else + if ( ( Rec->X + Rec->DX ) > DrealBoundXmax ) + { + DrealBoundXmax = Rec->X + Rec->DX; + } + } + } + } + } + } + + Y = Y + 1; + Offset = Offset + DrealWindowDx; + } + + X = X - 1; + } + + X = 0; + + FirstBound = 1; + + while ( ( X < DrealWindowDx ) && + ( FirstBound == 1 ) ) + { + Offset = X; + Y = 0; + + while ( Y < DrealWindowDy ) + { + ScanWin = &DrealWindowTable[ Offset ]; + + if ( ScanWin->LAYERTAB != (drealwinrec **)NULL ) + { + for ( Layer = 0; Layer < RDS_MAX_LAYER; Layer++ ) + { + for ( ScanWinRec = ScanWin->LAYERTAB[ Layer ]; + ScanWinRec != (drealwinrec *)NULL; + ScanWinRec = ScanWinRec->NEXT ) + { + for ( ScanRec = 0; ScanRec < DREAL_MAX_REC ; ScanRec++ ) + { + Rec = ScanWinRec->RECTAB[ ScanRec ]; + + if ( ( Rec != (rdsrec_list *)NULL ) && + ( ! IsDrealDeleted( Rec ) ) ) + { + if ( FirstBound == 1 ) + { + FirstBound = 0; + DrealBoundXmin = Rec->X; + } + else + if ( Rec->X < DrealBoundXmin ) + { + DrealBoundXmin = Rec->X; + } + } + } + } + } + } + + Y = Y + 1; + Offset = Offset + DrealWindowDx; + } + + X = X + 1; + } + + DrealRecomputeBound = DREAL_FALSE; + + rdsend(); + return( DREAL_TRUE ); +} + +/*------------------------------------------------------------\ +| | +| DrealCheckWindow | +| | +\------------------------------------------------------------*/ + +void DrealCheckWindow( CheckXmin, CheckYmin, CheckXmax, CheckYmax ) + + long CheckXmin; + long CheckYmin; + long CheckXmax; + long CheckYmax; +{ + long Border; + long SideX; + long SideY; + char Compute; + + rdsbegin(); + + Compute = 0; + Border = DREAL_WINDOW_BORDER * RDS_PHYSICAL_GRID; + + if ( ( CheckXmin - Border ) < DrealWindowXmin ) + { + DrealWindowXmin = CheckXmin - Border; + Compute = 1; + } + + if ( ( CheckYmin - Border ) < DrealWindowYmin ) + { + DrealWindowYmin = CheckYmin - Border; + Compute = 1; + } + + if ( ( CheckXmax + Border ) > DrealWindowXmax ) + { + DrealWindowXmax = CheckXmax + Border; + Compute = 1; + } + + if ( ( CheckYmax + Border ) > DrealWindowYmax ) + { + DrealWindowYmax = CheckYmax + Border; + Compute = 1; + } + + if ( Compute ) + { + DrealEraseWindow(); + rdsfreeblock( DrealWindowTable ); + + DrealWindowDx = DREAL_DEFAULT_WINDOW_DX; + DrealWindowDy = DREAL_DEFAULT_WINDOW_DY; + + SideX = 1 + ( DrealWindowXmax - DrealWindowXmin ) / DrealWindowDx; + SideY = 1 + ( DrealWindowYmax - DrealWindowYmin ) / DrealWindowDy; + + if ( SideX < SideY ) + { + DrealWindowSide = SideY; + } + else + { + DrealWindowSide = SideX; + } + + DrealWindowDx = 1 + ( DrealWindowXmax - DrealWindowXmin ) / DrealWindowSide; + DrealWindowDy = 1 + ( DrealWindowYmax - DrealWindowYmin ) / DrealWindowSide; + + DrealWindowXmax = DrealWindowXmin + ( DrealWindowDx * DrealWindowSide ); + DrealWindowYmax = DrealWindowYmin + ( DrealWindowDy * DrealWindowSide ); + DrealWindowSize = DrealWindowDx * DrealWindowDy; + + DrealWindowTable = + + (drealwin *)rdsallocblock( sizeof(drealwin) * DrealWindowSize ); + } + + rdsend(); +} diff --git a/alliance/src/dreal/src/GRD_window.h b/alliance/src/dreal/src/GRD_window.h new file mode 100644 index 00000000..6223ff09 --- /dev/null +++ b/alliance/src/dreal/src/GRD_window.h @@ -0,0 +1,91 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Window.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef GRD_WINDOW +# define GRD_WINDOW + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_DEFAULT_WINDOW_XMIN -4000 +# define DREAL_DEFAULT_WINDOW_YMIN -4000 +# define DREAL_DEFAULT_WINDOW_XMAX 16000 +# define DREAL_DEFAULT_WINDOW_YMAX 16000 +# define DREAL_DEFAULT_WINDOW_DX 100 +# define DREAL_DEFAULT_WINDOW_DY 100 +# define DREAL_DEFAULT_WINDOW_SIDE 200 + +# define DREAL_WINDOW_BORDER 4000 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealInitializeWindow(); + extern void DrealCheckWindow(); + extern void DrealEraseWindow(); + + extern void DrealInsertRectangle(); + extern void DrealEraseRectangle(); + extern void DrealEraseRecWin(); + + extern void DrealViewWindow(); + +# endif diff --git a/alliance/src/dreal/src/GSB.h b/alliance/src/dreal/src/GSB.h new file mode 100644 index 00000000..68df2ec3 --- /dev/null +++ b/alliance/src/dreal/src/GSB.h @@ -0,0 +1,189 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : GSB101.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GSB +# define DREAL_GSB + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define DREAL_TRUE 1 +# define DREAL_FALSE 0 + +# define DREAL_ERROR 1 +# define DREAL_OK 0 + +# define DREAL_NORTH 0 +# define DREAL_SOUTH 1 +# define DREAL_EAST 2 +# define DREAL_WEST 3 + +# define DREAL_NORTH_MASK 1 +# define DREAL_SOUTH_MASK 2 +# define DREAL_WEST_MASK 4 +# define DREAL_EAST_MASK 8 + +# define DREAL_DEFAULT_FIGURE_NAME "NONAME" + +/*------------------------------------------------------------\ +| | +| Edit Mode | +| | +\------------------------------------------------------------*/ + +# define DREAL_EDIT_MEASURE (char)0x00 + +# define DREAL_CREATE_RECTANGLE (char)0x01 +# define DREAL_CREATE_ABUTMENTBOX (char)0x02 +# define DREAL_SELECT_POINT_IDENTIFY (char)0x03 +# define DREAL_SELECT_POINT_COPY (char)0x04 +# define DREAL_SELECT_POINT_MOVE (char)0x05 +# define DREAL_SELECT_POINT_DELETE (char)0x06 +# define DREAL_SELECT_POINT_STRETCH (char)0x07 +# define DREAL_SELECT_POINT_MODIFY (char)0x08 +# define DREAL_SELECT_WINDOW_COPY (char)0x09 +# define DREAL_SELECT_WINDOW_MOVE (char)0x0A +# define DREAL_SELECT_WINDOW_DELETE (char)0x0B +# define DREAL_SELECT_WINDOW_MODIFY (char)0x0C +# define DREAL_SELECT_WINDOW_IDENTIFY (char)0x0D +# define DREAL_EDIT_COPY_POINT (char)0x0E +# define DREAL_EDIT_COPY_WINDOW (char)0x0F +# define DREAL_EDIT_MOVE_POINT (char)0x10 +# define DREAL_EDIT_MOVE_WINDOW (char)0x11 +# define DREAL_EDIT_STRETCH_POINT (char)0x12 + +# define DREAL_ZOOM_CENTER (char)0x80 +# define DREAL_ZOOM_IN (char)0x81 +# define DREAL_ZOOM_PAN (char)0x82 + +# define DREAL_ZOOM_MARK (char)0x80 + +/*------------------------------------------------------------\ +| | +| Input Mode | +| | +\------------------------------------------------------------*/ + +# define DREAL_INPUT_POINT 0 +# define DREAL_INPUT_ORTHO 1 +# define DREAL_INPUT_LINE 2 +# define DREAL_INPUT_LSTRING 3 +# define DREAL_INPUT_BOX 4 +# define DREAL_INPUT_SORTHO 5 +# define DREAL_INPUT_HALF_BOX 6 + +/*------------------------------------------------------------\ +| | +| Active Name | +| | +\------------------------------------------------------------*/ + +# define DREAL_FIGURE_NAME 0 +# define DREAL_INSTANCE_NAME 1 +# define DREAL_FIGURE_CONNECTOR_NAME 2 +# define DREAL_INSTANCE_CONNECTOR_NAME 3 +# define DREAL_FIGURE_SEGMENT_NAME 4 +# define DREAL_INSTANCE_SEGMENT_NAME 5 +# define DREAL_FIGURE_REFERENCE_NAME 6 +# define DREAL_INSTANCE_REFERENCE_NAME 7 + +# define DREAL_MAX_ACTIVE_NAME 8 + +/*------------------------------------------------------------\ +| | +| Fill Mode | +| | +\------------------------------------------------------------*/ + +# define DREAL_FILL_MODE_OUTLINE 0 +# define DREAL_FILL_MODE_FILL 1 +# define DREAL_FILL_MODE_PATTERN 2 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char *DREAL_RDS_LAYER_NAME_TABLE[ RDS_ALL_LAYER ][ 3 ]; + extern int DREAL_RDS_LAYER_PATTERN_TABLE[ RDS_ALL_LAYER ]; + extern char DREAL_RDS_ACTIVE_LAYER_TABLE[ RDS_ALL_LAYER ]; + extern char DREAL_RDS_ACTIVE_NAME_TABLE[ DREAL_MAX_ACTIVE_NAME ]; + extern float DREAL_LOWER_GRID_STEP; + extern float DREAL_LOWER_FIGURE_STEP; + extern float DREAL_LOWER_INSTANCE_STEP; + extern float DREAL_LOWER_REFERENCE_STEP; + extern float DREAL_LOWER_SEGMENT_STEP; + extern float DREAL_LOWER_CONNECTOR_STEP; + extern char *DREAL_CURSOR_COLOR_NAME; + extern long DREAL_CURSOR_SIZE; + extern float DREAL_RDS_UNIT_TO_MICRON; + extern float DREAL_PHYSICAL_GRID_TO_MICRON; + + extern char DREAL_INSTANCE_INTERFACE; + extern char DREAL_FILL_MODE; + extern char DREAL_XOR_CURSOR; + extern char DREAL_FORCE_DISPLAY; + extern char DREAL_BLACK_BOX_STRING; + extern char DREAL_SWITCH_COLOR_MAP; + + extern char *DREAL_TECHNO_NAME; + extern char *DREAL_GMS_FILE_NAME; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern char *DrealPostTreatString(); + extern void DrealLoadParameters(); + extern void DrealViewParameters(); + extern void Drealenv(); + + +# endif diff --git a/alliance/src/dreal/src/GSB_error.c b/alliance/src/dreal/src/GSB_error.c new file mode 100644 index 00000000..c947c90b --- /dev/null +++ b/alliance/src/dreal/src/GSB_error.c @@ -0,0 +1,184 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Gsb Errors | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rwi.h" +# include "rut.h" +# include "rpr.h" +# include "GSB.h" +# include "GSB_error.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +void GsbError( ErrorType, Message, Data ) + + char ErrorType; + char *Message; + long Data; +{ + fflush(stdout); + + fprintf( stderr, "Gsb %s: ", DREAL_TECHNO_NAME ); + + switch ( ErrorType ) + { + case DEFINE_MISSING : + + fprintf( stderr, "Some defines missing\n"); + break; + + case TABLE_MISSING : + + fprintf( stderr, "Some tables missing\n"); + break; + + case LINE_EXPECTED : + + fprintf( stderr, "%s expected line %lu\n", + Message, Data ); + break; + + case UNKNOWN_DEFINE : + + fprintf( stderr, "Unknown define %s line %lu\n", + Message, Data ); + break; + + case NOT_DEFINED : + + fprintf( stderr, "%s not defined line %lu\n", + Message, Data ); + break; + + case TOO_SMAL : + + fprintf( stderr, "%s too smal line %lu\n", + Message, Data ); + break; + + case MISSING_VALUE : + + fprintf( stderr, "Missing value at line %lu\n", + Data ); + break; + + case MISSING_NAME : + + fprintf( stderr, "Missing name of %s line %lu\n", + Message, Data ); + break; + + case UNEXPECTED_LINE : + + fprintf( stderr, "%s unexpected line %lu\n", + Message, Data ); + break; + + case UNEXPECTED_EOF : + + fprintf( stderr, "Unexpected end of file, missing definitions\n"); + break; + + case TOO_MANY_WORDS : + + fprintf( stderr, "Too many words %s unexpected line %lu\n", + Message, Data ); + break; + + case MISSING_TABLE : + + fprintf( stderr, "Missing value in %s table line %lu\n", + Message, Data ); + break; + + case OPEN_FILE : + + fprintf( stderr, "Parameters file can't be opened\n" ); + break; + + case UNKNOWN_TABLE : + + fprintf( stderr, "Unknown table %s line %lu\n", + Message , Data ); + break; + + case SYNTAX_ERROR : + + fprintf( stderr, "Syntax Error %s at line %lu\n", + Message , Data ); + break; + + case ILLEGAL_FLOAT : + + fprintf( stderr, "Illegal floating point number %s line %lu\n", + Message , Data ); + break; + } + + fflush( stderr ); + + exit( 1 ); +} diff --git a/alliance/src/dreal/src/GSB_error.h b/alliance/src/dreal/src/GSB_error.h new file mode 100644 index 00000000..5ef59585 --- /dev/null +++ b/alliance/src/dreal/src/GSB_error.h @@ -0,0 +1,88 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Gsb Errors | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef GSB_ERROR +# define GSB_ERROR + +/*------------------------------------------------------------\ +| | +| Rpr Error Constants | +| | +\------------------------------------------------------------*/ + +# define DEFINE_MISSING 0 +# define TABLE_MISSING 1 +# define LINE_EXPECTED 2 +# define UNKNOWN_DEFINE 3 +# define NOT_DEFINED 4 +# define TOO_SMAL 5 +# define MISSING_VALUE 6 +# define MISSING_NAME 7 +# define UNEXPECTED_LINE 8 +# define UNEXPECTED_EOF 9 +# define TOO_MANY_WORDS 10 +# define MISSING_TABLE 11 +# define OPEN_FILE 12 +# define UNKNOWN_TABLE 13 +# define SYNTAX_ERROR 14 +# define ILLEGAL_FLOAT 15 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GSB_parse.c b/alliance/src/dreal/src/GSB_parse.c new file mode 100644 index 00000000..c5453ff6 --- /dev/null +++ b/alliance/src/dreal/src/GSB_parse.c @@ -0,0 +1,843 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : GsbParse.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rwi.h" +# include "rut.h" +# include "rpr.h" +# include "GSB.h" + +# include "GSB_error.h" +# include "GSB_parse.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Global variables | +| | +\------------------------------------------------------------*/ + + char *DREAL_TECHNO_NAME = (char *)NULL; + +/*------------------------------------------------------------\ +| | +| Privates Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Table variables | +| | +\------------------------------------------------------------*/ + + char *DREAL_RDS_LAYER_NAME_TABLE[ RDS_ALL_LAYER ][ 3 ]; + int DREAL_RDS_LAYER_PATTERN_TABLE[ RDS_ALL_LAYER ]; + char *DREAL_CURSOR_COLOR_NAME; + + float DREAL_LOWER_GRID_STEP; + float DREAL_LOWER_FIGURE_STEP; + float DREAL_LOWER_INSTANCE_STEP; + float DREAL_LOWER_CONNECTOR_STEP; + float DREAL_LOWER_SEGMENT_STEP; + float DREAL_LOWER_REFERENCE_STEP; + long DREAL_CURSOR_SIZE; + float DREAL_RDS_UNIT_TO_MICRON; + float DREAL_PHYSICAL_GRID_TO_MICRON; + +/*------------------------------------------------------------\ +| | +| Keywords variables | +| | +\------------------------------------------------------------*/ + + static char KeywordDefined = 0; + + static char *DefineKeyword; + static char *TableKeyword; + static char *EndTableKeyword; + static char *EndRecordKeyword; + static char *RdsLayerNameKeyword; + static char *LowerGridStepKeyword; + static char *LowerFigureStepKeyword; + static char *LowerInstanceStepKeyword; + static char *LowerSegmentStepKeyword; + static char *LowerReferenceStepKeyword; + static char *LowerConnectorStepKeyword; + static char *CursorColorNameKeyword; + static char *CursorSizeKeyword; + + static keyword KeywordDefine[ GSB_MAX_KEYWORD ] = + + { + { "rds_abox", RDS_LAYER_ABOX }, + { "rds_activ", RDS_LAYER_ACTIV }, + { "rds_alu1", RDS_LAYER_ALU1 }, + { "rds_alu2", RDS_LAYER_ALU2 }, + { "rds_alu3", RDS_LAYER_ALU3 }, + { "rds_alu4", RDS_LAYER_ALU4 }, + { "rds_alu5", RDS_LAYER_ALU5 }, + { "rds_alu6", RDS_LAYER_ALU6 }, + { "rds_alu7", RDS_LAYER_ALU7 }, + { "rds_alu8", RDS_LAYER_ALU8 }, + { "rds_alu9", RDS_LAYER_ALU9 }, + { "rds_cont", RDS_LAYER_CONT }, + { "rds_cont2", RDS_LAYER_CONT2 }, + { "rds_cpas", RDS_LAYER_CPAS }, + { "rds_gate", RDS_LAYER_GATE }, + { "rds_ndif", RDS_LAYER_NDIF }, + { "rds_nimp", RDS_LAYER_NIMP }, + { "rds_ntie", RDS_LAYER_NTIE }, + { "rds_nwell", RDS_LAYER_NWELL }, + { "rds_pdif", RDS_LAYER_PDIF }, + { "rds_pimp", RDS_LAYER_PIMP }, + { "rds_poly", RDS_LAYER_POLY }, + { "rds_poly2", RDS_LAYER_POLY2 }, + { "rds_ptie", RDS_LAYER_PTIE }, + { "rds_pwell", RDS_LAYER_PWELL }, + { "rds_ref", RDS_LAYER_REF }, + { "rds_talu1", RDS_LAYER_TALU1 }, + { "rds_talu2", RDS_LAYER_TALU2 }, + { "rds_talu3", RDS_LAYER_TALU3 }, + { "rds_talu4", RDS_LAYER_TALU4 }, + { "rds_talu5", RDS_LAYER_TALU5 }, + { "rds_talu6", RDS_LAYER_TALU6 }, + { "rds_talu7", RDS_LAYER_TALU7 }, + { "rds_talu8", RDS_LAYER_TALU8 }, + { "rds_tcont", RDS_LAYER_TCONT }, + { "rds_tpoly", RDS_LAYER_TPOLY }, + { "rds_tpoly2", RDS_LAYER_TPOLY2 }, + { "rds_tvia1", RDS_LAYER_TVIA1 }, + { "rds_tvia2", RDS_LAYER_TVIA2 }, + { "rds_tvia3", RDS_LAYER_TVIA3 }, + { "rds_tvia4", RDS_LAYER_TVIA4 }, + { "rds_tvia5", RDS_LAYER_TVIA5 }, + { "rds_tvia6", RDS_LAYER_TVIA6 }, + { "rds_tvia7", RDS_LAYER_TVIA7 }, + { "rds_tvia8", RDS_LAYER_TVIA8 }, + { "rds_user0", RDS_LAYER_USER0 }, + { "rds_user1", RDS_LAYER_USER1 }, + { "rds_user2", RDS_LAYER_USER2 }, + { "rds_user3", RDS_LAYER_USER3 }, + { "rds_user4", RDS_LAYER_USER4 }, + { "rds_user5", RDS_LAYER_USER5 }, + { "rds_user6", RDS_LAYER_USER6 }, + { "rds_user7", RDS_LAYER_USER7 }, + { "rds_user8", RDS_LAYER_USER8 }, + { "rds_user9", RDS_LAYER_USER9 }, + { "rds_valu1", RDS_LAYER_VALU1 }, + { "rds_valu2", RDS_LAYER_VALU2 }, + { "rds_valu3", RDS_LAYER_VALU3 }, + { "rds_valu4", RDS_LAYER_VALU4 }, + { "rds_valu5", RDS_LAYER_VALU5 }, + { "rds_valu6", RDS_LAYER_VALU6 }, + { "rds_valu7", RDS_LAYER_VALU7 }, + { "rds_valu8", RDS_LAYER_VALU8 }, + { "rds_via1", RDS_LAYER_VIA1 }, + { "rds_via2", RDS_LAYER_VIA2 }, + { "rds_via3", RDS_LAYER_VIA3 }, + { "rds_via4", RDS_LAYER_VIA4 }, + { "rds_via5", RDS_LAYER_VIA5 }, + { "rds_via6", RDS_LAYER_VIA6 }, + { "rds_via7", RDS_LAYER_VIA7 }, + { "rds_via8", RDS_LAYER_VIA8 }, + { "rds_vpoly", RDS_LAYER_VPOLY }, + { "ref_con", MBK_REF_CON }, + { "ref_ref", MBK_REF_REF } + }; + +/*------------------------------------------------------------\ +| | +| File variables | +| | +\------------------------------------------------------------*/ + + static FILE *GsbFile; + static char GsbBuffer[ GSB_MAX_BUFFER ]; + static long GsbCurrentLine; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Gsb File Get String | +| | +\------------------------------------------------------------*/ + +char *GsbFileGetString( String, Size ) + + char *String; + int Size; +{ + register char *RegisterString; + register Register; + + rdsbegin(); + + RegisterString = String; + + while (--Size > 0 && (Register = getc( GsbFile )) != EOF ) + { + if ((*RegisterString++ = Register) == '\\') + { + if ((Register = getc( GsbFile )) == '\n') + { + *(RegisterString - 1) = ' '; + } + else + { + ungetc( Register, GsbFile ); + } + } + else + { + if ( Register == '\n') break; + } + } + + *RegisterString = '\0'; + + rdsend(); + return ( ( Register == EOF ) && + ( RegisterString == String ) ) ? (char *)NULL : String; +} + +/*------------------------------------------------------------\ +| | +| Gsb File Get Line | +| | +\------------------------------------------------------------*/ + +void GsbGetLine( Buffer ) + + char *Buffer; +{ + char *Check; + char *String; + char OneComment; + + rdsbegin(); + + do + { + OneComment = 0; + + Check = GsbFileGetString( Buffer, GSB_MAX_BUFFER ); + + if ( Check != (char *)NULL ) + { + GsbCurrentLine++; + } + else + { + GsbError( UNEXPECTED_EOF, (char *)NULL, GsbCurrentLine ); + } + + if ( String = strchr( Buffer, GSB_COMMENT_CHAR )) + { + if ( String == Buffer ) + { + OneComment = 1; + } + else + { + *(String - 1) = '\0'; + } + } + + while (*Buffer != '\0' && strchr( GSB_SEPARATORS_STRING, *Buffer)) + { + Buffer = Buffer + 1;; + } + + if (*Buffer == '\0') OneComment = 1; + + } + while ( OneComment == 1); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Gsb Check Keyword | +| | +\------------------------------------------------------------*/ + +char GsbCheckKeyword( Word ) + + char *Word; +{ + if ( ( Word == DefineKeyword ) || + ( Word == TableKeyword ) ) + { + return 1; + } + else + { + return 0; + } +} + +/*------------------------------------------------------------\ +| | +| Gsb Get First word | +| | +\------------------------------------------------------------*/ + +char *GsbGetFirstWord( Buffer, IsKeyword, Hash ) + + char *Buffer; + char IsKeyword; + char Hash; +{ + char *String; + char *Text; + int Index; + + rdsbegin(); + + if ( String = (char *)strtok( Buffer, GSB_SEPARATORS_STRING )) + { + if ( Hash ) + { + String = namealloc( String ); + } + else + { + Text = malloc( strlen( String ) + 1 ); + strcpy( Text, String ); + String = Text; + + for ( Index = 0; Text[ Index ]; Index++ ) + { + if ( Text[ Index ] == '_' ) Text[ Index ] = ' '; + } + } + + if ( ( IsKeyword ) && GsbCheckKeyword( String ) ) + { + GsbError( UNEXPECTED_LINE, String, GsbCurrentLine ); + } + } + + rdsend(); + return( String ); +} + +/*------------------------------------------------------------\ +| | +| Gsb Get Next word | +| | +\------------------------------------------------------------*/ + +char *GsbGetNextWord( IsKeyword, Hash ) + + char IsKeyword; + char Hash; +{ + char *String; + char *Text; + int Index; + + rdsbegin(); + + if ( String = (char *)strtok( (char *)NULL, GSB_SEPARATORS_STRING )) + { + if ( Hash ) + { + String = namealloc( String ); + } + else + { + Text = malloc( strlen( String ) + 1 ); + strcpy( Text, String ); + String = Text; + + for ( Index = 0; Text[ Index ]; Index++ ) + { + if ( Text[ Index ] == '_' ) Text[ Index ] = ' '; + } + } + + if ( ( IsKeyword ) && GsbCheckKeyword( String ) ) + { + GsbError( UNEXPECTED_LINE, String, GsbCurrentLine ); + } + } + + + rdsend(); + return( String ); +} + +/*------------------------------------------------------------\ +| | +| Gsb Keyword Compare | +| | +\------------------------------------------------------------*/ + + int GsbKeywordCompare( FirstKey, SecondKey ) + + keyword *FirstKey; + keyword *SecondKey; + { + return strcmp( FirstKey->NAME, SecondKey->NAME ); + } + +/*------------------------------------------------------------\ +| | +| Gsb Get String Value | +| | +\------------------------------------------------------------*/ + +long GsbGetStringValue( String ) + + char *String; +{ + long Value; + keyword *Keyword; + keyword Entry; + + rdsbegin(); + + if ( sscanf( String, "%d", &Value) ) + { + rdsend(); + return ( Value ); + } + + Entry.NAME = String; + + Keyword = (keyword *)bsearch( (char *)(&Entry), + (char *)KeywordDefine, + GSB_MAX_KEYWORD, sizeof( keyword ), + GsbKeywordCompare ); + + if ( Keyword == (keyword *)NULL ) + { + GsbError( UNEXPECTED_LINE, String, GsbCurrentLine ); + } + + rdsend(); + return( Keyword->VALUE ); +} + +/*------------------------------------------------------------\ +| | +| Gsb Get String Float | +| | +\------------------------------------------------------------*/ + +float GsbGetStringFloat( String ) + + char *String; +{ + float Value; + keyword *Keyword; + keyword Entry; + + rdsbegin(); + + if ( ! sscanf( String, "%g", &Value) ) + { + GsbError( ILLEGAL_FLOAT, String, GsbCurrentLine ); + } + + rdsend(); + return ( Value ); +} + +/*------------------------------------------------------------\ +| | +| Gsb Get Number | +| | +\------------------------------------------------------------*/ + +long GsbGetNumber( String ) + + char *String; +{ + long Value; + + rdsbegin(); + + if ( ! sscanf( String, "%d", &Value )) + { + GsbError( UNEXPECTED_LINE, "number", GsbCurrentLine ); + } + + rdsend(); + return Value; +} + +/*------------------------------------------------------------\ +| | +| Gsb Read Rds Layer Name | +| | +\------------------------------------------------------------*/ + +void GsbReadRdsLayerName() + +{ + char Layer; + char Pattern; + char LayerCount; + char EndTable; + char Field; + char *FirstWord; + + rdsbegin(); + + EndTable = 0; + LayerCount = 0; + + while ( ( EndTable != 1 ) && + ( LayerCount <= RDS_ALL_LAYER ) ) + { + GsbGetLine( GsbBuffer ); + + FirstWord = GsbGetFirstWord( GsbBuffer, 1, 1 ); + + if ( FirstWord == EndTableKeyword ) + { + EndTable = 1; + } + else + if ( LayerCount < RDS_ALL_LAYER ) + { + Layer = GsbGetStringValue( FirstWord ); + + for ( Field = 0; Field < 3; Field++ ) + { + FirstWord = GsbGetNextWord( 1, 0 ); + + if ( FirstWord == EndRecordKeyword ) + { + GsbError( MISSING_VALUE, (char *)NULL, GsbCurrentLine ); + } + else + if ( RDS_DYNAMIC_LAYER[ Layer ] != RDS_LAYER_UNUSED ) + { + DREAL_RDS_LAYER_NAME_TABLE [ Layer ][ Field ] = FirstWord; + } + } + + FirstWord = GsbGetNextWord( 0, 1 ); + + if ( FirstWord != EndRecordKeyword ) + { + Pattern = GsbGetStringValue( FirstWord ); + + if ( RDS_DYNAMIC_LAYER[ Layer ] != RDS_LAYER_UNUSED ) + { + DREAL_RDS_LAYER_PATTERN_TABLE[ Layer ] = (int)Pattern; + } + + FirstWord = GsbGetNextWord( 0, 1 ); + if ( FirstWord != EndRecordKeyword ) + { + GsbError( TOO_MANY_WORDS, FirstWord, GsbCurrentLine ); + } + } + } + + LayerCount = LayerCount + 1; + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Gsb Read Parameters | +| | +\------------------------------------------------------------*/ + +void GsbReadParam() + +{ + char *FirstWord; + char *SecondWord; + long Continue; + + rdsbegin(); + + Continue = 0; + + while ( Continue != GSB_ALL_DEFINED_MASK ) + { + GsbGetLine( GsbBuffer ); + + FirstWord = GsbGetFirstWord( GsbBuffer, 0, 1); + + if ( FirstWord == DefineKeyword ) + { + FirstWord = GsbGetNextWord( 1, 1 ); + + if (! FirstWord ) + { + GsbError( MISSING_NAME, DefineKeyword, GsbCurrentLine ); + } + + SecondWord = GsbGetNextWord( 1, 0 ); + + if (! SecondWord ) + { + GsbError( MISSING_VALUE, SecondWord ); + } + + if ( FirstWord == LowerGridStepKeyword ) + { + DREAL_LOWER_GRID_STEP = GsbGetStringFloat( SecondWord ); + + Continue |= GSB_LOWER_GRID_STEP_MASK; + } + else + if ( FirstWord == LowerFigureStepKeyword ) + { + DREAL_LOWER_FIGURE_STEP = GsbGetStringFloat( SecondWord ); + + Continue |= GSB_LOWER_FIGURE_STEP_MASK; + } + else + if ( FirstWord == LowerInstanceStepKeyword ) + { + DREAL_LOWER_INSTANCE_STEP = GsbGetStringFloat( SecondWord ); + + Continue |= GSB_LOWER_INSTANCE_STEP_MASK; + } + else + if ( FirstWord == LowerSegmentStepKeyword ) + { + DREAL_LOWER_SEGMENT_STEP = GsbGetStringFloat( SecondWord ); + + Continue |= GSB_LOWER_SEGMENT_STEP_MASK; + } + else + if ( FirstWord == LowerConnectorStepKeyword ) + { + DREAL_LOWER_CONNECTOR_STEP = GsbGetStringFloat( SecondWord ); + + Continue |= GSB_LOWER_CONNECTOR_STEP_MASK; + } + else + if ( FirstWord == LowerReferenceStepKeyword ) + { + DREAL_LOWER_REFERENCE_STEP = GsbGetStringFloat( SecondWord ); + + Continue |= GSB_LOWER_REFERENCE_STEP_MASK; + } + else + if ( FirstWord == CursorColorNameKeyword ) + { + DREAL_CURSOR_COLOR_NAME = namealloc( SecondWord ); + + Continue |= GSB_CURSOR_COLOR_NAME_MASK; + } + else + if ( FirstWord == CursorSizeKeyword ) + { + DREAL_CURSOR_SIZE = GsbGetStringValue( SecondWord ); + + Continue |= GSB_CURSOR_SIZE_MASK; + } + else + { + GsbError( UNKNOWN_DEFINE, FirstWord, GsbCurrentLine ); + } + } + else + if ( FirstWord == TableKeyword ) + { + if (!( FirstWord = GsbGetNextWord(1, 1))) + { + GsbError( MISSING_NAME, TableKeyword ); + } + + if ( FirstWord == RdsLayerNameKeyword ) + { + GsbReadRdsLayerName(); + + Continue |= GSB_RDS_LAYER_NAME_MASK; + } + else + { + GsbError( UNKNOWN_TABLE, FirstWord, GsbCurrentLine ); + } + } + else + { + GsbError( SYNTAX_ERROR, FirstWord, GsbCurrentLine ); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Gsb Load Parameters | +| | +\------------------------------------------------------------*/ + +void DrealLoadParameters() + +{ + char Layer; + char Buffer[ 512 ]; + char *String; + + rdsbegin(); + + DREAL_TECHNO_NAME = mbkgetenv( "DREAL_TECHNO_NAME" ); + + if ( DREAL_TECHNO_NAME == (char *)NULL ) + { + String = mbkgetenv( "ALLIANCE_TOP" ); + if ( String == (char *)NULL ) String = ALLIANCE_TOP; + + sprintf( Buffer, "%s/%s", String, DREAL_DEFAULT_TECHNO_NAME ); + DREAL_TECHNO_NAME = mbkstrdup( Buffer ); + } + + if ( ! KeywordDefined ) + { + DefineKeyword = namealloc( DEFINE_KEYWORD ); + TableKeyword = namealloc( TABLE_KEYWORD ); + EndTableKeyword = namealloc( END_TABLE_KEYWORD ); + EndRecordKeyword = namealloc( END_RECORD_KEYWORD ); + RdsLayerNameKeyword = namealloc( RDS_LAYER_NAME_KEYWORD ); + LowerGridStepKeyword = namealloc( LOWER_GRID_STEP_KEYWORD ); + LowerFigureStepKeyword = namealloc( LOWER_FIGURE_STEP_KEYWORD ); + LowerInstanceStepKeyword = namealloc( LOWER_INSTANCE_STEP_KEYWORD ); + LowerReferenceStepKeyword = namealloc( LOWER_REFERENCE_STEP_KEYWORD ); + LowerSegmentStepKeyword = namealloc( LOWER_SEGMENT_STEP_KEYWORD ); + LowerConnectorStepKeyword = namealloc( LOWER_CONNECTOR_STEP_KEYWORD ); + CursorColorNameKeyword = namealloc( CURSOR_COLOR_NAME_KEYWORD ); + CursorSizeKeyword = namealloc( CURSOR_SIZE_KEYWORD ); + + KeywordDefined = 1; + } + + for ( Layer = 0; Layer < RDS_ALL_LAYER; Layer++ ) + { + DREAL_RDS_LAYER_NAME_TABLE[ Layer ][0] = (char *)NULL; + DREAL_RDS_LAYER_NAME_TABLE[ Layer ][1] = (char *)NULL; + DREAL_RDS_LAYER_NAME_TABLE[ Layer ][2] = (char *)NULL; + DREAL_RDS_LAYER_PATTERN_TABLE[ Layer ] = -1; + } + + DREAL_LOWER_GRID_STEP = 0.0; + DREAL_LOWER_FIGURE_STEP = 0.0; + DREAL_LOWER_INSTANCE_STEP = 0.0; + DREAL_LOWER_CONNECTOR_STEP = 0.0; + DREAL_LOWER_SEGMENT_STEP = 0.0; + DREAL_LOWER_REFERENCE_STEP = 0.0; + DREAL_CURSOR_COLOR_NAME = (char *)NULL; + DREAL_CURSOR_SIZE = 5; + + if ( !( GsbFile = fopen( DREAL_TECHNO_NAME, "r"))) + + GsbError( OPEN_FILE, NULL, 0); + + GsbReadParam(); + + fclose( GsbFile ); + + DREAL_RDS_UNIT_TO_MICRON = 1.0 / (float)( RDS_UNIT ); + DREAL_PHYSICAL_GRID_TO_MICRON = (float)( RDS_PHYSICAL_GRID ) / (float)( RDS_UNIT ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| Gsb View Parameters | +| | +\------------------------------------------------------------*/ + +# ifdef DEBUG + +void DrealViewParameters() + +{ + char Layer; + + rdsbegin(); + + fprintf( stdout, "\nRDS_LAYER TABLE\n" ); + + for ( Layer = 0; Layer < RDS_ALL_LAYER; Layer++ ) + { + fprintf( stdout, "\nLayer:%d %s %s %s", + Layer, + DREAL_RDS_LAYER_NAME_TABLE[ Layer ][0], + DREAL_RDS_LAYER_NAME_TABLE[ Layer ][1], + DREAL_RDS_LAYER_NAME_TABLE[ Layer ][2] ); + } + + fprintf( stdout, "\n\nEND\n" ); + + rdsend(); +} + +# endif diff --git a/alliance/src/dreal/src/GSB_parse.h b/alliance/src/dreal/src/GSB_parse.h new file mode 100644 index 00000000..83d815d8 --- /dev/null +++ b/alliance/src/dreal/src/GSB_parse.h @@ -0,0 +1,111 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : GSB | +| | +| File : Gsbparse.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef GSB_PARSE +# define GSB_PARSE + +# define GSB_MAX_BUFFER 255 +# define GSB_MAX_KEYWORD 74 + +# define GSB_SEPARATORS_STRING " \t\n" +# define GSB_COMMENT_CHAR '#' + +/*------------------------------------------------------------\ +| | +| Keyword Constants | +| | +\------------------------------------------------------------*/ + +# define DEFINE_KEYWORD "DEFINE" +# define TABLE_KEYWORD "TABLE" +# define END_TABLE_KEYWORD "END" +# define END_RECORD_KEYWORD NULL + +# define RDS_LAYER_NAME_KEYWORD "DREAL_RDS_LAYER_NAME" +# define LOWER_GRID_STEP_KEYWORD "DREAL_LOWER_GRID_STEP" +# define LOWER_FIGURE_STEP_KEYWORD "DREAL_LOWER_FIGURE_STEP" +# define LOWER_INSTANCE_STEP_KEYWORD "DREAL_LOWER_INSTANCE_STEP" +# define LOWER_CONNECTOR_STEP_KEYWORD "DREAL_LOWER_CONNECTOR_STEP" +# define LOWER_SEGMENT_STEP_KEYWORD "DREAL_LOWER_SEGMENT_STEP" +# define LOWER_REFERENCE_STEP_KEYWORD "DREAL_LOWER_REFERENCE_STEP" +# define CURSOR_COLOR_NAME_KEYWORD "DREAL_CURSOR_COLOR_NAME" +# define CURSOR_SIZE_KEYWORD "DREAL_CURSOR_SIZE" + +# define GSB_RDS_LAYER_NAME_MASK 0x0001 +# define GSB_LOWER_GRID_STEP_MASK 0x0002 +# define GSB_LOWER_FIGURE_STEP_MASK 0x0004 +# define GSB_LOWER_INSTANCE_STEP_MASK 0x0008 +# define GSB_LOWER_REFERENCE_STEP_MASK 0x0010 +# define GSB_LOWER_SEGMENT_STEP_MASK 0x0020 +# define GSB_LOWER_CONNECTOR_STEP_MASK 0x0040 +# define GSB_CURSOR_COLOR_NAME_MASK 0x0080 +# define GSB_CURSOR_SIZE_MASK 0x0100 + +# define GSB_ALL_DEFINED_MASK 0x01FF + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ + + typedef struct keyword + { + char *NAME; + char VALUE; + + } keyword; + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GSB_share.c b/alliance/src/dreal/src/GSB_share.c new file mode 100644 index 00000000..cff79e3e --- /dev/null +++ b/alliance/src/dreal/src/GSB_share.c @@ -0,0 +1,231 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Share.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rwi.h" +# include "rut.h" +# include "rpr.h" +# include "GSB.h" +# include "GSB_share.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + char DREAL_RDS_ACTIVE_LAYER_TABLE[ RDS_ALL_LAYER ] = + + { + 1, /* RDS_NWELL */ + 1, /* RDS_PWELL */ + 1, /* RDS_NIMP */ + 1, /* RDS_PIMP */ + 1, /* RDS_ACTIV */ + 1, /* RDS_NDIF */ + 1, /* RDS_PDIF */ + 1, /* RDS_NTIE */ + 1, /* RDS_PTIE */ + 1, /* RDS_POLY */ + 1, /* RDS_VPOLY */ + 1, /* RDS_GATE */ + 1, /* RDS_TPOLY */ + 1, /* RDS_POLY2 */ + 1, /* RDS_CONT */ + 1, /* RDS_TCONT */ + 1, /* RDS_CONT2 */ + 1, /* RDS_ALU1 */ + 1, /* RDS_VALU1 */ + 1, /* RDS_TALU1 */ + 1, /* RDS_VIA1 */ + 1, /* RDS_TVIA1 */ + 1, /* RDS_ALU2 */ + 1, /* RDS_VALU2 */ + 1, /* RDS_TALU2 */ + 1, /* RDS_VIA2 */ + 1, /* RDS_TVIA2 */ + 1, /* RDS_ALU3 */ + 1, /* RDS_VALU3 */ + 1, /* RDS_TALU3 */ + 1, /* RDS_VIA3 */ + 1, /* RDS_TVIA3 */ + 1, /* RDS_ALU4 */ + 1, /* RDS_CPAS */ + 1, /* RDS_REF */ + 1, /* RDS_USER0 */ + 1, /* RDS_USER1 */ + 1, /* RDS_USER2 */ + 1 /* RDS_ABOX */ + }; + + char DREAL_RDS_ACTIVE_NAME_TABLE[ DREAL_MAX_ACTIVE_NAME ] = + + { + 1, /* FIGURE NAME */ + 1, /* INSTANCE NAME */ + 1, /* FIGURE CONNECTOR NAME */ + 1, /* INSTANCE CONNECTOR NAME */ + 1, /* FIGURE SEGMENT NAME */ + 1, /* INSTANCE SEGMENT NAME */ + 1, /* FIGURE REFERENCE NAME */ + 1 /* INSTANCE REFERENCE NAME */ + }; + +/*------------------------------------------------------------\ +| | +| Fill Mode and Instance Interface | +| | +\------------------------------------------------------------*/ + + char DREAL_FILL_MODE = DREAL_FILL_MODE_PATTERN; + char DREAL_INSTANCE_INTERFACE = DREAL_TRUE; + + char DREAL_XOR_CURSOR = DREAL_FALSE; + char DREAL_FORCE_DISPLAY = DREAL_FALSE; + char DREAL_BLACK_BOX_STRING = DREAL_FALSE; + char DREAL_SWITCH_COLOR_MAP = DREAL_FALSE; + +/*------------------------------------------------------------\ +| | +| File Name | +| | +\------------------------------------------------------------*/ + + char *DREAL_GMS_FILE_NAME = (char *)NULL; + +/*------------------------------------------------------------\ +| | +| DrealPostTreatString | +| | +\------------------------------------------------------------*/ + +char *DrealPostTreatString( Text ) + + char *Text; +{ + char OnlySpace; + int Counter; + + rdsbegin(); + + if ( Text != (char *)NULL ) + { + OnlySpace = 1; + + for ( Counter = 0; Text[ Counter ]; Counter++ ) + { + if ( Text[ Counter ] != ' ' ) OnlySpace = 0; + } + + if ( OnlySpace ) Text = (char *)NULL; + } + + rdsend(); + return( Text ); +} + +/*------------------------------------------------------------\ +| | +| Drealenv | +| | +\------------------------------------------------------------*/ + +void Drealenv() +{ + char *Env; + FILE *File; + char *Buffer; + + Env = mbkgetenv( "HOME" ); + + if ( Env == (char *)NULL ) + { + DREAL_GMS_FILE_NAME = GMS_FILE_NAME; + } + else + { + DREAL_GMS_FILE_NAME = + + (char *)rdsallocblock( strlen( Env ) + strlen( GMS_FILE_NAME ) + 2 ); + + strcpy( DREAL_GMS_FILE_NAME, Env ); + strcat( DREAL_GMS_FILE_NAME, "/" ); + strcat( DREAL_GMS_FILE_NAME, GMS_FILE_NAME ); + } + + Buffer = rdsallocblock( strlen( WORK_LIB ) + 32 ); + sprintf( Buffer, "%s/_ludo_%d", WORK_LIB, getpid() ); + + File = fopen( Buffer, "w" ); + + if ( File == (FILE *)0 ) + { + fprintf( stdout, "Gsb: fatal error, invalid MBK_WORK_LIB '%s'\n", WORK_LIB ); + exit( 3 ); + } + else + { + unlink( Buffer ); + fclose( File ); + } + + rdsfreeblock( Buffer ); +} diff --git a/alliance/src/dreal/src/GSB_share.h b/alliance/src/dreal/src/GSB_share.h new file mode 100644 index 00000000..8df11288 --- /dev/null +++ b/alliance/src/dreal/src/GSB_share.h @@ -0,0 +1,65 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Share.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef GSB_SHARE +# define GSB_SHARE + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GTB.h b/alliance/src/dreal/src/GTB.h new file mode 100644 index 00000000..0ab1e082 --- /dev/null +++ b/alliance/src/dreal/src/GTB.h @@ -0,0 +1,217 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : gtb101.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_GTB +# define DREAL_GTB + +/*------------------------------------------------------------\ +| | +| MouseCursors | +| | +\------------------------------------------------------------*/ + +# define DREAL_NORMAL_CURSOR 0 +# define DREAL_WATCH_CURSOR 1 +# define DREAL_PIRATE_CURSOR 2 +# define DREAL_CROSS_CURSOR 3 +# define DREAL_NO_CURSOR 4 + +# define DREAL_MAX_CURSOR 5 + +/*------------------------------------------------------------\ +| | +| DialogBoxType | +| | +\------------------------------------------------------------*/ + +# define DREAL_DIALOG_MESSAGE 0 +# define DREAL_DIALOG_ERROR 1 +# define DREAL_DIALOG_INFO 2 +# define DREAL_DIALOG_QUESTION 3 +# define DREAL_DIALOG_WARNING 4 +# define DREAL_DIALOG_WORKING 5 +# define DREAL_DIALOG_FILE 6 +# define DREAL_DIALOG_PROMPT 7 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealDialogBox | +| | +\------------------------------------------------------------*/ + + typedef struct DrealDialogItem + + { + char *LABEL; + char TYPE; + Widget WIDGET; + void (*CALLBACK_OK)(); + XtPointer CALLDATA_OK; + void (*CALLBACK_CANCEL)(); + XtPointer CALLDATA_CANCEL; + + } DrealDialogItem; + + +/*------------------------------------------------------------\ +| | +| DrealMenuItem | +| | +\------------------------------------------------------------*/ + + typedef struct DrealMenuItem + + { + char *LABEL; + char MNEMONIC; + char *SHORT_KEY; + char *SHORT_KEY_TEXT; + WidgetClass *CLASS; + Boolean SEPARATOR; + Boolean TITLE; + Boolean HELP; + void (*CALLBACK)(); + XtPointer CALLDATA; + Widget BUTTON; + Widget MENU; + struct DrealMenuItem *NEXT; + + } DrealMenuItem; + +/*------------------------------------------------------------\ +| | +| DrealPanelButtonItem | +| | +\------------------------------------------------------------*/ + + typedef struct DrealPanelButtonItem + + { + char *LABEL; + char *TEXT; + char *BITMAP; + int WIDTH; + int HEIGHT; + char *FOREGROUND; + char *BACKGROUND; + unsigned char X; + unsigned char Y; + unsigned char DX; + unsigned char DY; + void (*CALLBACK)(); + XtPointer CALLDATA; + Widget BUTTON; + + } DrealPanelButtonItem; + +/*------------------------------------------------------------\ +| | +| DrealPanelItem | +| | +\------------------------------------------------------------*/ + + typedef struct DrealPanelItem + + { + char *TITLE; + char COMPUTE; + char MANAGED; + int X; + int Y; + int WIDTH; + int HEIGHT; + unsigned char COLUMN; + unsigned char ROW; + Widget PANEL; + Widget PANEL_FORM; + Widget FRAME; + Widget FORM; + unsigned char LIST_NUMBER; + DrealPanelButtonItem *LIST; + + } DrealPanelItem; + + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char *DrealPanelButtonDisable; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void DrealDestroyDialogCallback(); + extern void DrealExitDialogCallback(); + + extern void DrealSetMouseCursor(); + extern Pixmap DrealCreatePixmap(); + extern void DrealSetIcon(); + extern void DrealBuildMenus(); + extern void DrealBuildPanel(); + extern void DrealEnterPanel(); + extern void DrealExitPanel(); + extern void DrealBuildDialog(); + extern void DrealEnterDialog(); + extern void DrealReEnterDialog(); + extern void DrealExitDialog(); + extern void DrealWarningMessage(); + extern void DrealErrorMessage(); + +# endif diff --git a/alliance/src/dreal/src/GTB_cursor.c b/alliance/src/dreal/src/GTB_cursor.c new file mode 100644 index 00000000..db404294 --- /dev/null +++ b/alliance/src/dreal/src/GTB_cursor.c @@ -0,0 +1,211 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : cursor.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include "rds.h" +# include "GTB.h" +# include "GTB_cursor.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static DrealMouseCursor DrealMouseCursorArray [ DREAL_MAX_CURSOR ] = + + { + { XC_left_ptr , True }, + { XC_watch , True }, + { XC_pirate , True }, + { XC_cross_reverse , True }, + { 0 , True } + + }; + + static char DrealCursorMaskOr [ 8 ] = + + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char DrealCursorMaskAnd [ 8 ] = + + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealSetMouseCursor | +| | +\------------------------------------------------------------*/ + +void DrealSetMouseCursor( MainWidget, CursorType ) + + Widget MainWidget; + char CursorType; +{ + Display *DisplayId; + XEvent MouseEvent; + Widget TopShell; + Widget ScanShell; + Window TopWindow; + Window ScanWindow; + XWindowAttributes WindowAtt; + XtAppContext Context; + XColor White; + XColor Black; + XColor ForgetIt; + Colormap ColorMap; + Pixmap MaskOr; + Pixmap MaskAnd; + Cursor NewCursor; + + rdsbegin(); + + ScanShell = MainWidget; + + while ( ! XtIsShell( ScanShell ) ) + { + ScanShell = XtParent( ScanShell ); + } + + TopShell = ScanShell; + + while ( ! XtIsTopLevelShell( TopShell ) ) + { + TopShell = XtParent( TopShell ); + } + + XFlush(XtDisplay (TopShell)); + + DisplayId = XtDisplay( ScanShell ); + + TopWindow = XtWindow( TopShell ); + ScanWindow = XtWindow( ScanShell ); + + if ( DrealMouseCursorArray[ CursorType ].MAKE == True ) + { + if ( DrealMouseCursorArray[ CursorType ].CURSOR != 0 ) + { + NewCursor = XCreateFontCursor( DisplayId, + DrealMouseCursorArray[ CursorType ].CURSOR ); + } + else + { + ColorMap = DefaultColormapOfScreen ( XtScreen( MainWidget ) ); + + XAllocNamedColor( DisplayId, ColorMap, "black", &Black, &ForgetIt ); + XAllocNamedColor( DisplayId, ColorMap, "white", &White, &ForgetIt ); + + MaskOr = + + XCreatePixmapFromBitmapData( DisplayId, + XtWindow( MainWidget ), + DrealCursorMaskOr, + 8, 8, + Black.pixel, + White.pixel, 1 ); + MaskAnd = + + XCreatePixmapFromBitmapData( DisplayId, + XtWindow( MainWidget ), + DrealCursorMaskAnd, + 8, 8, + Black.pixel, + White.pixel, 1 ); + + NewCursor = XCreatePixmapCursor( DisplayId, + MaskAnd, MaskOr, + &Black, &White, 0, 0 ); + } + + DrealMouseCursorArray[ CursorType ].CURSOR = NewCursor; + DrealMouseCursorArray[ CursorType ].MAKE = False; + } + + XDefineCursor( XtDisplay( TopShell ), + XtWindow( MainWidget ), + DrealMouseCursorArray[ CursorType ].CURSOR ); + + Context = XtWidgetToApplicationContext( TopShell ); + + if ( XtIsRealized( ScanShell ) && XtIsRealized( TopShell ) ) + { + while ( ( XGetWindowAttributes( DisplayId, ScanWindow, &WindowAtt ) ) && + ( WindowAtt.map_state != IsViewable ) ) + { + if ( ( XGetWindowAttributes( DisplayId, TopWindow, &WindowAtt ) ) && + ( WindowAtt.map_state != IsViewable ) ) + + break; + + XtAppNextEvent( Context, &MouseEvent ); + XtDispatchEvent( &MouseEvent ); + } + } + + XmUpdateDisplay( TopShell ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GTB_cursor.h b/alliance/src/dreal/src/GTB_cursor.h new file mode 100644 index 00000000..7acaaa01 --- /dev/null +++ b/alliance/src/dreal/src/GTB_cursor.h @@ -0,0 +1,73 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : cursor.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MTB_CURSOR +# define DREAL_MTB_CURSOR + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ + + typedef struct DrealMouseCursor + { + Cursor CURSOR; + Boolean MAKE; + + } DrealMouseCursor; + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GTB_dialog.c b/alliance/src/dreal/src/GTB_dialog.c new file mode 100644 index 00000000..947c709e --- /dev/null +++ b/alliance/src/dreal/src/GTB_dialog.c @@ -0,0 +1,466 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include "rds.h" +# include "GTB.h" +# include "GTB_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static DrealLockLoop = 0; + + static DrealDialogItem DrealWarningDialog = + + { + "Warning", + DREAL_DIALOG_WARNING, + (Widget)NULL, + (void *)NULL, + (XtPointer)NULL, + (void *)NULL, + (XtPointer)NULL + }; + + static DrealDialogItem DrealErrorDialog = + + { + "Error", + DREAL_DIALOG_ERROR, + (Widget)NULL, + (void *)NULL, + (XtPointer)NULL, + (void *)NULL, + (XtPointer)NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealDestroyDialogCallback | +| | +\------------------------------------------------------------*/ + +void DrealDestroyDialogCallback( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + DrealLockLoop = 0; + DrealExitErrorMessage( 1 ); +} + +/*------------------------------------------------------------\ +| | +| DrealExitDialogCallback | +| | +\------------------------------------------------------------*/ + +void DrealExitDialogCallback() + +{ + rdsbegin(); + + DrealExitDialog(); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealBuildDialog | +| | +\------------------------------------------------------------*/ + +void DrealBuildDialog( Father, Dialog ) + + Widget Father; + DrealDialogItem *Dialog; +{ + Arg Args[3]; + XmString Label; + + rdsbegin(); + + Label = XmStringCreateLtoR( Dialog->LABEL, + XmSTRING_DEFAULT_CHARSET ); + + if ( Dialog->TYPE < DREAL_DIALOG_FILE ) + { + XtSetArg( Args[0], XmNmessageString , Label); + } + else + { + XtSetArg( Args[0], XmNselectionLabelString, Label); + } + + XtSetArg( Args[1], XmNdeleteResponse, XmDO_NOTHING ); + XtSetArg( Args[2], XmNtitle, " " ); + + switch ( Dialog->TYPE ) + { + case DREAL_DIALOG_MESSAGE : + + Dialog->WIDGET = + + XmCreateMessageDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case DREAL_DIALOG_ERROR : + + Dialog->WIDGET = + + XmCreateErrorDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case DREAL_DIALOG_INFO : + + Dialog->WIDGET = + + XmCreateInformationDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case DREAL_DIALOG_QUESTION : + + Dialog->WIDGET = + + XmCreateQuestionDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case DREAL_DIALOG_WARNING : + + Dialog->WIDGET = + + XmCreateWarningDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case DREAL_DIALOG_WORKING : + + Dialog->WIDGET = + + XmCreateWorkingDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case DREAL_DIALOG_FILE : + + Dialog->WIDGET = + + XmCreateFileSelectionDialog( Father, Dialog->LABEL, Args, 3); + + XtUnmanageChild( XmFileSelectionBoxGetChild( Dialog->WIDGET, + XmDIALOG_FILTER_LABEL ) ); + + XtUnmanageChild( XmFileSelectionBoxGetChild( Dialog->WIDGET, + XmDIALOG_FILTER_TEXT ) ); + break; + + case DREAL_DIALOG_PROMPT : + + Dialog->WIDGET = + + XmCreatePromptDialog( Father, Dialog->LABEL, Args, 3); + + XtUnmanageChild( XmSelectionBoxGetChild( Dialog->WIDGET, + XmDIALOG_HELP_BUTTON ) ); + } + + XmStringFree( Label ); + + XtAddCallback (Dialog->WIDGET, XmNdestroyCallback, + DrealDestroyDialogCallback, NULL ); + + if ( Dialog->TYPE < DREAL_DIALOG_FILE ) + { + XtUnmanageChild( XmMessageBoxGetChild( Dialog->WIDGET, + XmDIALOG_HELP_BUTTON ) ); + } + + if ( ( Dialog->CALLBACK_OK == NULL ) && + ( Dialog->CALLBACK_CANCEL == NULL ) ) + { + XtAddCallback( Dialog->WIDGET, XmNokCallback, + DrealExitDialogCallback, NULL ); + } + else + { + if ( Dialog->CALLBACK_OK == NULL ) + { + XtUnmanageChild( XmMessageBoxGetChild( Dialog->WIDGET, + XmDIALOG_OK_BUTTON ) ); + } + else + { + XtAddCallback( Dialog->WIDGET, XmNokCallback, + Dialog->CALLBACK_OK, + Dialog->CALLDATA_OK ); + } + } + + if ( Dialog->CALLBACK_CANCEL == NULL ) + { + XtUnmanageChild( XmMessageBoxGetChild( Dialog->WIDGET, + XmDIALOG_CANCEL_BUTTON ) ); + } + else + { + XtAddCallback( Dialog->WIDGET, XmNcancelCallback, + Dialog->CALLBACK_CANCEL, + Dialog->CALLDATA_CANCEL ); + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealLimitedLoop | +| | +\------------------------------------------------------------*/ + +void DrealLimitedLoop( MyWidget ) + + Widget MyWidget; +{ + Widget DialogShell, WShell; + XEvent Event; + XAnyEvent *AnyEvent; + XtAppContext Context; + + rdsbegin(); + + Context = XtWidgetToApplicationContext( MyWidget ); + + DrealLockLoop = 1; + + for ( WShell = MyWidget; + ! XtIsShell( WShell ); + WShell = XtParent( WShell ) ); + + while( DrealLockLoop == 1 ) + { + XtAppNextEvent( Context, &Event ); + + AnyEvent = (XAnyEvent *)( &Event ); + + for ( DialogShell = XtWindowToWidget( AnyEvent->display, AnyEvent->window ); + ((DialogShell != NULL ) && (!XtIsShell( DialogShell ))); + DialogShell = XtParent(DialogShell)); + + switch ( AnyEvent->type ) + { + case ButtonPress : + case ButtonRelease : + + if (WShell == DialogShell) + { + XtDispatchEvent( &Event ); + } + break; + + case KeyPress : + case KeyRelease : + + if ( WShell != DialogShell ) + { + AnyEvent->window = XtWindow( WShell ); + } + + default : + + XtDispatchEvent( &Event ); + } + } + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEnterDialog | +| | +\------------------------------------------------------------*/ + +void DrealEnterDialog( Dialog ) + + DrealDialogItem *Dialog; +{ + rdsbegin(); + + XtManageChild ( Dialog->WIDGET ); + + DrealLimitedLoop( Dialog->WIDGET ); + + XtUnmanageChild( Dialog->WIDGET ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealReEnterDialog | +| | +\------------------------------------------------------------*/ + +void DrealReEnterDialog() +{ + rdsbegin(); + + DrealLockLoop = 1; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealExitDialog | +| | +\------------------------------------------------------------*/ + +void DrealExitDialog() + +{ + rdsbegin(); + + DrealLockLoop = 0; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealWarningMessage | +| | +\------------------------------------------------------------*/ + + void DrealWarningMessage( Father, Subject ) + + Widget Father; + char *Subject; +{ + XmString Label; + + rdsbegin(); + + if ( DrealWarningDialog.WIDGET == (Widget)NULL ) + { + DrealBuildDialog( Father, &DrealWarningDialog ); + } + + Label = XmStringCreateLtoR( Subject, + XmSTRING_DEFAULT_CHARSET ); + + XtVaSetValues( DrealWarningDialog.WIDGET, + XmNmessageString, + Label, NULL ); + + XmStringFree( Label ); + + DrealEnterDialog( &DrealWarningDialog ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealErrorMessage | +| | +\------------------------------------------------------------*/ + +void DrealErrorMessage( Father, Subject ) + + Widget Father; + char *Subject; +{ + XmString Label; + + rdsbegin(); + + if ( DrealErrorDialog.WIDGET == (Widget)NULL ) + { + DrealBuildDialog( Father, &DrealErrorDialog ); + } + + Label = XmStringCreateLtoR( Subject, + XmSTRING_DEFAULT_CHARSET ); + + XtVaSetValues( DrealErrorDialog.WIDGET, + XmNmessageString, + Label, NULL ); + + XmStringFree( Label ); + + DrealEnterDialog( &DrealErrorDialog ); + + rdsend(); +} diff --git a/alliance/src/dreal/src/GTB_dialog.h b/alliance/src/dreal/src/GTB_dialog.h new file mode 100644 index 00000000..a29d94da --- /dev/null +++ b/alliance/src/dreal/src/GTB_dialog.h @@ -0,0 +1,70 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MTB_DIALOG +# define DREAL_MTB_DIALOG + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GTB_icon.c b/alliance/src/dreal/src/GTB_icon.c new file mode 100644 index 00000000..44d1c84b --- /dev/null +++ b/alliance/src/dreal/src/GTB_icon.c @@ -0,0 +1,102 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : icon.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include "rds.h" +# include "GTB.h" +# include "GTB_icon.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealSetIcon | +| | +\------------------------------------------------------------*/ + +void DrealSetIcon( ShellWidget, IconBits, IconWidth, IconHeight ) + + Widget ShellWidget; + char *IconBits; + int IconWidth; + int IconHeight; +{ + Pixmap IconPixmap; + + rdsbegin(); + + IconPixmap = XCreatePixmapFromBitmapData( XtDisplay( ShellWidget ), + RootWindowOfScreen( XtScreen( ShellWidget ) ), + IconBits, IconWidth, IconHeight, + WhitePixelOfScreen( XtScreen( ShellWidget ) ), + BlackPixelOfScreen( XtScreen( ShellWidget ) ), + DefaultDepthOfScreen( XtScreen( ShellWidget ) ) ); + XtVaSetValues( ShellWidget, + XmNiconPixmap, IconPixmap, + XmNiconic, False, + NULL ); + + rdsend(); +} + diff --git a/alliance/src/dreal/src/GTB_icon.h b/alliance/src/dreal/src/GTB_icon.h new file mode 100644 index 00000000..9ed97273 --- /dev/null +++ b/alliance/src/dreal/src/GTB_icon.h @@ -0,0 +1,65 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : icon.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MTB_ICON +# define DREAL_MTB_ICON + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GTB_menu.c b/alliance/src/dreal/src/GTB_menu.c new file mode 100644 index 00000000..d8f4206c --- /dev/null +++ b/alliance/src/dreal/src/GTB_menu.c @@ -0,0 +1,193 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "rds.h" +# include "GTB.h" +# include "GTB_menu.h" + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static char MenuBuffer [ MENU_BUFFER_SIZE ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealBuildMenus | +| | +\------------------------------------------------------------*/ + +void DrealBuildMenus( Father, Menu ) + + Widget Father; + DrealMenuItem *Menu; +{ + + Widget Button; + Widget SubMenu; + XmString Text; + Arg Args[ 2 ]; + int Counter; + + rdsbegin(); + + for ( Counter = 0; + Menu[ Counter ].LABEL != NULL; + Counter++ ) + { + if ( Menu[ Counter ].SEPARATOR == True ) + { + XtCreateManagedWidget( "Separator", + xmSeparatorWidgetClass, Father, + NULL , + 0 ); + } + + Button = XtVaCreateManagedWidget( Menu[ Counter ].LABEL, + *Menu[ Counter ].CLASS, Father, + XmNmnemonic, + Menu[ Counter ].MNEMONIC, + NULL ); + Menu[ Counter ].BUTTON = Button; + + if ( Menu[ Counter ].SHORT_KEY != NULL ) + { + XtVaSetValues( Button, + XmNaccelerator, + Menu[ Counter ].SHORT_KEY, + NULL ); + } + + if ( Menu[ Counter ].SHORT_KEY != NULL ) + { + Text = XmStringCreateSimple( Menu[ Counter ].SHORT_KEY_TEXT ); + + XtVaSetValues( Button, + XmNacceleratorText, + Text, + NULL ); + + XmStringFree( Text ); + } + + if ( Menu[ Counter ].CALLBACK != NULL ) + { + XtAddCallback( Button, + XmNactivateCallback, + Menu[ Counter ].CALLBACK, + Menu[ Counter ].CALLDATA ); + } + + if ( Menu[ Counter ].HELP == True ) + { + XtSetArg( Args[ 0 ], XmNmenuHelpWidget, Button ); + + XtSetValues( Father, Args, 1 ); + } + + if ( Menu[ Counter ].NEXT != NULL) + { + strcpy( MenuBuffer, Menu[ Counter ].LABEL ); + strcat( MenuBuffer, " Menu" ); + + SubMenu = XmCreatePulldownMenu( Father, + MenuBuffer, + Args, 0 ); + + Menu[ Counter ].MENU = SubMenu; + + if ( Menu[ Counter ].TITLE == True ) + { + Text = XmStringCreateLtoR( MenuBuffer, XmSTRING_DEFAULT_CHARSET ); + + XtVaCreateManagedWidget( "MenuTitle", + xmLabelWidgetClass, + SubMenu, + XmNlabelString, Text, + NULL ); + + XmStringFree( Text ); + + XtCreateManagedWidget( "Separator", + xmSeparatorWidgetClass, + SubMenu, + NULL, + 0 ); + } + + XtSetArg( Args[ 0 ], XmNsubMenuId, SubMenu ); + XtSetValues( Button, Args, 1 ); + + DrealBuildMenus( SubMenu, Menu[ Counter ].NEXT ); + } + else Menu[ Counter ].MENU = (Widget)NULL; + } + + rdsend(); +} + diff --git a/alliance/src/dreal/src/GTB_menu.h b/alliance/src/dreal/src/GTB_menu.h new file mode 100644 index 00000000..64473b49 --- /dev/null +++ b/alliance/src/dreal/src/GTB_menu.h @@ -0,0 +1,67 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MTB_MENU +# define DREAL_MTB_MENU + +# define MENU_BUFFER_SIZE 80 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GTB_panel.c b/alliance/src/dreal/src/GTB_panel.c new file mode 100644 index 00000000..0d3270e5 --- /dev/null +++ b/alliance/src/dreal/src/GTB_panel.c @@ -0,0 +1,357 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include "rds.h" +# include "GTB.h" + +# include "GTB_panel.h" +# include "GTB_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealBuildPanel | +| | +\------------------------------------------------------------*/ + +void DrealBuildPanel( Father, Panel ) + + Widget Father; + DrealPanelItem *Panel; +{ + Arg Args[13]; + DrealPanelButtonItem *Button; + char *Label; + int Counter; + int Fraction; + int X1; + int Y1; + int X2; + int Y2; + Pixmap ButtonPixmap; + + rdsbegin(); + + Fraction = Panel->ROW * Panel->COLUMN; + + XtSetArg( Args[0], XmNshadowType, XmSHADOW_ETCHED_IN ); + XtSetArg( Args[1], XmNdeleteResponse, XmDO_NOTHING ); + XtSetArg( Args[2], XmNtitle , Panel->TITLE ); + + Panel->PANEL = XmCreateFormDialog( Father, Panel->TITLE, Args, 3); + + XtAddCallback( Panel->PANEL, XmNdestroyCallback, + DrealDestroyDialogCallback, NULL ); + + Panel->PANEL_FORM = XtVaCreateManagedWidget( "", + xmFormWidgetClass, + Panel->PANEL, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNfractionBase , 100, + NULL + ); + + Panel->FRAME = XtVaCreateManagedWidget( "", + xmFrameWidgetClass, + Panel->PANEL_FORM, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + NULL + ); + + Panel->FORM = XtVaCreateManagedWidget( "", + xmFormWidgetClass, + Panel->FRAME, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNfractionBase , Fraction, + NULL + ); + Button = Panel->LIST; + + for ( Counter = 0; Counter < Panel->LIST_NUMBER; Counter++ ) + { + if ( Button[ Counter ].LABEL == (char *)NULL ) continue; + + X1 = Button[ Counter ].X * Panel->ROW; + Y1 = Button[ Counter ].Y * Panel->COLUMN; + X2 = X1 + Button[ Counter ].DX * Panel->ROW; + Y2 = Y1 + Button[ Counter ].DY * Panel->COLUMN; + + Label = Button[ Counter ].LABEL; + + if ( ( Button[ Counter ].TEXT != (char *)NULL ) && + ( Button[ Counter ].BITMAP != (char *)NULL ) ) + { + XtSetArg( Args[0] , XmNtopAttachment , XmATTACH_POSITION ); + XtSetArg( Args[1] , XmNtopPosition , Y1 ); + XtSetArg( Args[2] , XmNbottomAttachment , XmATTACH_POSITION ); + XtSetArg( Args[3] , XmNbottomPosition , Y2 ); + XtSetArg( Args[4] , XmNrightAttachment , XmATTACH_POSITION ); + XtSetArg( Args[5] , XmNrightPosition , X2 ); + XtSetArg( Args[6] , XmNleftAttachment , XmATTACH_POSITION ); + XtSetArg( Args[7] , XmNleftPosition , X1 ); + XtSetArg( Args[8] , XmNscrollBarDisplayPolicy, XmSTATIC ); + XtSetArg( Args[9] , XmNscrollHorizontal , True ); + XtSetArg( Args[10] , XmNscrollVertical , True ); + XtSetArg( Args[11] , XmNlistSizePolicy , XmCONSTANT ); + XtSetArg( Args[12] , XmNselectionPolicy , XmMULTIPLE_SELECT ); + + Button[ Counter ].BUTTON = + + XmCreateScrolledList( Panel->FORM, Button[ Counter ].TEXT, Args, 13 ); + + XtManageChild ( Button[ Counter ].BUTTON ); + } + else + if ( Button[ Counter ].TEXT != (char *)NULL ) + { + XtSetArg( Args[0] , XmNrows , 10 ); + XtSetArg( Args[1] , XmNeditable , False ); + XtSetArg( Args[2] , XmNeditMode , XmMULTI_LINE_EDIT ); + XtSetArg( Args[3] , XmNcursorPositionVisible, False ); + XtSetArg( Args[4] , XmNtopAttachment , XmATTACH_POSITION ); + XtSetArg( Args[5] , XmNtopPosition , Y1 ); + XtSetArg( Args[6] , XmNleftAttachment , XmATTACH_POSITION ); + XtSetArg( Args[7] , XmNleftPosition , X1 ); + XtSetArg( Args[8] , XmNbottomAttachment , XmATTACH_POSITION ); + XtSetArg( Args[9] , XmNbottomPosition , Y2 ); + XtSetArg( Args[10], XmNrightAttachment , XmATTACH_POSITION ); + XtSetArg( Args[11], XmNrightPosition , X2 ); + + Button[ Counter ].BUTTON = + + XmCreateScrolledText( Panel->FORM, Button[ Counter ].TEXT, Args, 12); + + XtManageChild ( Button[ Counter ].BUTTON ); + } + else + if ( Button[ Counter ].BITMAP != (char *)NULL ) + { + ButtonPixmap = DrealCreatePixmap( Father, + Button[ Counter ].BITMAP, + Button[ Counter ].WIDTH, + Button[ Counter ].HEIGHT ); + Button[ Counter ].BUTTON = + + XtVaCreateManagedWidget( Label, + xmPushButtonWidgetClass, + Panel->FORM, + XmNlabelType , XmPIXMAP, + XmNlabelPixmap , ButtonPixmap, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , X1, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , X2, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , Y1, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , Y2, + NULL + ); + } + else + { + Button[ Counter ].BUTTON = + + XtVaCreateManagedWidget( Label, + xmPushButtonWidgetClass, + Panel->FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , X1, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , X2, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , Y1, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , Y2, + NULL + ); + } + + if ( Button[ Counter ].FOREGROUND != NULL ) + { + XtVaSetValues ( Button[ Counter ].BUTTON , + XtVaTypedArg , XmNforeground, + XmRString , + Button[ Counter ].FOREGROUND , + strlen ( Button[ Counter ].FOREGROUND ) + 1, + NULL + ); + } + + if ( Button[ Counter ].BACKGROUND != NULL ) + { + XtVaSetValues ( Button[ Counter ].BUTTON , + XtVaTypedArg , XmNbackground, + XmRString , + Button[ Counter ].BACKGROUND , + strlen ( Button[ Counter ].BACKGROUND ) + 1, + NULL + ); + } + + if ( Button[ Counter ].CALLBACK != NULL ) + { + if ( ( Button[ Counter ].TEXT != (char *)NULL ) && + ( Button[ Counter ].BITMAP != (char *)NULL ) ) + { + XtAddCallback( Button[ Counter ].BUTTON, + XmNdefaultActionCallback, + Button[ Counter ].CALLBACK, + (XtPointer)NULL ); + + XtAddCallback( Button[ Counter ].BUTTON, + XmNmultipleSelectionCallback, + Button[ Counter ].CALLBACK, + Button[ Counter ].CALLDATA ); + } + else + { + XtAddCallback( Button[ Counter ].BUTTON, + XmNactivateCallback, + Button[ Counter ].CALLBACK, + Button[ Counter ].CALLDATA ); + } + } + } + + XtVaSetValues( Panel->PANEL , + XmNresizable , False, + XmNx , Panel->X, + XmNy , Panel->Y, + XmNheight , Panel->HEIGHT, + XmNwidth , Panel->WIDTH, + NULL ); + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealEnterPanel | +| | +\------------------------------------------------------------*/ + +void DrealEnterPanel( Panel ) + + DrealPanelItem *Panel; +{ + rdsbegin(); + + XtManageChild( Panel->PANEL ); + + if ( Panel->COMPUTE == 1 ) + { + XtVaSetValues( Panel->PANEL , + XmNresizable , False, + XmNx , Panel->X, + XmNy , Panel->Y, + XmNheight , Panel->HEIGHT, + XmNwidth , Panel->WIDTH, + NULL ); + + Panel->COMPUTE = 0; + } + + Panel->MANAGED = 1; + + rdsend(); +} + +/*------------------------------------------------------------\ +| | +| DrealExitPanel | +| | +\------------------------------------------------------------*/ + +void DrealExitPanel( Panel ) + + DrealPanelItem *Panel; +{ + rdsbegin(); + + XtUnmanageChild( Panel->PANEL ); + + Panel->MANAGED = 0; + + rdsend(); +} + diff --git a/alliance/src/dreal/src/GTB_panel.h b/alliance/src/dreal/src/GTB_panel.h new file mode 100644 index 00000000..b3b42533 --- /dev/null +++ b/alliance/src/dreal/src/GTB_panel.h @@ -0,0 +1,65 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MTB_PANEL +# define DREAL_MTB_PANEL + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/GTB_pixmap.c b/alliance/src/dreal/src/GTB_pixmap.c new file mode 100644 index 00000000..20437513 --- /dev/null +++ b/alliance/src/dreal/src/GTB_pixmap.c @@ -0,0 +1,104 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : Pixmap.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +# include +# include +# include "rds.h" +# include "GTB.h" + +# include "GTB_pixmap.h" + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealCreatePixmap | +| | +\------------------------------------------------------------*/ + +Pixmap DrealCreatePixmap( MainWidget, IconBits, IconWidth, IconHeight ) + + Widget MainWidget; + char *IconBits; + int IconWidth; + int IconHeight; +{ + Pixel Foreground; + Pixel Background; + Pixmap IconPixmap; + + rdsbegin(); + + XtVaGetValues( MainWidget, XmNforeground, &Foreground, + XmNbackground, &Background, NULL ); + + IconPixmap = XCreatePixmapFromBitmapData( XtDisplay( MainWidget ), + RootWindowOfScreen( XtScreen( MainWidget ) ), + IconBits, IconWidth, IconHeight, + Foreground, Background, + DefaultDepthOfScreen( XtScreen( MainWidget ) ) ); + + + rdsend(); + return( IconPixmap ); +} + diff --git a/alliance/src/dreal/src/GTB_pixmap.h b/alliance/src/dreal/src/GTB_pixmap.h new file mode 100644 index 00000000..2f32678c --- /dev/null +++ b/alliance/src/dreal/src/GTB_pixmap.h @@ -0,0 +1,65 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : pixmap.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_MTB_PIXMAP +# define DREAL_MTB_PIXMAP + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/dreal/src/LIP6bw.h b/alliance/src/dreal/src/LIP6bw.h new file mode 100644 index 00000000..cfecd995 --- /dev/null +++ b/alliance/src/dreal/src/LIP6bw.h @@ -0,0 +1,293 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +#define LIP6bw_width 164 +#define LIP6bw_height 150 +static char LIP6bw_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x70, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x70, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0x0f, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x01, + 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x7f, 0x00, 0xc0, 0xff, 0x7f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0x3f, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xe0, + 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xe0, 0x01, 0xff, 0xff, + 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xf0, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0x1f, 0xf0, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xf0, + 0x01, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xf0, 0x01, 0xff, 0xff, + 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xf0, 0x01, 0xff, 0xff, 0x03, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0x1f, 0xf0, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xf0, + 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xf0, 0xf9, 0xff, 0xff, + 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0x1f, 0x20, 0xc0, 0xff, 0xff, 0x07, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0x1f, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0x00, + 0x00, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, + 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0x1f, 0xe0, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xe0, + 0x01, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xf0, 0x01, 0xff, 0xff, + 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xf0, 0x01, 0xff, 0xff, 0x03, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0x1f, 0xf0, 0x01, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xf0, + 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xf0, 0x01, 0xff, 0xff, + 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0x1f, 0xf0, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0x1f, 0xe0, 0x01, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x3f, 0xc0, + 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0x3f, 0x00, 0x80, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0x7f, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x03, + 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x1f, 0xff, 0xff, 0x1f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0xc0, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, + 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; diff --git a/alliance/src/dreal/src/Makefile b/alliance/src/dreal/src/Makefile new file mode 100644 index 00000000..671f4619 --- /dev/null +++ b/alliance/src/dreal/src/Makefile @@ -0,0 +1,496 @@ +# /*------------------------------------------------------------\ +# | | +# | This file is part of the Alliance CAD System Copyright | +# | (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +# | | +# | Home page : http://www-asim.lip6.fr/alliance/ | +# | E-mail support : mailto:alliance-support@asim.lip6.fr | +# | | +# | This progam is free software; you can redistribute it | +# | and/or modify it under the terms of the GNU General Public | +# | License as published by the Free Software Foundation; | +# | either version 2 of the License, or (at your option) any | +# | later version. | +# | | +# | Alliance VLSI CAD System is distributed in the hope that | +# | it will be useful, but WITHOUT ANY WARRANTY; | +# | without even the implied warranty of MERCHANTABILITY or | +# | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +# | Public License for more details. | +# | | +# | You should have received a copy of the GNU General Public | +# | License along with the GNU C Library; see the file COPYING. | +# | If not, write to the Free Software Foundation, Inc., | +# | 675 Mass Ave, Cambridge, MA 02139, USA. | +# | | +# \------------------------------------------------------------*/ + +# /*------------------------------------------------------------\ +# | | +# | Tool : DREAL | +# | | +# | File : Makefile | +# | | +# | Author : Jacomme Ludovic | +# | | +# | Date : 20.02.96 | +# | | +# \------------------------------------------------------------*/ + +include $(ALLIANCE_TOP)/etc/$(ALLIANCE_OS).mk +include $(ALLIANCE_TOP)/etc/libraries.mk +include local.mk + +# /*------------------------------------------------------------\ +# | | +# | Variables | +# | | +# \------------------------------------------------------------*/ + +LOCAL_CFLAGS = $(CFLAGS) -D$(ALLIANCE_OS) + +# /*------------------------------------------------------------\ +# | | +# | Binary | +# | | +# \------------------------------------------------------------*/ + +LOCAL_DREAL_BIN = dreal + +# /*------------------------------------------------------------\ +# | | +# | Include | +# | | +# \------------------------------------------------------------*/ + +LOCAL_INCLUDE = $(MOTIF_INCLUDE) $(XPM_INCLUDE) -I$(X11_INCLUDE) \ + -I$(ALLIANCE_INCLUDE) + +# /*------------------------------------------------------------\ +# | | +# | Library | +# | | +# \------------------------------------------------------------*/ + +LOCAL_MOTIF_LIB = -L$(MOTIF_LIB) -lXm + +LOCAL_X11_LIB = -L$(X11_LIB) -lXt -lX11 $(XPM_LIB) + +LOCAL_MBK_LIB = -L$(ALLIANCE_LIB) \ + $(MPU_L) \ + $(MAP_L) \ + $(MMG_L) \ + $(MCP_L) \ + $(MPH_L) \ + $(MUT_L) + +LOCAL_RDS_LIB = $(RDS_LIBRARY) \ + -L$(ALLIANCE_LIB) \ + $(RTL_L) \ + $(RGS_L) \ + $(RCF_L) \ + $(RUT_L) \ + $(RFM_L) \ + $(RPR_L) \ + $(RDS_L) + +LOCAL_LIB = $(LOCAL_MOTIF_LIB) $(LOCAL_X11_LIB) $(LOCAL_RDS_LIB) \ + $(LOCAL_MBK_LIB) + +# /*------------------------------------------------------------\ +# | | +# | Define | +# | | +# \------------------------------------------------------------*/ + +LOCAL_X11_DEFINE = -D_NO_PROTO + +LOCAL_MBK_DEFINE = -DMUT_H='"$(MUT_H)"' \ + -DMPH_H='"$(MPH_H)"' + +LOCAL_RDS_DEFINE = $(RDS_INCLUDE) \ + -DRDS_H='"$(RDS_H)"' \ + -DRPR_H='"$(RPR_H)"' \ + -DRFM_H='"$(RFM_H)"' \ + -DRWI_H='"$(RWI_H)"' \ + -DRUT_H='"$(RUT_H)"' \ + -DRTL_H='"$(RTL_H)"' + +LOCAL_DREAL_DEFINE = -DGTB_H='"GTB.h"' -DGSB_H='"GSB.h"' \ + -DGMF_H='"GMF.h"' -DGMV_H='"GMV.h"' -DGMC_H='"GMC.h"' \ + -DGMT_H='"GMT.h"' -DGMS_H='"GMS.h"' -DGMH_H='"GMH.h"' \ + -DGMX_H='"GMX.h"' -DGRD_H='"GRD.h"' -DGME_H='"GME.h"' \ + -DALLIANCE_TOP='"$(ALLIANCE_TOP)"' \ + -DDREAL_DEFAULT_TECHNO_NAME='"etc/cmos_7.$(LOCAL_DREAL_BIN)"' \ + -DGMS_FILE_NAME='".$(LOCAL_DREAL_BIN).cfg"' \ + -DDREAL_WINDOW_DX='"DREAL_WINDOW_DX"' \ + -DDREAL_WINDOW_DY='"DREAL_WINDOW_DY"' \ + -DDREAL_WINDOW_XMIN='"DREAL_WINDOW_XMIN"' \ + -DDREAL_WINDOW_YMIN='"DREAL_WINDOW_YMIN"' \ + -DDREAL_WINDOW_SIDE='"DREAL_WINDOW_SIDE"' \ + -DALLIANCE_VERSION=$(ALLIANCE_VERSION) \ + -DDREAL_TOOL_NAME='"$(LOCAL_DREAL_BIN)"' \ + -DDREAL_VERSION='"1.14"' + +LOCAL_DEFINE = $(LOCAL_X11_DEFINE) $(LOCAL_RDS_DEFINE) \ + $(LOCAL_MBK_DEFINE) $(LOCAL_DREAL_DEFINE) + +LOCAL_HEADER = $(LOCAL_INCLUDE) $(LOCAL_DEFINE) + +# /*------------------------------------------------------------\ +# | | +# | Object | +# | | +# \------------------------------------------------------------*/ + +LOCAL_DREAL_OBJ = dreal.o +LOCAL_GSB_OBJ = GSB_share.o GSB_parse.o GSB_error.o +LOCAL_GRD_OBJ = GRD_rds.o GRD_window.o GRD_error.o GRD_undo.o GRD_select.o \ + GRD_search.o +LOCAL_GTB_OBJ = GTB_icon.o GTB_panel.o GTB_menu.o GTB_pixmap.o \ + GTB_cursor.o GTB_dialog.o +LOCAL_GMX_OBJ = GMX_motif.o GMX_color.o GMX_graphic.o GMX_panel.o \ + GMX_menu.o GMX_message.o GMX_grid.o GMX_event.o \ + GMX_cursor.o GMX_dialog.o GMX_view.o \ + GMX_icon.o +LOCAL_GMF_OBJ = GMF_menu.o GMF_panel.o GMF_dialog.o GMF_file.o +LOCAL_GME_OBJ = GME_edit.o GME_panel.o GME_dialog.o GME_menu.o \ + GME_message.o GME_modify.o GME_search.o GME_select.o +LOCAL_GMC_OBJ = GMC_create.o GMC_menu.o GMC_panel.o GMC_dialog.o \ + GMC_message.o +LOCAL_GMV_OBJ = GMV_view.o GMV_panel.o GMV_menu.o GMV_dialog.o \ + GMV_message.o GMV_map.o +LOCAL_GMT_OBJ = GMT_tools.o GMT_menu.o GMT_panel.o GMT_dialog.o \ + GMT_message.o +LOCAL_GMS_OBJ = GMS_setup.o GMS_menu.o GMS_dialog.o GMS_panel.o +LOCAL_GMH_OBJ = GMH_help.o GMH_menu.o GMH_panel.o + +LOCAL_OBJ = $(LOCAL_GSB_OBJ) $(LOCAL_GRD_OBJ) $(LOCAL_GTB_OBJ) $(LOCAL_GMX_OBJ) \ + $(LOCAL_GMF_OBJ) $(LOCAL_GMV_OBJ) $(LOCAL_GMT_OBJ) $(LOCAL_GMS_OBJ) \ + $(LOCAL_GMC_OBJ) $(LOCAL_GME_OBJ) $(LOCAL_GMH_OBJ) $(LOCAL_DREAL_OBJ) + +# /*------------------------------------------------------------\ +# | | +# | Dreal | +# | | +# \------------------------------------------------------------*/ + +distrib : $(LOCAL_TARGET_BIN)/$(LOCAL_DREAL_BIN) + +$(LOCAL_TARGET_BIN)/$(LOCAL_DREAL_BIN) : $(LOCAL_OBJ) + $(CC) $(LOCAL_CFLAGS) -o $(LOCAL_TARGET_BIN)/$(LOCAL_DREAL_BIN) \ + $(LOCAL_OBJ) $(LOCAL_LIB) -lm + $(STRIP) $(LOCAL_TARGET_BIN)/$(LOCAL_DREAL_BIN) + + +dreal.o : dreal.c dreal.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c dreal.c + +# /*------------------------------------------------------------\ +# | | +# | Dreal Share Box | +# | | +# \------------------------------------------------------------*/ + +GSB_parse.o : GSB.h GSB_parse.c GSB_parse.h GSB_error.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GSB_parse.c + +GSB_error.o : GSB.h GSB_error.c GSB_error.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GSB_error.c + +GSB_share.o : GSB.h GSB_share.c GSB_share.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GSB_share.c + +# /*------------------------------------------------------------\ +# | | +# | Dreal Rds | +# | | +# \------------------------------------------------------------*/ + +GRD_rds.o : GSB.h GRD.h GRD_rds.c GRD_rds.h GRD_window.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GRD_rds.c + +GRD_undo.o : GSB.h GRD.h GRD_undo.c GRD_undo.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GRD_undo.c + +GRD_search.o : GSB.h GRD.h GRD_search.c GRD_search.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GRD_search.c + +GRD_select.o : GSB.h GRD.h GRD_select.c GRD_select.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GRD_select.c + +GRD_window.o : GSB.h GRD.h GRD_window.c GRD_window.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GRD_window.c + +GRD_error.o : GSB.h GRD.h GRD_error.c GRD_error.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GRD_error.c + + +# /*------------------------------------------------------------\ +# | | +# | Dreal Tools Box | +# | | +# \------------------------------------------------------------*/ + +GTB_cursor.o : GTB.h GTB_cursor.c GTB_cursor.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GTB_cursor.c + +GTB_dialog.o : GTB.h GTB_dialog.c GTB_dialog.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GTB_dialog.c + +GTB_icon.o : GTB.h GTB_icon.c GTB_icon.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GTB_icon.c + +GTB_menu.o : GTB.h GTB_menu.c GTB_menu.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GTB_menu.c + +GTB_panel.o : GTB.h GTB_panel.c GTB_panel.h GTB_dialog.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GTB_panel.c + +GTB_pixmap.o : GTB.h GTB_pixmap.c GTB_pixmap.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GTB_pixmap.c + +# /*------------------------------------------------------------\ +# | | +# | Dreal Motif X11 | +# | | +# \------------------------------------------------------------*/ + +GMX_icon.o : GSB.h GMX.h GMX_icon.c GMX_icon.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_icon.c + +GMX_color.o : GSB.h GMX.h GMX_color.c GMX_color.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_color.c + +GMX_cursor.o : GSB.h GMX.h GMX_cursor.c GMX_cursor.h GMX_view.h GMX_grid.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_cursor.c + +GMX_dialog.o : GSB.h GMX.h GMX_dialog.c GMX.h GMX_dialog.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_dialog.c + +GMX_graphic.o : GSB.h GMX.h GMX_graphic.c GMX_graphic.h GMX_view.h GMX_grid.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_graphic.c + +GMX_grid.o : GSB.h GMX.h GMX_grid.c GMX_grid.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_grid.c + +GMX_menu.o : GSB.h GTB.h GMX.h GMF.h GMV.h GMS.h GMT.h GMH.h \ + GMX_menu.c GMX_menu.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_menu.c + +GMX_message.o : GSB.h GTB.h GMX.h GMX_message.c GMX_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_message.c + +GMX_motif.o : GSB.h GTB.h GMX.h GMX_motif.c GMX_motif.h GMX_graphic.h \ + GMX_event.h GMX_message.h GMX_menu.h GMX_color.h \ + GMX_panel.h GMX_dialog.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_motif.c + +GMX_event.o : GSB.h GTB.h GRD.h GMX.h GMV.h GMX_event.c GMX_grid.h \ + GMX_event.h GMX_cursor.h GMX_event.h \ + GMX_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_event.c + +GMX_panel.o : GSB.h GTB.h GMF.h GMV.h GMT.h GMS.h GMH.h GMX.h \ + GMX_panel.c GMX_panel.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_panel.c + +GMX_view.o : GSB.h GRD.h GMX_view.c GMX_view.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMX_view.c + +# /*------------------------------------------------------------\ +# | | +# | Dreal Menu File | +# | | +# \------------------------------------------------------------*/ + +GMF_panel.o : GSB.h GRD.h GTB.h GMX.h GMF.h GMF_panel.c GMF_panel.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMF_panel.c + +GMF_menu.o : GSB.h GRD.h GTB.h GMX.h GMF.h GMF_menu.c GMF_menu.h \ + GMF_dialog.h GMF_file.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMF_menu.c + +GMF_dialog.o : GSB.h GRD.h GTB.h GMX.h GMF.h GMF_dialog.c GMF_dialog.h \ + GMF_file.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMF_dialog.c + +GMF_file.o : GSB.h GRD.h GTB.h GMX.h GMF.h GMF_file.c GMF_file.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMF_file.c + +# /*------------------------------------------------------------\ +# | | +# | Dreal Menu Edit | +# | | +# \------------------------------------------------------------*/ + +GME_search.o : GSB.h GRD.h GMX.h GTB.h GME.h GME_search.c GME_search.h \ + GME_panel.h GME_edit.h GME_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GME_search.c + +GME_modify.o : GSB.h GRD.h GMX.h GTB.h GME.h GME_modify.c GME_modify.h \ + GME_panel.h GME_edit.h GME_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GME_modify.c + +GME_edit.o : GSB.h GRD.h GMX.h GTB.h GME.h GME_edit.c GME_edit.h \ + GME_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GME_edit.c + +GME_select.o : GSB.h GRD.h GMX.h GTB.h GME.h GME_select.c GME_select.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GME_select.c + +GME_panel.o : GSB.h GRD.h GMX.h GTB.h GME.h GME_panel.c GME_panel.h \ + GME_message.h GME_dialog.h GME_modify.h GME_search.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GME_panel.c + +GME_menu.o : GSB.h GRD.h GMX.h GTB.h GME.h GME_menu.c GME_menu.h \ + GME_edit.h GME_modify.h GME_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GME_menu.c + +GME_dialog.o : GSB.h GRD.h GMX.h GTB.h GME.h GME_dialog.c GME_dialog.h \ + GME_modify.h GME_search.h GME_edit.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GME_dialog.c + +GME_message.o : GSB.h GRD.h GMX.h GTB.h GME.h GME_message.c GME_message.h \ + GME_modify.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GME_message.c + +# /*------------------------------------------------------------\ +# | | +# | Dreal Menu Create | +# | | +# \------------------------------------------------------------*/ + +GMC_menu.o : GSB.h GRD.h GTB.h GMX.h GMC.h GMC_menu.c GMC_menu.h \ + GMC_create.h GMC_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMC_menu.c + +GMC_panel.o : GSB.h GRD.h GTB.h GMX.h GMC.h GMC_panel.c GMC_panel.h \ + GMC_dialog.h GMC_create.h GMC_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMC_panel.c + +GMC_dialog.o : GSB.h GRD.h GTB.h GMX.h GMC.h GMC_dialog.c GMC_dialog.h \ + GMC_create.h GMC_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMC_dialog.c + +GMC_create.o : GSB.h GRD.h GTB.h GMX.h GMC.h GMC_create.c GMC_create.h \ + GMC_dialog.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMC_create.c + +GMC_message.o : GSB.h GRD.h GTB.h GMX.h GMC.h GMC_message.c GMC_message.h \ + GMC_create.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMC_message.c + +# /*------------------------------------------------------------\ +# | | +# | Dreal Menu View | +# | | +# \------------------------------------------------------------*/ + +GMV_panel.o : GSB.h GTB.h GMX.h GMV.h GMV_panel.c GMV_panel.h \ + GMV_dialog.h GMV_view.h GMV_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMV_panel.c + +GMV_menu.o : GSB.h GTB.h GMX.h GMV.h GMV_menu.c GMV_menu.h\ + GMV_dialog.h GMV_view.h GMV_map.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMV_menu.c + +GMV_dialog.o : GSB.h GTB.h GMX.h GMV.h GMV_dialog.c GMV_dialog.h \ + GMV_view.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMV_dialog.c + +GMV_map.o : GSB.h GTB.h GMX.h GMV.h GMV_map.c GMV_map.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMV_map.c + +GMV_message.o : GSB.h GTB.h GMX.h GMV.h GMV_message.c GMV_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMV_message.c + +GMV_view.o : GSB.h GTB.h GMX.h GMV.h GMV_view.c GMV_view.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMV_view.c + +# /*------------------------------------------------------------\ +# | | +# | Dreal Menu Tools | +# | | +# \------------------------------------------------------------*/ + +GMT_tools.o : GTB.h GSB.h GMX.h GRD.h GMT.h GMT_tools.c GMT_tools.h \ + GMT_message.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMT_tools.c + +GMT_menu.o : GTB.h GSB.h GMX.h GRD.h GMT.h GMT_menu.c GMT_menu.h \ + GMT_message.h GMT_tools.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMT_menu.c + +GMT_panel.o : GTB.h GSB.h GMX.h GRD.h GMT.h GMT_panel.c GMT_panel.h \ + GMT_message.h GMT_tools.h GMT_dialog.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMT_panel.c + +GMT_dialog.o : GTB.h GSB.h GMX.h GRD.h GMT.h GMT_dialog.c GMT_dialog.h \ + GMT_tools.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMT_dialog.c + +GMT_message.o : GTB.h GSB.h GMX.h GRD.h GMT.h GMT_message.c GMT_message.h \ + GMT_tools.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMT_message.c + +# /*------------------------------------------------------------\ +# | | +# | Dreal Menu Setup | +# | | +# \------------------------------------------------------------*/ + +GMS_menu.o : GTB.h GSB.h GMS.h GMS_menu.c GMS_menu.h GMS_setup.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMS_menu.c + +GMS_dialog.o : GTB.h GSB.h GMS.h GMS_dialog.c GMS_dialog.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMS_dialog.c + +GMS_panel.o : GTB.h GSB.h GMS.h GMS_panel.c GMS_panel.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMS_panel.c + +GMS_setup.o : GTB.h GSB.h GMX.h GMF.h GMV.h GMT.h GMS.h GMH.h \ + GMS_setup.c GMS_setup.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMS_setup.c + +# /*------------------------------------------------------------\ +# | | +# | Dreal Menu Help | +# | | +# \------------------------------------------------------------*/ + +GMH_menu.o : GTB.h GSB.h GMH.h GMH_menu.c GMH_menu.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMH_menu.c + +GMH_panel.o : GTB.h GSB.h GMH.h GMH_panel.c GMH_panel.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMH_panel.c + +GMH_help.o : GTB.h GSB.h GMX.h GMH.h GMH_help.c GMH_help.h + $(CC) $(LOCAL_CFLAGS) $(LOCAL_HEADER) -c GMH_help.c + +# /*------------------------------------------------------------\ +# | | +# | Clean | +# | | +# \------------------------------------------------------------*/ + +clean : + $(RM) -f $(LOCAL_OBJ) + +# /*------------------------------------------------------------\ +# | | +# | RealClean | +# | | +# \------------------------------------------------------------*/ + +realclean : clean + $(RM) -f $(LOCAL_TARGET_BIN)/$(LOCAL_DREAL_BIN) + +# /*------------------------------------------------------------\ +# | | +# | Clean Object | +# | | +# \------------------------------------------------------------*/ + +cleanobj : + $(RM) -f $(LOCAL_OBJ) diff --git a/alliance/src/dreal/src/Makefile.am b/alliance/src/dreal/src/Makefile.am new file mode 100644 index 00000000..8f232278 --- /dev/null +++ b/alliance/src/dreal/src/Makefile.am @@ -0,0 +1,43 @@ +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = dreal +CFLAGS = @CFLAGS@ @X_CFLAGS@ -DDREAL_VERSION=\"@DREAL_VERSION@\" \ + -DDREAL_TOOL_NAME=\"dreal\" \ + -DALLIANCE_TOP=\"${ALLIANCE_TOP}\" \ + -DDREAL_DEFAULT_TECHNO_NAME=\"etc/cmos_7.dreal\" \ + -DGMS_FILE_NAME=\".dreal.cfg\" \ + -DDREAL_WINDOW_DX=\"DREAL_WINDOW_DX\" \ + -DDREAL_WINDOW_DY=\"DREAL_WINDOW_DY\" \ + -DDREAL_WINDOW_XMIN=\"DREAL_WINDOW_XMIN\" \ + -DDREAL_WINDOW_YMIN=\"DREAL_WINDOW_YMIN\" \ + -DDREAL_WINDOW_SIDE=\"DREAL_WINDOW_SIDE\" + +dreal_LDADD = @LIBS@ @X_LIBS@ @LINK_MOTIF@ \ +-lRtl -lRgs -lRcf -lRut -lRfm -lRpr -lRds -lMpu -lMap -lMmg -lMcp -lMph -lMut + + +INCLUDES = @INCLUDES@ @INCLUDE_MOTIF@ + +dreal_SOURCES = \ +dreal.c dreal.h GMC_create.c GMC_create.h GMC_dialog.c GMC_dialog.h GMC.h \ +GMC_menu.c GMC_menu.h GMC_message.c GMC_message.h GMC_panel.c GMC_panel.h \ +GME_dialog.c GME_dialog.h GME_edit.c GME_edit.h GME.h GME_menu.c GME_menu.h \ +GME_message.c GME_message.h GME_modify.c GME_modify.h GME_panel.c GME_panel.h \ +GME_search.c GME_search.h GME_select.c GME_select.h GMF_dialog.c GMF_dialog.h \ +GMF_file.c GMF_file.h GMF.h GMF_menu.c GMF_menu.h GMF_panel.c GMF_panel.h GMH.h \ +GMH_help.c GMH_help.h GMH_menu.c GMH_menu.h GMH_panel.c GMH_panel.h \ +GMS_dialog.c GMS_dialog.h GMS.h GMS_menu.c GMS_menu.h GMS_panel.c GMS_panel.h \ +GMS_setup.c GMS_setup.h GMT_dialog.c GMT_dialog.h GMT.h GMT_menu.c GMT_menu.h \ +GMT_message.c GMT_message.h GMT_panel.c GMT_panel.h GMT_tools.c GMT_tools.h \ +GMV_dialog.c GMV_dialog.h GMV.h GMV_map.c GMV_map.h GMV_menu.c GMV_menu.h \ +GMV_message.c GMV_message.h GMV_panel.c GMV_panel.h GMV_view.c GMV_view.h \ +GMX_color.c GMX_color.h GMX_cursor.c GMX_cursor.h GMX_dialog.c GMX_dialog.h \ +GMX_event.c GMX_event.h GMX_graphic.c GMX_graphic.h GMX_grid.c GMX_grid.h GMX.h \ +GMX_icon.c GMX_icon.h GMX_menu.c GMX_menu.h GMX_message.c GMX_message.h \ +GMX_motif.c GMX_motif.h GMX_panel.c GMX_panel.h GMX_view.c GMX_view.h \ +GRD_error.c GRD_error.h GRD.h GRD_rds.c GRD_rds.h GRD_search.c GRD_search.h \ +GRD_select.c GRD_select.h GRD_undo.c GRD_undo.h GRD_window.c GRD_window.h \ +GSB_error.c GSB_error.h GSB.h GSB_parse.c GSB_parse.h GSB_share.c GSB_share.h \ +GTB_cursor.c GTB_cursor.h GTB_dialog.c GTB_dialog.h GTB.h GTB_icon.c GTB_icon.h \ +GTB_menu.c GTB_menu.h GTB_panel.c GTB_panel.h GTB_pixmap.c GTB_pixmap.h \ +LIP6bw.h diff --git a/alliance/src/dreal/src/dreal.c b/alliance/src/dreal/src/dreal.c new file mode 100644 index 00000000..17d89771 --- /dev/null +++ b/alliance/src/dreal/src/dreal.c @@ -0,0 +1,192 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : dreal.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +# ident "@(#)DREAL ver 1.3 October 1994" + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include "mut.h" +# include "mph.h" +# include "rds.h" +# include "rpr.h" +# include "rwi.h" +# include "rut.h" +# include "GSB.h" +# include "GRD.h" +# include "GMX.h" + +# include "dreal.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| present | +| | +\------------------------------------------------------------*/ + +void DrealPresent() +{ + alliancebanner_with_authors( "Dreal", DREAL_VERSION, + "Design Real layout", "1999", + ALLIANCE_VERSION, "Ludovic Jacomme" ); +} + +/*------------------------------------------------------------\ +| | +| main | +| | +\------------------------------------------------------------*/ + +int main( argc, argv ) + + int argc; + char *argv[]; +{ + char *FileName = (char *)NULL; + char WindowInfo = 0; + char Debug = 0; + int Index; + + DrealPresent(); + + mbkenv(); + rdsenv(); + + for ( Index = 1; + Index < argc; + Index++ ) + { + if ( ! strcmp( argv[ Index ], "-l" ) ) + { + if ( ( Index + 1 ) < argc ) + { + Index = Index + 1; + FileName = argv[ Index ]; + } + } + else + if ( ! strcmp( argv[ Index ], "-w" ) ) + { + WindowInfo = 1; + } + else + if ( ! strcmp( argv[ Index ], "-debug" ) ) + { + Debug = 1; + } + else + if ( ! strcmp( argv[ Index ], "-xor" ) ) + { + DREAL_XOR_CURSOR = DREAL_TRUE; + } + else + if ( ! strcmp( argv[ Index ], "-force" ) ) + { + DREAL_FORCE_DISPLAY = DREAL_TRUE; + } + else + if ( ! strcmp( argv[ Index ], "-install" ) ) + { + DREAL_SWITCH_COLOR_MAP = DREAL_TRUE; + } + } + + if ( Debug ) rdsdebug(); + + rdsbegin(); + + Drealenv(); + loadrdsparam(); + DrealLoadParameters(); + + DrealInitializeRessources( &argc, argv ); + DrealInitializeWindow(); + + if ( WindowInfo ) + { + fprintf( stdout, "\nDreal window\n" ); + fprintf( stdout, "\n XMIN : %d" , DrealWindowXmin / RDS_PHYSICAL_GRID ); + fprintf( stdout, "\n XMAX : %d" , DrealWindowXmax / RDS_PHYSICAL_GRID ); + fprintf( stdout, "\n YMIN : %d" , DrealWindowYmin / RDS_PHYSICAL_GRID ); + fprintf( stdout, "\n YMAX : %d" , DrealWindowYmax / RDS_PHYSICAL_GRID ); + fprintf( stdout, "\n SIDE : %d" , DrealWindowSide / RDS_PHYSICAL_GRID ); + fprintf( stdout, "\n DX : %d" , DrealWindowDx ); + fprintf( stdout, "\n DY : %d" , DrealWindowDy ); + fprintf( stdout, "\n SIZE : %d\n", DrealWindowSize ); + } + + DrealInitializeErrorMessage( Debug ); + + if ( FileName != (char *)NULL ) + { + DrealAddFigure( FileName ); + } + + XtAppMainLoop( DrealApplication ); + + rdsend(); + + return( 0 ); +} diff --git a/alliance/src/dreal/src/dreal.h b/alliance/src/dreal/src/dreal.h new file mode 100644 index 00000000..57bd4f61 --- /dev/null +++ b/alliance/src/dreal/src/dreal.h @@ -0,0 +1,75 @@ +/*------------------------------------------------------------\ +| | +| This file is part of the Alliance CAD System Copyright | +| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie| +| | +| Home page : http://www-asim.lip6.fr/alliance/ | +| E-mail support : mailto:alliance-support@asim.lip6.fr | +| | +| This progam is free software; you can redistribute it | +| and/or modify it under the terms of the GNU General Public | +| License as published by the Free Software Foundation; | +| either version 2 of the License, or (at your option) any | +| later version. | +| | +| Alliance VLSI CAD System is distributed in the hope that | +| it will be useful, but WITHOUT ANY WARRANTY; | +| without even the implied warranty of MERCHANTABILITY or | +| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | +| Public License for more details. | +| | +| You should have received a copy of the GNU General Public | +| License along with the GNU C Library; see the file COPYING. | +| If not, write to the Free Software Foundation, Inc., | +| 675 Mass Ave, Cambridge, MA 02139, USA. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : DREAL | +| | +| File : dreal.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 28.03.95 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef DREAL_DREAL +# define DREAL_DREAL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| DrealInitializeRessources | +| | +\------------------------------------------------------------*/ + +# endif