From 2ef9896528eb206e0aa9dfd22080101175d7792c Mon Sep 17 00:00:00 2001 From: Ludovic Jacomme Date: Tue, 27 Nov 2007 20:41:46 +0000 Subject: [PATCH] - add xgraph (usefull to display graph) --- alliance/src/xgra/Makefile.am | 1 + alliance/src/xgra/configure.in | 185 +++ alliance/src/xgra/etc/Makefile.am | 8 + alliance/src/xgra/etc/xgra.par | 63 + alliance/src/xgra/src/Makefile.am | 62 + alliance/src/xgra/src/XGR.h | 291 ++++ alliance/src/xgra/src/XGR_bound.c | 146 ++ alliance/src/xgra/src/XGR_bound.h | 76 ++ alliance/src/xgra/src/XGR_error.c | 295 +++++ alliance/src/xgra/src/XGR_error.h | 75 ++ alliance/src/xgra/src/XGR_graph.c | 169 +++ alliance/src/xgra/src/XGR_graph.h | 73 + alliance/src/xgra/src/XGR_object.c | 543 ++++++++ alliance/src/xgra/src/XGR_object.h | 70 + alliance/src/xgra/src/XGR_place.c | 141 ++ alliance/src/xgra/src/XGR_place.h | 82 ++ alliance/src/xgra/src/XGR_select.c | 422 ++++++ alliance/src/xgra/src/XGR_select.h | 70 + alliance/src/xgra/src/XME.h | 85 ++ alliance/src/xgra/src/XME_dialog.c | 182 +++ alliance/src/xgra/src/XME_dialog.h | 77 ++ alliance/src/xgra/src/XME_edit.c | 257 ++++ alliance/src/xgra/src/XME_edit.h | 75 ++ alliance/src/xgra/src/XME_menu.c | 193 +++ alliance/src/xgra/src/XME_menu.h | 74 ++ alliance/src/xgra/src/XME_message.c | 113 ++ alliance/src/xgra/src/XME_message.h | 73 + alliance/src/xgra/src/XME_panel.c | 493 +++++++ alliance/src/xgra/src/XME_panel.h | 90 ++ alliance/src/xgra/src/XME_search.c | 228 ++++ alliance/src/xgra/src/XME_search.h | 75 ++ alliance/src/xgra/src/XME_select.c | 366 ++++++ alliance/src/xgra/src/XME_select.h | 69 + alliance/src/xgra/src/XMF.h | 76 ++ alliance/src/xgra/src/XMF_dialog.c | 235 ++++ alliance/src/xgra/src/XMF_dialog.h | 79 ++ alliance/src/xgra/src/XMF_file.c | 185 +++ alliance/src/xgra/src/XMF_file.h | 76 ++ alliance/src/xgra/src/XMF_menu.c | 187 +++ alliance/src/xgra/src/XMF_menu.h | 73 + alliance/src/xgra/src/XMF_panel.c | 822 ++++++++++++ alliance/src/xgra/src/XMF_panel.h | 79 ++ alliance/src/xgra/src/XMH.h | 74 ++ alliance/src/xgra/src/XMH_help.c | 77 ++ alliance/src/xgra/src/XMH_help.h | 71 + alliance/src/xgra/src/XMH_menu.c | 124 ++ alliance/src/xgra/src/XMH_menu.h | 73 + alliance/src/xgra/src/XMH_panel.c | 588 +++++++++ alliance/src/xgra/src/XMH_panel.h | 78 ++ alliance/src/xgra/src/XMS.h | 79 ++ alliance/src/xgra/src/XMS_dialog.c | 80 ++ alliance/src/xgra/src/XMS_dialog.h | 70 + alliance/src/xgra/src/XMS_menu.c | 231 ++++ alliance/src/xgra/src/XMS_menu.h | 70 + alliance/src/xgra/src/XMS_panel.c | 180 +++ alliance/src/xgra/src/XMS_panel.h | 76 ++ alliance/src/xgra/src/XMS_setup.c | 517 ++++++++ alliance/src/xgra/src/XMS_setup.h | 85 ++ alliance/src/xgra/src/XMT.h | 74 ++ alliance/src/xgra/src/XMT_dialog.c | 76 ++ alliance/src/xgra/src/XMT_dialog.h | 71 + alliance/src/xgra/src/XMT_menu.c | 122 ++ alliance/src/xgra/src/XMT_menu.h | 72 + alliance/src/xgra/src/XMT_message.c | 78 ++ alliance/src/xgra/src/XMT_message.h | 70 + alliance/src/xgra/src/XMT_panel.c | 200 +++ alliance/src/xgra/src/XMT_panel.h | 76 ++ alliance/src/xgra/src/XMT_tools.c | 80 ++ alliance/src/xgra/src/XMT_tools.h | 70 + alliance/src/xgra/src/XMV.h | 121 ++ alliance/src/xgra/src/XMV_dialog.c | 538 ++++++++ alliance/src/xgra/src/XMV_dialog.h | 93 ++ alliance/src/xgra/src/XMV_map.c | 754 +++++++++++ alliance/src/xgra/src/XMV_map.h | 102 ++ alliance/src/xgra/src/XMV_menu.c | 282 ++++ alliance/src/xgra/src/XMV_menu.h | 82 ++ alliance/src/xgra/src/XMV_message.c | 155 +++ alliance/src/xgra/src/XMV_message.h | 74 ++ alliance/src/xgra/src/XMV_panel.c | 1903 +++++++++++++++++++++++++++ alliance/src/xgra/src/XMV_panel.h | 125 ++ alliance/src/xgra/src/XMV_view.c | 670 ++++++++++ alliance/src/xgra/src/XMV_view.h | 108 ++ alliance/src/xgra/src/XMX.h | 274 ++++ alliance/src/xgra/src/XMX_color.c | 291 ++++ alliance/src/xgra/src/XMX_color.h | 85 ++ alliance/src/xgra/src/XMX_cursor.c | 514 ++++++++ alliance/src/xgra/src/XMX_cursor.h | 95 ++ alliance/src/xgra/src/XMX_dialog.c | 102 ++ alliance/src/xgra/src/XMX_dialog.h | 72 + alliance/src/xgra/src/XMX_event.c | 780 +++++++++++ alliance/src/xgra/src/XMX_event.h | 98 ++ alliance/src/xgra/src/XMX_graphic.c | 314 +++++ alliance/src/xgra/src/XMX_graphic.h | 72 + alliance/src/xgra/src/XMX_grid.c | 310 +++++ alliance/src/xgra/src/XMX_grid.h | 76 ++ alliance/src/xgra/src/XMX_icon.c | 131 ++ alliance/src/xgra/src/XMX_icon.h | 76 ++ alliance/src/xgra/src/XMX_menu.c | 201 +++ alliance/src/xgra/src/XMX_menu.h | 75 ++ alliance/src/xgra/src/XMX_message.c | 288 ++++ alliance/src/xgra/src/XMX_message.h | 73 + alliance/src/xgra/src/XMX_motif.c | 193 +++ alliance/src/xgra/src/XMX_motif.h | 70 + alliance/src/xgra/src/XMX_panel.c | 110 ++ alliance/src/xgra/src/XMX_panel.h | 72 + alliance/src/xgra/src/XMX_view.c | 667 ++++++++++ alliance/src/xgra/src/XMX_view.h | 78 ++ alliance/src/xgra/src/XSB.h | 160 +++ alliance/src/xgra/src/XSB_error.c | 178 +++ alliance/src/xgra/src/XSB_error.h | 88 ++ alliance/src/xgra/src/XSB_parse.c | 711 ++++++++++ alliance/src/xgra/src/XSB_parse.h | 112 ++ alliance/src/xgra/src/XSB_share.c | 146 ++ alliance/src/xgra/src/XSB_share.h | 65 + alliance/src/xgra/src/XTB.h | 215 +++ alliance/src/xgra/src/XTB_cursor.c | 174 +++ alliance/src/xgra/src/XTB_cursor.h | 73 + alliance/src/xgra/src/XTB_dialog.c | 467 +++++++ alliance/src/xgra/src/XTB_dialog.h | 70 + alliance/src/xgra/src/XTB_icon.c | 103 ++ alliance/src/xgra/src/XTB_icon.h | 65 + alliance/src/xgra/src/XTB_menu.c | 195 +++ alliance/src/xgra/src/XTB_menu.h | 67 + alliance/src/xgra/src/XTB_panel.c | 376 ++++++ alliance/src/xgra/src/XTB_panel.h | 65 + alliance/src/xgra/src/XTB_pixmap.c | 105 ++ alliance/src/xgra/src/XTB_pixmap.h | 65 + alliance/src/xgra/src/xgra.c | 145 ++ alliance/src/xgra/src/xgra.h | 75 ++ 129 files changed, 24340 insertions(+) create mode 100644 alliance/src/xgra/Makefile.am create mode 100644 alliance/src/xgra/configure.in create mode 100644 alliance/src/xgra/etc/Makefile.am create mode 100644 alliance/src/xgra/etc/xgra.par create mode 100644 alliance/src/xgra/src/Makefile.am create mode 100644 alliance/src/xgra/src/XGR.h create mode 100644 alliance/src/xgra/src/XGR_bound.c create mode 100644 alliance/src/xgra/src/XGR_bound.h create mode 100644 alliance/src/xgra/src/XGR_error.c create mode 100644 alliance/src/xgra/src/XGR_error.h create mode 100644 alliance/src/xgra/src/XGR_graph.c create mode 100644 alliance/src/xgra/src/XGR_graph.h create mode 100644 alliance/src/xgra/src/XGR_object.c create mode 100644 alliance/src/xgra/src/XGR_object.h create mode 100644 alliance/src/xgra/src/XGR_place.c create mode 100644 alliance/src/xgra/src/XGR_place.h create mode 100644 alliance/src/xgra/src/XGR_select.c create mode 100644 alliance/src/xgra/src/XGR_select.h create mode 100644 alliance/src/xgra/src/XME.h create mode 100644 alliance/src/xgra/src/XME_dialog.c create mode 100644 alliance/src/xgra/src/XME_dialog.h create mode 100644 alliance/src/xgra/src/XME_edit.c create mode 100644 alliance/src/xgra/src/XME_edit.h create mode 100644 alliance/src/xgra/src/XME_menu.c create mode 100644 alliance/src/xgra/src/XME_menu.h create mode 100644 alliance/src/xgra/src/XME_message.c create mode 100644 alliance/src/xgra/src/XME_message.h create mode 100644 alliance/src/xgra/src/XME_panel.c create mode 100644 alliance/src/xgra/src/XME_panel.h create mode 100644 alliance/src/xgra/src/XME_search.c create mode 100644 alliance/src/xgra/src/XME_search.h create mode 100644 alliance/src/xgra/src/XME_select.c create mode 100644 alliance/src/xgra/src/XME_select.h create mode 100644 alliance/src/xgra/src/XMF.h create mode 100644 alliance/src/xgra/src/XMF_dialog.c create mode 100644 alliance/src/xgra/src/XMF_dialog.h create mode 100644 alliance/src/xgra/src/XMF_file.c create mode 100644 alliance/src/xgra/src/XMF_file.h create mode 100644 alliance/src/xgra/src/XMF_menu.c create mode 100644 alliance/src/xgra/src/XMF_menu.h create mode 100644 alliance/src/xgra/src/XMF_panel.c create mode 100644 alliance/src/xgra/src/XMF_panel.h create mode 100644 alliance/src/xgra/src/XMH.h create mode 100644 alliance/src/xgra/src/XMH_help.c create mode 100644 alliance/src/xgra/src/XMH_help.h create mode 100644 alliance/src/xgra/src/XMH_menu.c create mode 100644 alliance/src/xgra/src/XMH_menu.h create mode 100644 alliance/src/xgra/src/XMH_panel.c create mode 100644 alliance/src/xgra/src/XMH_panel.h create mode 100644 alliance/src/xgra/src/XMS.h create mode 100644 alliance/src/xgra/src/XMS_dialog.c create mode 100644 alliance/src/xgra/src/XMS_dialog.h create mode 100644 alliance/src/xgra/src/XMS_menu.c create mode 100644 alliance/src/xgra/src/XMS_menu.h create mode 100644 alliance/src/xgra/src/XMS_panel.c create mode 100644 alliance/src/xgra/src/XMS_panel.h create mode 100644 alliance/src/xgra/src/XMS_setup.c create mode 100644 alliance/src/xgra/src/XMS_setup.h create mode 100644 alliance/src/xgra/src/XMT.h create mode 100644 alliance/src/xgra/src/XMT_dialog.c create mode 100644 alliance/src/xgra/src/XMT_dialog.h create mode 100644 alliance/src/xgra/src/XMT_menu.c create mode 100644 alliance/src/xgra/src/XMT_menu.h create mode 100644 alliance/src/xgra/src/XMT_message.c create mode 100644 alliance/src/xgra/src/XMT_message.h create mode 100644 alliance/src/xgra/src/XMT_panel.c create mode 100644 alliance/src/xgra/src/XMT_panel.h create mode 100644 alliance/src/xgra/src/XMT_tools.c create mode 100644 alliance/src/xgra/src/XMT_tools.h create mode 100644 alliance/src/xgra/src/XMV.h create mode 100644 alliance/src/xgra/src/XMV_dialog.c create mode 100644 alliance/src/xgra/src/XMV_dialog.h create mode 100644 alliance/src/xgra/src/XMV_map.c create mode 100644 alliance/src/xgra/src/XMV_map.h create mode 100644 alliance/src/xgra/src/XMV_menu.c create mode 100644 alliance/src/xgra/src/XMV_menu.h create mode 100644 alliance/src/xgra/src/XMV_message.c create mode 100644 alliance/src/xgra/src/XMV_message.h create mode 100644 alliance/src/xgra/src/XMV_panel.c create mode 100644 alliance/src/xgra/src/XMV_panel.h create mode 100644 alliance/src/xgra/src/XMV_view.c create mode 100644 alliance/src/xgra/src/XMV_view.h create mode 100644 alliance/src/xgra/src/XMX.h create mode 100644 alliance/src/xgra/src/XMX_color.c create mode 100644 alliance/src/xgra/src/XMX_color.h create mode 100644 alliance/src/xgra/src/XMX_cursor.c create mode 100644 alliance/src/xgra/src/XMX_cursor.h create mode 100644 alliance/src/xgra/src/XMX_dialog.c create mode 100644 alliance/src/xgra/src/XMX_dialog.h create mode 100644 alliance/src/xgra/src/XMX_event.c create mode 100644 alliance/src/xgra/src/XMX_event.h create mode 100644 alliance/src/xgra/src/XMX_graphic.c create mode 100644 alliance/src/xgra/src/XMX_graphic.h create mode 100644 alliance/src/xgra/src/XMX_grid.c create mode 100644 alliance/src/xgra/src/XMX_grid.h create mode 100644 alliance/src/xgra/src/XMX_icon.c create mode 100644 alliance/src/xgra/src/XMX_icon.h create mode 100644 alliance/src/xgra/src/XMX_menu.c create mode 100644 alliance/src/xgra/src/XMX_menu.h create mode 100644 alliance/src/xgra/src/XMX_message.c create mode 100644 alliance/src/xgra/src/XMX_message.h create mode 100644 alliance/src/xgra/src/XMX_motif.c create mode 100644 alliance/src/xgra/src/XMX_motif.h create mode 100644 alliance/src/xgra/src/XMX_panel.c create mode 100644 alliance/src/xgra/src/XMX_panel.h create mode 100644 alliance/src/xgra/src/XMX_view.c create mode 100644 alliance/src/xgra/src/XMX_view.h create mode 100644 alliance/src/xgra/src/XSB.h create mode 100644 alliance/src/xgra/src/XSB_error.c create mode 100644 alliance/src/xgra/src/XSB_error.h create mode 100644 alliance/src/xgra/src/XSB_parse.c create mode 100644 alliance/src/xgra/src/XSB_parse.h create mode 100644 alliance/src/xgra/src/XSB_share.c create mode 100644 alliance/src/xgra/src/XSB_share.h create mode 100644 alliance/src/xgra/src/XTB.h create mode 100644 alliance/src/xgra/src/XTB_cursor.c create mode 100644 alliance/src/xgra/src/XTB_cursor.h create mode 100644 alliance/src/xgra/src/XTB_dialog.c create mode 100644 alliance/src/xgra/src/XTB_dialog.h create mode 100644 alliance/src/xgra/src/XTB_icon.c create mode 100644 alliance/src/xgra/src/XTB_icon.h create mode 100644 alliance/src/xgra/src/XTB_menu.c create mode 100644 alliance/src/xgra/src/XTB_menu.h create mode 100644 alliance/src/xgra/src/XTB_panel.c create mode 100644 alliance/src/xgra/src/XTB_panel.h create mode 100644 alliance/src/xgra/src/XTB_pixmap.c create mode 100644 alliance/src/xgra/src/XTB_pixmap.h create mode 100644 alliance/src/xgra/src/xgra.c create mode 100644 alliance/src/xgra/src/xgra.h diff --git a/alliance/src/xgra/Makefile.am b/alliance/src/xgra/Makefile.am new file mode 100644 index 00000000..c1fa8896 --- /dev/null +++ b/alliance/src/xgra/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src etc diff --git a/alliance/src/xgra/configure.in b/alliance/src/xgra/configure.in new file mode 100644 index 00000000..9f1dfdee --- /dev/null +++ b/alliance/src/xgra/configure.in @@ -0,0 +1,185 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(src/xgra.c) + +XGRA_MAJOR_VERSION=1 +XGRA_MINOR_VERSION=5 +XGRA_VERSION=$XGRA_MAJOR_VERSION.$XGRA_MINOR_VERSION + +AC_SUBST(XGRA_MAJOR_VERSION) +AC_SUBST(XGRA_MINOR_VERSION) +AC_SUBST(XGRA_VERSION) + +# For automake. +VERSION=$XGRA_VERSION +PACKAGE=xgra + +dnl Initialize automake stuff +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) + +dnl Checks for programs. +AC_PROG_CC +AM_PROG_LEX +AC_PROG_YACC +AM_PROG_LIBTOOL +AC_PROG_MAKE_SET + +AC_CHECK_LIB(m, sqrt) + +AC_CHECK_PROGS(SED, gsed sed) +AC_PATH_XTRA + +dnl +dnl Check for X stuff +dnl +dnl +dnl Check X options +dnl +if test "$with_x" = no; then +AC_MSG_ERROR([requires the X window system to compile and run. + Please do not use the configure option '--without-x'.]) +fi +if test "$with_motif" = no; then +AC_MSG_ERROR([requires Motif to compile and run. + Please do not use the configure option '--without-motif'.]) +fi +dnl +dnl +dnl Check for X libraries +dnl +if test "$with_x" != no; then +ice_save_LIBS="$LIBS" +ice_save_CFLAGS="$CFLAGS" +ice_save_CXXFLAGS="$CXXFLAGS" +ice_save_CPPFLAGS="$CPPFLAGS" +ice_save_LDFLAGS="$LDFLAGS" + +dnl +dnl + +AC_FIND_MOTIF + +dnl +dnl +dnl +LIBS="$LIBS $X_EXTRA_LIBS" +CFLAGS="$CFLAGS $X_CFLAGS" +CPPFLAGS="$CPPFLAGS $X_CFLAGS" +LDFLAGS="$LDFLAGS $X_LIBS" +dnl +dnl Check for X library + +dnl +X11_LIBS="" +AC_CHECK_LIB(X11, XOpenDisplay, X11_LIBS="-lX11",,${X_PRE_LIBS} ${X_EXTRA_LIBS}) +if test "$X11_LIBS" = ""; then +dnl Not having X is fatal. Let the user fix this. +AC_MSG_ERROR([The X11 library '-lX11' could not be found. + Please use the configure options '--x-includes=DIR' + and '--x-libraries=DIR' to specify the X location.]) +fi +AC_SUBST(X_LIBS) +AC_SUBST(X11_LIBS) +AC_SUBST(X_PRE_LIBS) +dnl +dnl +dnl Check for -lXintl library. Lutz Kittler says +dnl that DLD-Linux with CDE wants `-lXintl' to refine `Xlcmbcurmax'. +dnl Guenther Roehrich says that +dnl we must check for `_Xlcmbcurmax' instead of `Xlcmbcurmax'. +dnl +AC_CHECK_LIB(Xintl, _Xlcmbcurmax, X11_LIBS="${X11_LIBS} -lXintl",, + ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}) +dnl +dnl +dnl Check for -lipc library. SCO unix is said to want that. +dnl +AC_CHECK_LIB(ipc, shmap, X11_LIBS="${X11_LIBS} -lipc",, + ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}) +dnl +dnl +dnl Check for X toolkit libraries +dnl +XT_LIBS="" +AC_CHECK_LIB(Xt, XtToolkitInitialize, XT_LIBS="-lXt",, + ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}) +if test "$XT_LIBS" = ""; then +dnl Not having Xt is fatal. Let the user fix this. +AC_MSG_ERROR([The X toolkit library '-lXt' could not be found. + Please use the configure options '--x-includes=DIR' + and '--x-libraries=DIR' to specify the X location. + See the files 'config.log' and 'ddd/config.log' + for further diagnostics.]) +fi +AC_SUBST(XT_LIBS) +dnl +dnl +dnl Check for X extension libraries +dnl +dnl +XEXT_LIBS="" +AC_CHECK_LIB(Xext, XShapeQueryVersion, XEXT_LIBS="-lXext",, + ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}) +AC_SUBST(XEXT_LIBS) + +dnl Check for Motif widget libraries +dnl + +XM_LIBS="" +XP_LIBS="" +if test "$motif_includes" != "no" && test "$motif_libraries" != "no" +then +dnl Motif 2.1 wants `-lXp' (X11R6.3 print server) +AC_CHECK_LIB(Xp, XpSelectInput, + XP_LIBS="-lXp" + AC_DEFINE(HAVE_XP),, + ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}) +dnl +AC_CHECK_LIB(Xm, XmCreateOptionMenu, + XM_LIBS="-lXm" + AC_DEFINE(HAVE_MOTIF),, + ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}) +dnl +AC_CHECK_LIB(Xm, xmUseVersion, + AC_DEFINE(HAVE_XMUSEVERSION),, + ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}) +dnl +AC_CHECK_LIB(Xm, XmInstallImage, + AC_DEFINE(HAVE_XMINSTALLIMAGE),, + ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}) +dnl +AC_CHECK_LIB(Xm, Xm21InstallImage, + AC_DEFINE(HAVE_XM21INSTALLIMAGE),, + ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}) +fi +if test "$XM_LIBS" = ""; then +dnl Without Motif, we won't get far. Let the user fix this. +AC_MSG_ERROR([The Motif library '-lXm' could not be found. + Please use the configure options '--with-motif-includes=DIR' + and '--with-motif-libraries=DIR' to specify the Xm location. + See the files 'config.log' + for further diagnostics.]) +fi + +AC_SUBST(XP_LIBS) +AC_SUBST(XM_LIBS) + +LIBS="$LIBS ${XM_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${X_PRE_LIBS} ${X11_LIBS} ${X_EXTRA_LIBS}" + + +LIBS="$ice_save_LIBS" +CFLAGS="$ice_save_CFLAGS" +CXXFLAGS="$ice_save_CXXFLAGS" +CPPFLAGS="$ice_save_CPPFLAGS" +LDFLAGS="$ice_save_LDFLAGS" +fi + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST + +AM_ALLIANCE + +AC_OUTPUT([ +Makefile +src/Makefile +etc/Makefile +]) diff --git a/alliance/src/xgra/etc/Makefile.am b/alliance/src/xgra/etc/Makefile.am new file mode 100644 index 00000000..4c9feb56 --- /dev/null +++ b/alliance/src/xgra/etc/Makefile.am @@ -0,0 +1,8 @@ +# $Id: Makefile.am,v 1.1 2007/11/27 20:41:31 ludo Exp $ + +etcdir=$(prefix)/etc + +etc_DATA=xgra.par + +EXTRA_DIST=$(etc_DATA) + diff --git a/alliance/src/xgra/etc/xgra.par b/alliance/src/xgra/etc/xgra.par new file mode 100644 index 00000000..0234cf23 --- /dev/null +++ b/alliance/src/xgra/etc/xgra.par @@ -0,0 +1,63 @@ +# /*------------------------------------------------------------\ +# | | +# | Title : Parameters File for Xvpn | +# | | +# | Date : 01.01.95 | +# | | +# \------------------------------------------------------------*/ +# /*------------------------------------------------------------\ +# | | +# | Unit | +# | | +# \------------------------------------------------------------*/ + +DEFINE XGRA_UNIT 32 + +# /*------------------------------------------------------------\ +# | | +# | Lower Grid Step in pixel by unit | +# | | +# \------------------------------------------------------------*/ + +DEFINE XGRA_LOWER_GRID_STEP 50 + +# /*------------------------------------------------------------\ +# | | +# | Xvpn Cursor Color Name | +# | | +# \------------------------------------------------------------*/ + +DEFINE XGRA_CURSOR_COLOR_NAME Black +DEFINE XGRA_BACKGROUND_COLOR_NAME Black +DEFINE XGRA_FOREGROUND_COLOR_NAME White +DEFINE XGRA_ACCEPT_COLOR_NAME magenta +DEFINE XGRA_CONNECT_COLOR_NAME pink + +# /*------------------------------------------------------------\ +# | | +# | Xvpn Cursor Size in pixel | +# | | +# \------------------------------------------------------------*/ + +DEFINE XGRA_CURSOR_SIZE 10 + +# /*------------------------------------------------------------\ +# | | +# | Xvpn Layer Color | +# | | +# \------------------------------------------------------------*/ + +TABLE XGRA_LAYER_NAME + + 0 Process Cyan Black + 1 Function sky_blue Black + 2 Wait pink Black + 3 Assign lawn_green Black + 4 Guard red Black + 5 Asg-Guard yellow Black + 6 Token magenta Black + 7 Unused_7 gray Black + 8 Unused_8 gray Black + 9 Unused_9 gray Black + +END diff --git a/alliance/src/xgra/src/Makefile.am b/alliance/src/xgra/src/Makefile.am new file mode 100644 index 00000000..1fa18b1a --- /dev/null +++ b/alliance/src/xgra/src/Makefile.am @@ -0,0 +1,62 @@ +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = xgra +AM_CFLAGS = @ALLIANCE_CFLAGS@ @X_CFLAGS@ \ + -DXGRA_DEFAULT_PARAM_NAME=\"${ALLIANCE_TOP}/etc/xgra.par\" \ + -DXMS_FILE_NAME=\".xgra.cfg\" + +# ----------------------------------------------------------------------------- +# X Libraries. +# ----------------------------------------------------------------------------- + +# Special flags for linking with X. (-L/usr/X11R5/lib) +X_LDFLAGS = @X_LIBS@ + +# Motif library. (-lXm) +LIBXM = @XM_LIBS@ + +# Use this alternative for building `semistatic' executables +# where Motif libraries are statically linked in. +# LIBXM = -Wl,-Bstatic @XM_LIBS@ -Wl,-Bdynamic + +# X extension library; needed for Athena and Motif >= 2.0. (-lXext) +LIBXEXT = @XEXT_LIBS@ + +# Xp library; sometimes needed for Motif >= 2.1. (-lXp) +LIBXP = @XP_LIBS@ + +# X toolkit library. (-lXt) +LIBXT = @XT_LIBS@ + +# X library. (-lX11 -lSM -lICE -lnsl -lsocket) +LIBX11 = @X_PRE_LIBS@ @X11_LIBS@ @X_EXTRA_LIBS@ + +# All libraries shown above +ALL_X_LIBS = $(X_LDFLAGS) $(LIBXM) $(LIBXT) \ + $(LIBXP) $(LIBXEXT) $(LIBX11) + + + +xgra_LDADD = @ALLIANCE_LIBS@ $(ALL_X_LIBS) \ +-lAut -lMut + +xgra_SOURCES = \ +LIP6bw.h XME_dialog.c XME_dialog.h XME_edit.c XME_edit.h XME.h XME_menu.c \ +XME_menu.h XME_message.c XME_message.h XME_panel.c XME_panel.h XME_search.c \ +XME_search.h XME_select.c XME_select.h XMF_dialog.c XMF_dialog.h XMF_file.c \ +XMF_file.h XMF.h XMF_menu.c XMF_menu.h XMF_panel.c XMF_panel.h XMH.h XMH_help.c \ +XMH_help.h XMH_menu.c XMH_menu.h XMH_panel.c XMH_panel.h XMS_dialog.c \ +XMS_dialog.h XMS.h XMS_menu.c XMS_menu.h XMS_panel.c XMS_panel.h XMS_setup.c \ +XMS_setup.h XMT_dialog.c XMT_dialog.h XMT.h XMT_menu.c XMT_menu.h XMT_message.c \ +XMT_message.h XMT_panel.c XMT_panel.h XMT_tools.c XMT_tools.h XMV_dialog.c \ +XMV_dialog.h XMV.h XMV_map.c XMV_map.h XMV_menu.c XMV_menu.h XMV_message.c \ +XMV_message.h XMV_panel.c XMV_panel.h XMV_view.c XMV_view.h XMX_color.c \ +XMX_color.h XMX_cursor.c XMX_cursor.h XMX_dialog.c XMX_dialog.h XMX_event.c \ +XMX_event.h XMX_graphic.c XMX_graphic.h XMX_grid.c XMX_grid.h XMX.h XMX_icon.c \ +XMX_icon.h XMX_menu.c XMX_menu.h XMX_message.c XMX_message.h XMX_motif.c \ +XMX_motif.h XMX_panel.c XMX_panel.h XMX_view.c XMX_view.h XSB_error.c \ +XSB_error.h XSB.h XSB_parse.c XSB_parse.h XSB_share.c XSB_share.h XTB_cursor.c \ +XTB_cursor.h XTB_dialog.c XTB_dialog.h XTB.h XTB_icon.c XTB_icon.h XTB_menu.c \ +XTB_menu.h XTB_panel.c XTB_panel.h XTB_pixmap.c XTB_pixmap.h \ +XGR_bound.c XGR_bound.h XGR_error.c XGR_error.h XGR_graph.c XGR_graph.h \ +XGR_object.c XGR_object.h XGR_place.c XGR_place.h XGR_select.c XGR_select.h xgra.c diff --git a/alliance/src/xgra/src/XGR.h b/alliance/src/xgra/src/XGR.h new file mode 100644 index 00000000..7b7007cc --- /dev/null +++ b/alliance/src/xgra/src/XGR.h @@ -0,0 +1,291 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : XFS.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XFS +# define XGRA_XFS + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_OBJECT_CIRCLE 0x0000 +# define XGRA_OBJECT_LINE 0x0001 +# define XGRA_OBJECT_RECTANGLE 0x0002 +# define XGRA_OBJECT_ARROW 0x0003 +# define XGRA_OBJECT_TEXT 0x0004 +# define XGRA_OBJECT_TYPE 0x000F + +# define XGRA_OBJECT_NODE 0x0010 +# define XGRA_OBJECT_ARC 0x0020 + +# define XGRA_OBJECT_LINE_DOWN 0x0100 +# define XGRA_OBJECT_LINE_LEFT 0x0200 + +# define XGRA_OBJECT_SELECT 0x0400 +# define XGRA_OBJECT_ACCEPT 0x0800 +# define XGRA_OBJECT_CONNECT 0x1000 + +/*------------------------------------------------------------\ +| | +| Macros | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Object | +| | +\------------------------------------------------------------*/ + +# define GetXgraObjectType( X ) ( ( X )->TYPE & XGRA_OBJECT_TYPE ) + +# define IsXgraLineDown( X ) ( ( X )->TYPE & XGRA_OBJECT_LINE_DOWN ) +# define IsXgraLineLeft( X ) ( ( X )->TYPE & XGRA_OBJECT_LINE_LEFT ) +# define IsXgraNode( X ) ( ( X )->TYPE & XGRA_OBJECT_NODE ) +# define IsXgraArc( X ) ( ( X )->TYPE & XGRA_OBJECT_ARC ) + +# define SetXgraLineDown( X ) ( ( X )->TYPE |= XGRA_OBJECT_LINE_DOWN ) +# define SetXgraLineLeft( X ) ( ( X )->TYPE |= XGRA_OBJECT_LINE_LEFT ) +# define SetXgraNode( X ) ( ( X )->TYPE |= XGRA_OBJECT_NODE ) +# define SetXgraArc( X ) ( ( X )->TYPE |= XGRA_OBJECT_ARC ) + +# define ClearXgraLineDown( X ) ( ( X )->TYPE &= ~XGRA_OBJECT_LINE_DOWN ) +# define ClearXgraLineLeft( X ) ( ( X )->TYPE &= ~XGRA_OBJECT_LINE_LEFT ) +# define ClearXgraNode( X ) ( ( X )->TYPE &= ~XGRA_OBJECT_NODE ) +# define ClearXgraArc( X ) ( ( X )->TYPE &= ~XGRA_OBJECT_ARC ) + +/*------------------------------------------------------------\ +| | +| Select | +| | +\------------------------------------------------------------*/ + +# define IsXgraSelect( X ) ( ( X )->TYPE & XGRA_OBJECT_SELECT ) +# define SetXgraSelect( X ) ( ( X )->TYPE |= XGRA_OBJECT_SELECT ) +# define ClearXgraSelect( X ) ( ( X )->TYPE &= ~XGRA_OBJECT_SELECT ) + +/*------------------------------------------------------------\ +| | +| Accept | +| | +\------------------------------------------------------------*/ + +# define IsXgraAccept( X ) ( ( X )->TYPE & XGRA_OBJECT_ACCEPT ) +# define SetXgraAccept( X ) ( ( X )->TYPE |= XGRA_OBJECT_ACCEPT ) +# define ClearXgraAccept( X ) ( ( X )->TYPE &= ~XGRA_OBJECT_ACCEPT ) + +/*------------------------------------------------------------\ +| | +| Connect | +| | +\------------------------------------------------------------*/ + +# define IsXgraConnect( X ) ( ( X )->TYPE & XGRA_OBJECT_CONNECT ) +# define SetXgraConnect( X ) ( ( X )->TYPE |= XGRA_OBJECT_CONNECT ) +# define ClearXgraConnect( X ) ( ( X )->TYPE &= ~XGRA_OBJECT_CONNECT ) + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Point | +| | +\------------------------------------------------------------*/ + + typedef struct xgrapoint + { + long X; + long Y; + + } xgrapoint; + +/*------------------------------------------------------------\ +| | +| Object | +| | +\------------------------------------------------------------*/ + + typedef struct xgraobj_list + { + struct xgraobj_list *NEXT; + struct xgraobj_list *LINK; + char *NAME; + short LAYER; + long TYPE; + long X; + long Y; + long DX; + long DY; + void *USER; + + } xgraobj_list; + + typedef struct xautgraph + { + struct xautgraph *NEXT; + char *NAME; + xgraobj_list *OBJECT [ XGRA_MAX_LAYER ]; + xgraobj_list *TEXT [ XGRA_MAX_LAYER ]; + + } xautgraph; + +/*------------------------------------------------------------\ +| | +| Select | +| | +\------------------------------------------------------------*/ + + typedef struct xgraselect_list + { + struct xgraselect_list *NEXT; + xgraobj_list *OBJECT; + + } xgraselect_list; + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern long XgraBoundXmin; + extern long XgraBoundYmin; + extern long XgraBoundXmax; + extern long XgraBoundYmax; + extern char XgraRecomputeBound; + + extern xautgraph *XgraFigure; + extern autgraph *XgraFigureGra; + + extern xgraselect_list *XgraHeadSelect; + extern xgraselect_list *XgraHeadConnect; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Add Functions | +| | +\------------------------------------------------------------*/ + + extern xautgraph *XgraAddFigure(); + extern xgraobj_list *XgraAddCircle(); + extern xgraobj_list *XgraAddLine(); + extern xgraobj_list *XgraAddText(); + +/*------------------------------------------------------------\ +| | +| Del Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraDelFigure(); + +/*------------------------------------------------------------\ +| | +| Flag Set & Clear Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraSelectObject(); + extern void XgraUnselectObject(); + extern void XgraAcceptObject(); + extern void XgraRejectObject(); + extern void XgraConnectObject(); + extern void XgraDisconnectObject(); + +/*------------------------------------------------------------\ +| | +| Select Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraAddSelect(); + extern void XgraDelSelect(); + extern void XgraPurgeSelect(); + +/*------------------------------------------------------------\ +| | +| Connect Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraAddConnect(); + extern void XgraDelConnect(); + +/*------------------------------------------------------------\ +| | +| Bound Compute | +| | +\------------------------------------------------------------*/ + + extern char XgraComputeBound(); + +/*------------------------------------------------------------\ +| | +| Load Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraLoadFigure(); + +/*------------------------------------------------------------\ +| | +| Error Message Functions | +| | +\------------------------------------------------------------*/ + + extern char *XgraGetErrorMessage(); + +/*------------------------------------------------------------\ +| | +| Informations Functions | +| | +\------------------------------------------------------------*/ + + extern char *XgraGetInformations(); + +# endif diff --git a/alliance/src/xgra/src/XGR_bound.c b/alliance/src/xgra/src/XGR_bound.c new file mode 100644 index 00000000..23163fe3 --- /dev/null +++ b/alliance/src/xgra/src/XGR_bound.c @@ -0,0 +1,146 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Bound.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XGR_bound.h" + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + long XgraBoundXmin = 0; + long XgraBoundYmin = 0; + long XgraBoundXmax = 0; + long XgraBoundYmax = 0; + + char XgraRecomputeBound = XGRA_TRUE; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraComputeBound | +| | +\------------------------------------------------------------*/ + +char XgraComputeBound() + +{ + xgraobj_list *Obj; + short Layer; + short FirstBound; + + if ( XgraFigure == (xautgraph *)NULL ) + { + return( XGRA_FALSE ); + } + + if ( XgraRecomputeBound == XGRA_FALSE ) + { + return( XGRA_TRUE ); + } + + autbegin(); + + FirstBound = 1; + + for ( Layer = 0; Layer < XGRA_MAX_LAYER; Layer++ ) + { + for ( Obj = XgraFigure->OBJECT[ Layer ]; + Obj != (xgraobj_list *)NULL; + Obj = Obj->NEXT ) + { + if ( FirstBound ) + { + XgraBoundXmin = Obj->X; + XgraBoundYmin = Obj->Y; + XgraBoundXmax = Obj->X + Obj->DX; + XgraBoundYmax = Obj->Y + Obj->DY; + FirstBound = 0; + } + else + { + if ( Obj->X < XgraBoundXmin ) + { + XgraBoundXmin = Obj->X; + } + + if ( Obj->Y < XgraBoundYmin ) + { + XgraBoundYmin = Obj->Y; + } + + if ( ( Obj->X + Obj->DX ) > XgraBoundXmax ) + { + XgraBoundXmax = Obj->X + Obj->DX; + } + + if ( ( Obj->Y + Obj->DY ) > XgraBoundYmax ) + { + XgraBoundYmax = Obj->Y + Obj->DY; + } + } + } + } + + XgraBoundXmin = XgraBoundXmin - ( XGRA_UNIT << 1 ); + XgraBoundYmin = XgraBoundYmin - ( XGRA_UNIT << 1 ); + XgraBoundXmax = XgraBoundXmax + ( XGRA_UNIT << 1 ); + XgraBoundYmax = XgraBoundYmax + ( XGRA_UNIT << 1 ); + + XgraRecomputeBound = XGRA_FALSE; + + autend(); + return( XGRA_TRUE ); +} diff --git a/alliance/src/xgra/src/XGR_bound.h b/alliance/src/xgra/src/XGR_bound.h new file mode 100644 index 00000000..aa0d6fa6 --- /dev/null +++ b/alliance/src/xgra/src/XGR_bound.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 : XGRA | +| | +| File : Bound.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGR_BOUND +# define XGR_BOUND + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_DEFAULT_BOUND_XMIN 0 +# define XGRA_DEFAULT_BOUND_YMIN 0 +# define XGRA_DEFAULT_BOUND_XMAX 100 +# define XGRA_DEFAULT_BOUND_YMAX 100 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XGR_error.c b/alliance/src/xgra/src/XGR_error.c new file mode 100644 index 00000000..38549bad --- /dev/null +++ b/alliance/src/xgra/src/XGR_error.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 : XGRA | +| | +| File : Error.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XGR_error.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static FILE *XgraStreamErr; + static FILE *XgraStreamOut; + static FILE *XgraStreamAll; + + static char XgraErrFileName[ 40 ]; + static char XgraOutFileName[ 40 ]; + static char XgraAllFileName[ 40 ]; + + static char XgraNormalMode = 1; + +/*------------------------------------------------------------\ +| | +| Xgra Error Message | +| | +\------------------------------------------------------------*/ + + static char *XgraErrorBuffer = (char *)NULL; + +/*------------------------------------------------------------\ +| | +| Xgra Informations | +| | +\------------------------------------------------------------*/ + + static char XgraInformationsBuffer[ XGRA_INFORMATIONS_BUFFER_SIZE ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Xgra Error Message Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraInitializeErrorMessage | +| | +\------------------------------------------------------------*/ + +void XgraInitializeErrorMessage( Debug ) + + char Debug; +{ + autbegin(); + + XgraNormalMode = ! Debug; + + if ( XgraNormalMode ) + { + sprintf( XgraOutFileName, "/usr/tmp/out_%d",getpid() ); + } + + sprintf( XgraErrFileName, "/usr/tmp/err_%d",getpid() ); + sprintf( XgraAllFileName, "/usr/tmp/all_%d",getpid() ); + + XgraStreamErr = freopen( XgraErrFileName, "w+", stderr); + XgraStreamAll = fopen ( XgraAllFileName, "w+" ); + + if ( XgraNormalMode ) + { + XgraStreamOut = freopen( XgraOutFileName, "w+", stdout); + } + else + { + XgraStreamOut = XgraStreamErr; + } + + if ( ( XgraStreamAll == (FILE *)NULL ) || + ( XgraStreamOut == (FILE *)NULL ) || + ( XgraStreamErr == (FILE *)NULL ) ) + { + fprintf( stdout, "Grm: Unable to open trace window !\n"); + exit( 1 ); + } + + if ( XgraNormalMode ) + { + unlink( XgraOutFileName ); + } + + unlink( XgraErrFileName ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraFlushErrorMessage | +| | +\------------------------------------------------------------*/ + +void XgraFlushErrorMessage() +{ + int Data; + + autbegin(); + + fflush( XgraStreamErr ); + fseek( XgraStreamErr, 0L, 0 ); + + while( ( Data = fgetc( XgraStreamErr ) ) != EOF ) + { + fputc( Data, XgraStreamAll ); + } + + fclose( XgraStreamErr ); + + XgraStreamErr = freopen( XgraErrFileName, "w+", stderr ); + + if ( XgraNormalMode ) + { + fflush( XgraStreamOut ); + fseek( XgraStreamOut, 0L, 0 ); + + while( ( Data = fgetc( XgraStreamOut ) ) != EOF ) + { + fputc( Data, XgraStreamAll ); + } + + fclose( XgraStreamOut ); + + XgraStreamOut = freopen( XgraOutFileName, "w+", stdout ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraGetErrorMessage | +| | +\------------------------------------------------------------*/ + +char *XgraGetErrorMessage() + +{ + char *Message; + long Length; + long Index; + int Data; + + autbegin(); + + XgraFlushErrorMessage(); + + fflush( XgraStreamAll ); + + Length = ftell( XgraStreamAll ); + + if ( XgraErrorBuffer != (char *)NULL ) + { + autfreeblock( XgraErrorBuffer ); + } + + XgraErrorBuffer = autallocblock( Length + 1 ); + Index = 0; + + while ( ( ( Data = fgetc( XgraStreamAll ) ) != EOF ) && + ( Index < Length ) ) + { + XgraErrorBuffer[ Index++ ] = (char)Data; + } + + rewind( XgraStreamAll ); + + XgraErrorBuffer[ Index ] = '\0'; + + if ( Index == 0 ) + { + Message = (char *)NULL; + } + else + { + Message = XgraErrorBuffer; + } + + autend(); + return( Message ); +} + +/*------------------------------------------------------------\ +| | +| XgraGetInformations | +| | +\------------------------------------------------------------*/ + +char *XgraGetInformations() + +{ + char *Scan; + + autbegin(); + + XgraComputeBound(); + + Scan = XgraInformationsBuffer; + + if ( XgraFigureGra != (autgraph *)NULL ) + { + sprintf( Scan, " FIGURE : %s\n\n NODES : %d\n ARCS : %d\n\n", + XgraFigure->NAME, + XgraFigureGra->NUMBER_NODE, + XgraFigureGra->NUMBER_ARC ); + } + else + { + sprintf( Scan, " FIGURE : No current figure !\n\n" ); + } + + Scan = Scan + strlen( Scan ); + + sprintf( Scan, " BOUNDING BOX : \n\n XMIN : %d\n YMIN : %d\n XMAX : %d\n YMAX : %d\n\n", + XgraBoundXmin / XGRA_UNIT, XgraBoundYmin / XGRA_UNIT, + XgraBoundXmax / XGRA_UNIT, XgraBoundYmax / XGRA_UNIT ); + + Scan = Scan + strlen( Scan ); + + sprintf( Scan, " XGRA PARAM : %s\n\n", XGRA_PARAM_NAME ); + + autend(); + return( XgraInformationsBuffer ); +} diff --git a/alliance/src/xgra/src/XGR_error.h b/alliance/src/xgra/src/XGR_error.h new file mode 100644 index 00000000..1d965735 --- /dev/null +++ b/alliance/src/xgra/src/XGR_error.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 : XGRA | +| | +| File : Error.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGR_ERROR +# define XGR_ERROR + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_INFORMATIONS_BUFFER_SIZE 1024 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraFlushErrorMessage(); + +# endif diff --git a/alliance/src/xgra/src/XGR_graph.c b/alliance/src/xgra/src/XGR_graph.c new file mode 100644 index 00000000..8b5d3a82 --- /dev/null +++ b/alliance/src/xgra/src/XGR_graph.c @@ -0,0 +1,169 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Gra.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XGR_graph.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + autgraph *XgraFigureGra = (autgraph *)NULL; + +/*------------------------------------------------------------\ +| | +| For Set Long Jump | +| | +\------------------------------------------------------------*/ + + static jmp_buf XgraJumpBuffer; + static void (*OldExitHandler)() = NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Xgra Exit Handler Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraExitHandler | +| | +\------------------------------------------------------------*/ + +void XgraExitHandler() +{ + XgraFlushErrorMessage(); + + signal( SIGTERM, OldExitHandler ); + longjmp( XgraJumpBuffer, 1); +} + +/*------------------------------------------------------------\ +| | +| XgraActiveExitHandler | +| | +\------------------------------------------------------------*/ + +void XgraActiveExitHandler() +{ + OldExitHandler = signal( SIGTERM, XgraExitHandler ); +} + +/*------------------------------------------------------------\ +| | +| XgraResetExitHandler | +| | +\------------------------------------------------------------*/ + +void XgraResetExitHandler() +{ + signal( SIGTERM, OldExitHandler ); +} + +/*------------------------------------------------------------\ +| | +| Get Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Xgragetgrafig | +| | +\------------------------------------------------------------*/ + +autgraph *Xgragetgrafig( FileName ) + + char *FileName; +{ + autgraph *FigureGra; + + autbegin(); + + FigureGra = (autgraph *)NULL; + + XgraActiveExitHandler(); + + if ( setjmp( XgraJumpBuffer ) == 0 ) + { + FigureGra = loadautgraph( FileName ); + + XgraResetExitHandler(); + + autend(); + return( FigureGra ); + } + + if ( FigureGra != (autgraph *)NULL ) + { + destroyautgraph( FigureGra ); + } + + autend(); + return( (autgraph *)NULL ); +} diff --git a/alliance/src/xgra/src/XGR_graph.h b/alliance/src/xgra/src/XGR_graph.h new file mode 100644 index 00000000..6356b089 --- /dev/null +++ b/alliance/src/xgra/src/XGR_graph.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 : XGRA | +| | +| File : Gra.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_H +# define XGRA_H + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern autgraph *Xgragetgrafig(); + +# endif diff --git a/alliance/src/xgra/src/XGR_object.c b/alliance/src/xgra/src/XGR_object.c new file mode 100644 index 00000000..3071bfbf --- /dev/null +++ b/alliance/src/xgra/src/XGR_object.c @@ -0,0 +1,543 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Object.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XGR_place.h" +# include "XGR_object.h" +# include "XGR_graph.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + xautgraph *XgraFigure = (xautgraph *)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Alloc Functions | +| | +\------------------------------------------------------------*/ + +xautgraph *XgraAllocFigure() +{ + return( (xautgraph *)autallocblock( sizeof( xautgraph ) ) ); +} + +xgraobj_list *XgraAllocObject() +{ + return( (xgraobj_list *)autallocheap( sizeof( xgraobj_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Free Functions | +| | +\------------------------------------------------------------*/ + +void XgraFreeFigure( Figure ) + + xautgraph *Figure; +{ + autfreeblock( Figure ); +} + +void XgraFreeObject( Object ) + + xgraobj_list *Object; +{ + autfreeheap( Object, sizeof( xgraobj_list ) ); +} + +/*------------------------------------------------------------\ +| | +| Add Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraAddCircle | +| | +\------------------------------------------------------------*/ + +xgraobj_list *XgraAddCircle( X, Y, R, Layer ) + + long X; + long Y; + long R; + short Layer; +{ + xgraobj_list *Object; + + autbegin(); + + Object = XgraAllocObject(); + Object->TYPE = XGRA_OBJECT_CIRCLE; + Object->LAYER = Layer; + Object->NEXT = XgraFigure->OBJECT[ Layer ]; + Object->X = X - R; + Object->Y = Y - R; + Object->DX = ( R << 1 ); + Object->DY = ( R << 1 ); + + XgraFigure->OBJECT[ Layer ] = Object; + + autend(); + return( Object ); +} + +/*------------------------------------------------------------\ +| | +| XgraAddLine | +| | +\------------------------------------------------------------*/ + +xgraobj_list *XgraAddLine( X1, Y1, X2, Y2, LayerFrom, LayerTo ) + + long X1; + long Y1; + long X2; + long Y2; + short LayerFrom; + short LayerTo; +{ + xgraobj_list *Object; + + autbegin(); + + Object = XgraAllocObject(); + Object->LAYER = LayerFrom; + Object->TYPE = XGRA_OBJECT_LINE; + Object->NEXT = XgraFigure->OBJECT[ LayerTo ]; + + if ( X1 > X2 ) + { + SetXgraLineLeft( Object ); + + Object->X = X2; + Object->DX = X1 - X2; + } + else + { + Object->X = X1; + Object->DX = X2 - X1; + } + + if ( Y1 > Y2 ) + { + SetXgraLineDown( Object ); + + Object->Y = Y2; + Object->DY = Y1 - Y2; + } + else + { + Object->Y = Y1; + Object->DY = Y2 - Y1; + } + + XgraFigure->OBJECT[ LayerTo ] = Object; + + autend(); + return( Object ); +} + +/*------------------------------------------------------------\ +| | +| XgraAddArrow | +| | +\------------------------------------------------------------*/ + +xgraobj_list *XgraAddArrow( X1, Y1, X2, Y2, LayerFrom, LayerTo ) + + long X1; + long Y1; + long X2; + long Y2; + short LayerFrom; + short LayerTo; +{ + xgraobj_list *Object; + + autbegin(); + + Object = XgraAllocObject(); + Object->LAYER = LayerFrom; + Object->TYPE = XGRA_OBJECT_ARROW; + Object->NEXT = XgraFigure->OBJECT[ LayerTo ]; + + if ( X1 > X2 ) + { + SetXgraLineLeft( Object ); + + Object->X = X2; + Object->DX = X1 - X2; + } + else + { + Object->X = X1; + Object->DX = X2 - X1; + } + + if ( Y1 > Y2 ) + { + SetXgraLineDown( Object ); + + Object->Y = Y2; + Object->DY = Y1 - Y2; + } + else + { + Object->Y = Y1; + Object->DY = Y2 - Y1; + } + + XgraFigure->OBJECT[ LayerTo ] = Object; + + autend(); + return( Object ); +} + +/*------------------------------------------------------------\ +| | +| XgraAddRectangle | +| | +\------------------------------------------------------------*/ + +xgraobj_list *XgraAddRectangle( X, Y, DX, DY, Layer ) + + long X; + long Y; + long DX; + long DY; + short Layer; +{ + xgraobj_list *Object; + + autbegin(); + + Object = XgraAllocObject(); + Object->TYPE = XGRA_OBJECT_RECTANGLE; + Object->LAYER = Layer; + Object->NEXT = XgraFigure->OBJECT[ Layer ]; + Object->X = X; + Object->Y = Y; + Object->DX = DX; + Object->DY = DY; + + XgraFigure->OBJECT[ Layer ] = Object; + + autend(); + return( Object ); +} + +/*------------------------------------------------------------\ +| | +| XgraAddText | +| | +\------------------------------------------------------------*/ + +xgraobj_list *XgraAddText( X, Y, Name, Layer ) + + long X; + long Y; + char *Name; + short Layer; +{ + xgraobj_list *Object; + + autbegin(); + + Object = XgraAllocObject(); + Object->LAYER = Layer; + Object->TYPE = XGRA_OBJECT_TEXT; + Object->NEXT = XgraFigure->TEXT[ Layer ]; + Object->NAME = namealloc( Name ); + Object->X = X; + Object->Y = Y; + + XgraFigure->TEXT[ Layer ] = Object; + + autend(); + return( Object ); +} + +/*------------------------------------------------------------\ +| | +| XgraAddNode | +| | +\------------------------------------------------------------*/ + +xgraobj_list *XgraAddNode( Node, X, Y, Layer ) + + autnode_list *Node; + long X; + long Y; + short Layer; +{ + xgraobj_list *Circle; + xgraobj_list *Text; + + X *= XGRA_UNIT; + Y *= XGRA_UNIT; + + Circle = XgraAddCircle( X, Y, XGRA_UNIT, Layer ); + Text = XgraAddText( X, Y - ( ( 3 * XGRA_UNIT ) >> 1 ), + Node->NAME, Layer ); + + Text->LINK = Circle; + Circle->LINK = Text; + + SetXgraNode( Circle ); + SetXgraNode( Text ); + + Circle->USER = (void *)Node; + Text->USER = (void *)Node; + Node->USER = (void *)Circle; + + autend(); + return( Circle ); +} + +/*------------------------------------------------------------\ +| | +| XgraAddArc | +| | +\------------------------------------------------------------*/ + +xgraobj_list *XgraAddArc( Arc ) + + autarc_list *Arc; +{ + xgraobj_list *Arrow; + xgraobj_list *ObjFrom; + xgraobj_list *ObjTo; + long X1; + long Y1; + long X2; + long Y2; + unsigned long Layer; + double Distance; + + ObjFrom = (xgraobj_list *)(Arc->NODE_FROM->USER); + ObjTo = (xgraobj_list *)(Arc->NODE_TO->USER); + + Layer = ((unsigned long)Arc->FLAGS) % XGRA_MAX_LAYER; + + if ( ObjFrom != ObjTo ) + { + X1 = ObjTo->X + ( ObjTo->DX >> 1 ); + Y1 = ObjTo->Y + ( ObjTo->DX >> 1 ); + X2 = ObjFrom->X + ( ObjFrom->DX >> 1 ); + Y2 = ObjFrom->Y + ( ObjFrom->DY >> 1 ); + } + else + { + X1 = ObjFrom->X + ( ObjFrom->DX >> 1 ); + Y1 = ObjFrom->Y + ( ObjFrom->DY >> 1 ); + + Distance = sqrt( (double)( X1 * X1 ) + (double)( Y1 * Y1 ) ); + + X2 = X1 + (long)( (double)( X1 * ( XGRA_UNIT << 2 ) ) / Distance ); + Y2 = Y1 + (long)( (double)( Y1 * ( XGRA_UNIT << 2 ) ) / Distance ); + } + + Arrow = XgraAddArrow( X1, Y1, X2, Y2, (short)Layer, (short)Layer ); + + Arrow->LINK = Arrow; + SetXgraArc( Arrow ); + + Arrow->USER = (void *)Arc; + Arc->USER = (void *)Arrow; + + autend(); + return( Arrow ); +} + +/*------------------------------------------------------------\ +| | +| XgraAddFigure | +| | +\------------------------------------------------------------*/ + +xautgraph *XgraAddFigure() +{ + autnode_list *ScanNode; + autarc_list *ScanArc; + xgrapoint *Point; + unsigned long Layer; + + autbegin(); + + XgraFigure = XgraAllocFigure(); + XgraFigure->NAME = namealloc( "graph" ); + + XgraPlaceFigure(); + + for ( ScanNode = XgraFigureGra->NODE; + ScanNode != (autnode_list *)NULL; + ScanNode = ScanNode->NEXT ) + { + Point = (xgrapoint *)( ScanNode->USER ); + Layer = ((unsigned long)ScanNode->FLAGS) % XGRA_MAX_LAYER; + + XgraAddNode( ScanNode, Point->X, Point->Y, (short)Layer ); + } + + for ( ScanArc = XgraFigureGra->ARC; + ScanArc != (autarc_list *)NULL; + ScanArc = ScanArc->NEXT ) + { + XgraAddArc( ScanArc ); + } + + autend(); + return( XgraFigure ); +} + +/*------------------------------------------------------------\ +| | +| Load Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraLoadFigure | +| | +\------------------------------------------------------------*/ + +void XgraLoadFigure( FileName ) + + char *FileName; +{ + autbegin(); + + XgraFigureGra = Xgragetgrafig( FileName ); + + if ( XgraFigureGra != (autgraph *)NULL ) + { + XgraAddFigure(); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Del Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraDelFigure | +| | +\------------------------------------------------------------*/ + +void XgraDelFigure() +{ + xgraobj_list *ScanObject; + xgraobj_list *DelObject; + short Layer; + + if ( XgraFigure == (xautgraph *)NULL ) return; + + autbegin(); + + for ( Layer = 0; Layer < XGRA_MAX_LAYER; Layer++ ) + { + ScanObject = XgraFigure->OBJECT[ Layer ]; + + while ( ScanObject != (xgraobj_list *)NULL ) + { + DelObject = ScanObject; + ScanObject = ScanObject->NEXT; + + XgraFreeObject( DelObject ); + } + + ScanObject = XgraFigure->TEXT[ Layer ]; + + while ( ScanObject != (xgraobj_list *)NULL ) + { + DelObject = ScanObject; + ScanObject = ScanObject->NEXT; + + XgraFreeObject( DelObject ); + } + } + + XgraFreeFigure( XgraFigure ); + + destroyautgraph( XgraFigureGra ); + + XgraFigure = (xautgraph *)NULL; + XgraFigureGra = (autgraph *)NULL; + + autend(); +} diff --git a/alliance/src/xgra/src/XGR_object.h b/alliance/src/xgra/src/XGR_object.h new file mode 100644 index 00000000..c0872c06 --- /dev/null +++ b/alliance/src/xgra/src/XGR_object.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 : XGRA | +| | +| File : Object.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGR_OBJECT_H +# define XGR_OBJECT_H + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XGR_place.c b/alliance/src/xgra/src/XGR_place.c new file mode 100644 index 00000000..e1619d19 --- /dev/null +++ b/alliance/src/xgra/src/XGR_place.c @@ -0,0 +1,141 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Place.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XGR_place.h" +# include "XGR_graph.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static xgrapoint *XgraPointArray = (xgrapoint *)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraPlaceFigure | +| | +\------------------------------------------------------------*/ + +void XgraPlaceFigure() +{ + autnode_list *ScanNode; + autnode_list *NodeTo; + autnode_list *NodeFrom; + autarc_list *ScanArc; + chain_list *ScanChain; + int NumberNode; + int PointIndex; + float X; + float Y; + float VectorX; + float VectorY; + float Alpha; + float CosAlpha; + float SinAlpha; + + autbegin(); + + if ( XgraPointArray != (xgrapoint *)NULL ) + { + autfreeblock( (char *)XgraPointArray ); + XgraPointArray = (xgrapoint *)NULL; + } + + NumberNode = XgraFigureGra->NUMBER_NODE; + XgraPointArray = (xgrapoint *)autallocblock( sizeof( xgrapoint ) * NumberNode ); + + Alpha = ( M_PI * 2.0 ) / (float)( NumberNode ); + CosAlpha = cos( Alpha ); + SinAlpha = sin( Alpha ); + + VectorX = (float)( NumberNode << 1 ); + VectorY = 0.0; + + PointIndex = 0; + + for ( ScanNode = XgraFigureGra->NODE; + ScanNode != (autnode_list *)NULL; + ScanNode = ScanNode->NEXT ) + { + X = VectorX; + Y = VectorY; + + ScanNode->USER = (void *)( &XgraPointArray[ PointIndex ] ); + + XgraPointArray[ PointIndex ].X = (long)X; + XgraPointArray[ PointIndex++ ].Y = (long)Y; + + VectorX = ( X * CosAlpha ) - ( Y * SinAlpha ); + VectorY = ( X * SinAlpha ) + ( Y * CosAlpha ); + } + + autend(); +} diff --git a/alliance/src/xgra/src/XGR_place.h b/alliance/src/xgra/src/XGR_place.h new file mode 100644 index 00000000..0bcf8dad --- /dev/null +++ b/alliance/src/xgra/src/XGR_place.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 : XGRA | +| | +| File : Place.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGR_PLACE_H +# define XGR_PLACE_H + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Mask | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Macro | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraPlaceFigure(); + +# endif diff --git a/alliance/src/xgra/src/XGR_select.c b/alliance/src/xgra/src/XGR_select.c new file mode 100644 index 00000000..74a048ee --- /dev/null +++ b/alliance/src/xgra/src/XGR_select.c @@ -0,0 +1,422 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Select.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XGR_select.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + xgraselect_list *XgraHeadSelect = (xgraselect_list *)NULL; + xgraselect_list *XgraHeadConnect = (xgraselect_list *)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Alloc Functions | +| | +\------------------------------------------------------------*/ + +xgraselect_list *XgraAllocSelect() +{ + return( (xgraselect_list *)autallocheap( sizeof( xgraselect_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Free Functions | +| | +\------------------------------------------------------------*/ + +void XgraFreeSelect( Select ) + + xgraselect_list *Select; +{ + autfreeheap( Select, sizeof( xgraselect_list ) ); +} + +/*------------------------------------------------------------\ +| | +| Select Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraSelectObject | +| | +\------------------------------------------------------------*/ + +void XgraSelectObject( Object ) + + xgraobj_list *Object; +{ + xgraobj_list *Scan; + + autbegin(); + + Scan = Object; + + do + { + SetXgraSelect( Scan ); + + Scan = Scan->LINK; + } + while ( Scan != Object ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraUnselectObject | +| | +\------------------------------------------------------------*/ + +void XgraUnselectObject( Object ) + + xgraobj_list *Object; +{ + xgraobj_list *Scan; + + autbegin(); + + Scan = Object; + + do + { + ClearXgraSelect( Scan ); + + Scan = Scan->LINK; + } + while ( Scan != Object ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraAcceptObject | +| | +\------------------------------------------------------------*/ + +void XgraAcceptObject( Object ) + + xgraobj_list *Object; +{ + xgraobj_list *Scan; + + autbegin(); + + Scan = Object; + + do + { + SetXgraAccept( Scan ); + + Scan = Scan->LINK; + } + while ( Scan != Object ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraRejectObject | +| | +\------------------------------------------------------------*/ + +void XgraRejectObject( Object ) + + xgraobj_list *Object; +{ + xgraobj_list *Scan; + + autbegin(); + + Scan = Object; + + do + { + ClearXgraAccept( Scan ); + + Scan = Scan->LINK; + } + while ( Scan != Object ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraConnectObject | +| | +\------------------------------------------------------------*/ + +void XgraConnectObject( Object ) + + xgraobj_list *Object; +{ + xgraobj_list *Scan; + + autbegin(); + + Scan = Object; + + do + { + SetXgraConnect( Scan ); + + Scan = Scan->LINK; + } + while ( Scan != Object ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDisconnectObject | +| | +\------------------------------------------------------------*/ + +void XgraDisconnectObject( Object ) + + xgraobj_list *Object; +{ + xgraobj_list *Scan; + + autbegin(); + + Scan = Object; + + do + { + ClearXgraConnect( Scan ); + + Scan = Scan->LINK; + } + while ( Scan != Object ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Add Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraAddSelect | +| | +\------------------------------------------------------------*/ + +void XgraAddSelect( Object ) + + xgraobj_list *Object; +{ + xgraselect_list *Select; + + autbegin(); + + Select = XgraAllocSelect(); + Select->NEXT = XgraHeadSelect; + Select->OBJECT = Object; + XgraHeadSelect = Select; + + XgraSelectObject( Object ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraAddConnect | +| | +\------------------------------------------------------------*/ + +void XgraAddConnect( Object ) + + xgraobj_list *Object; +{ + xgraselect_list *Connect; + + autbegin(); + + Connect = XgraAllocSelect(); + Connect->NEXT = XgraHeadConnect; + Connect->OBJECT = Object; + XgraHeadConnect = Connect; + + XgraConnectObject( Object ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Del Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraDelSelect | +| | +\------------------------------------------------------------*/ + +void XgraDelSelect() +{ + xgraselect_list *Select; + xgraselect_list *DelSelect; + + autbegin(); + + Select = XgraHeadSelect; + XgraHeadSelect = (xgraselect_list *)NULL; + + while ( Select != (xgraselect_list *)NULL ) + { + XgraRejectObject( Select->OBJECT ); + + DelSelect = Select; + Select = Select->NEXT; + + XgraFreeSelect( DelSelect ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraPurgeSelect | +| | +\------------------------------------------------------------*/ + +void XgraPurgeSelect() +{ + xgraselect_list *DelSelect; + xgraselect_list *Select; + xgraselect_list **Previous; + + autbegin(); + + Previous = &XgraHeadSelect; + Select = XgraHeadSelect; + + while( Select != (xgraselect_list *)NULL ) + { + if ( ! IsXgraAccept( Select->OBJECT ) ) + { + DelSelect = Select; + Select = Select->NEXT; + *Previous = Select; + + XgraFreeSelect( DelSelect ); + } + else + { + Previous = &Select->NEXT; + Select = Select->NEXT; + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDelConnect | +| | +\------------------------------------------------------------*/ + +void XgraDelConnect() +{ + xgraselect_list *Connect; + xgraselect_list *DelConnect; + + autbegin(); + + Connect = XgraHeadConnect; + XgraHeadConnect = (xgraselect_list *)NULL; + + while ( Connect != (xgraselect_list *)NULL ) + { + XgraDisconnectObject( Connect->OBJECT ); + + DelConnect = Connect; + Connect = Connect->NEXT; + + XgraFreeSelect( DelConnect ); + } + + autend(); +} diff --git a/alliance/src/xgra/src/XGR_select.h b/alliance/src/xgra/src/XGR_select.h new file mode 100644 index 00000000..3876586f --- /dev/null +++ b/alliance/src/xgra/src/XGR_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 : XGRA | +| | +| File : Select.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGR_SELECT_H +# define XGR_SELECT_H + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XME.h b/alliance/src/xgra/src/XME.h new file mode 100644 index 00000000..4270b53b --- /dev/null +++ b/alliance/src/xgra/src/XME.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 : XGRA | +| | +| File : XME.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XME +# define XGRA_XME + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern XgraMenuItem XgraEditMenu[]; + + extern XgraPanelItem XgraEditSearchViewPanel; + extern XgraPanelItem XgraEditSelectPanel; + extern XgraPanelItem XgraEditIdentifyPanel; + + extern int XgraEditSearchViewDefaultValues[ 5 ]; + extern int XgraEditIdentifyDefaultValues[ 5 ]; + extern int XgraEditSelectDefaultValues[ 5 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraBuildEditDialog(); + + extern void XgraEditSearch(); + extern void XgraEditIdentify(); + extern void XgraEditConnected(); + extern void XgraEditUnselectAll(); + + extern void XgraDisplayEditIdentify(); + +# endif diff --git a/alliance/src/xgra/src/XME_dialog.c b/alliance/src/xgra/src/XME_dialog.c new file mode 100644 index 00000000..685dc5c9 --- /dev/null +++ b/alliance/src/xgra/src/XME_dialog.c @@ -0,0 +1,182 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XTB.h" +# include "XME.h" + +# include "XME_dialog.h" +# include "XME_edit.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Search Dialog | +| | +\------------------------------------------------------------*/ + + XgraDialogItem XgraSearchObjectDialog = + + { + "Object name", + XGRA_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackSearchObjectOk, + (XtPointer)NULL, + (void *)CallbackSearchObjectCancel, + (XtPointer)NULL + }; + + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraBuildEditDialog | +| | +\------------------------------------------------------------*/ + +void XgraBuildEditDialog() + +{ + autbegin(); + + XgraBuildDialog( XgraMainWindow, &XgraSearchObjectDialog ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Search Callback | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback For Object | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackSearchObjectOk | +| | +\------------------------------------------------------------*/ + +void CallbackSearchObjectOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *NameSet; + + autbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &NameSet ); + + XtUnmanageChild( XgraSearchObjectDialog.WIDGET ); + + XgraExitDialog(); + + NameSet = XgraPostTreatString( NameSet ); + + if ( NameSet != (char *)NULL ) + { + NameSet = namealloc( NameSet ); + + XgraEditSearchObject( NameSet ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackSearchObjectCancel | +| | +\------------------------------------------------------------*/ + +void CallbackSearchObjectCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + autbegin(); + + XtUnmanageChild( XgraSearchObjectDialog.WIDGET ); + + XgraExitDialog(); + + autend(); +} diff --git a/alliance/src/xgra/src/XME_dialog.h b/alliance/src/xgra/src/XME_dialog.h new file mode 100644 index 00000000..6dc6fb65 --- /dev/null +++ b/alliance/src/xgra/src/XME_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 : XGRA | +| | +| File : Dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_EDIT_DIALOG +# define XGRA_EDIT_DIALOG + + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern XgraDialogItem XgraSearchObjectDialog; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackSearchObjectOk(); + extern void CallbackSearchObjectCancel(); + +# endif diff --git a/alliance/src/xgra/src/XME_edit.c b/alliance/src/xgra/src/XME_edit.c new file mode 100644 index 00000000..c0f80ed3 --- /dev/null +++ b/alliance/src/xgra/src/XME_edit.c @@ -0,0 +1,257 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Edit.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" +# include "XGR.h" +# include "XMV.h" +# include "XME.h" + +# include "XME_edit.h" +# include "XME_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Identify Buffer | +| | +\------------------------------------------------------------*/ + + static char XgraIdentifyMessage[ XGRA_IDENTIFY_MESSAGE_SIZE ]; + static char XgraIdentifyBuffer [ XGRA_IDENTIFY_BUFFER_SIZE ]; + static char XgraIdentifyLocout [ XGRA_IDENTIFY_LOCOUT_SIZE ]; + + static char *XgraScanIdentify; + static long XgraIdentifyLength; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraAddIdentify | +| | +\------------------------------------------------------------*/ + +short XgraAddIdentify( Obj ) + + xgraobj_list *Obj; +{ + autnode_list *Node; + autarc_list *Arc; + char *ScanString; + long Length; + + autbegin(); + + XgraIdentifyBuffer[0] = '\0'; + + if ( IsXgraNode( Obj ) ) + { + Node = (autnode_list *)( Obj->USER ); + + sprintf( XgraIdentifyBuffer, "NODE :\n\n NAME : %s\n FLAGS : %ld\n\n", + Node->NAME, Node->FLAGS ); + } + else + if ( IsXgraArc( Obj ) ) + { + Arc = (autarc_list *)( Obj->USER ); + + sprintf( XgraIdentifyBuffer, + "ARC :\n\n FROM : %s TO : %s\n FLAGS : %ld\n\n", + Arc->NODE_FROM->NAME, Arc->NODE_TO->NAME, Arc->FLAGS ); + } + + Length = strlen( XgraIdentifyBuffer ); + + if ( ( XgraIdentifyLength + Length ) < ( XGRA_IDENTIFY_MESSAGE_SIZE - 1 ) ) + { + strcpy( XgraScanIdentify, XgraIdentifyBuffer ); + + XgraScanIdentify += Length; + XgraIdentifyLength += Length; + + autend(); + return( XGRA_TRUE ); + } + + strcpy( XgraScanIdentify, "#" ); + + autend(); + return( XGRA_FALSE ); +} + +/*------------------------------------------------------------\ +| | +| XgraEditIdentify | +| | +\------------------------------------------------------------*/ + +void XgraEditIdentify( X1, Y1 ) + + long X1; + long Y1; +{ + xgraselect_list *Select; + xgraobj_list *Obj; + + strcpy( XgraIdentifyMessage, "No element found !" ); + + XgraScanIdentify = XgraIdentifyMessage; + XgraIdentifyLength = 0; + + XgraEditSelectPoint( X1, Y1 ); + + for ( Select = XgraHeadSelect; + Select != (xgraselect_list *)NULL; + Select = Select->NEXT ) + { + if ( ! XgraAddIdentify( Select->OBJECT ) ) break; + } + + XgraDelSelect(); + + XgraDisplayEditIdentify( XgraIdentifyMessage ); + XgraEnterPanel( &XgraEditIdentifyPanel ); +} + +/*------------------------------------------------------------\ +| | +| XgraEditConnected | +| | +\------------------------------------------------------------*/ + +void XgraEditConnected( X1, Y1 ) + + long X1; + long Y1; +{ + xgraselect_list *Select; + xgraselect_list **PrevSelect; + xgraobj_list *Obj; + + if ( XgraHeadConnect != (xgraselect_list *)NULL ) + { + XgraDelConnect(); + XgraZoomRefresh(); + } + + XgraEditSelectPoint( X1, Y1 ); + + XgraDisplaySelectList( (char *)NULL ); + + for ( Select = XgraHeadSelect; + Select != (xgraselect_list *)NULL; + Select = Select->NEXT ) + { + XgraAddSelectList( Select->OBJECT ); + } + + if ( XgraHeadSelect == (xgraselect_list *)NULL ) + { + XgraWarningMessage( XgraMainWindow, "No element found !" ); + } + else + { + if ( XgraHeadSelect->NEXT != (xgraselect_list *)NULL ) + { + XgraEnterPanel( &XgraEditSelectPanel ); + XgraLimitedLoop( XgraEditSelectPanel.PANEL ); + } + else + { + XgraAcceptObject( XgraHeadSelect->OBJECT ); + XgraDisplayObject( XgraHeadSelect->OBJECT ); + } + } + + XgraPurgeSelect(); + + for ( Select = XgraHeadSelect; + Select != (xgraselect_list *)NULL; + Select = Select->NEXT ) + { + XgraAddConnect( Select->OBJECT ); + } + + if ( XgraHeadSelect != (xgraselect_list *)NULL ) + { + if ( XgraHeadSelect->NEXT == (xgraselect_list *)NULL ) + { + Obj = XgraHeadSelect->OBJECT; + XgraDelSelect(); + XgraDisplayObject( Obj ); + } + else + { + XgraDelSelect(); + XgraZoomRefresh(); + } + } +} diff --git a/alliance/src/xgra/src/XME_edit.h b/alliance/src/xgra/src/XME_edit.h new file mode 100644 index 00000000..2ab0dd90 --- /dev/null +++ b/alliance/src/xgra/src/XME_edit.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 : XGRA | +| | +| File : Edit.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_EDIT +# define XGRA_EDIT + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_IDENTIFY_BUFFER_SIZE 64000 +# define XGRA_IDENTIFY_LOCOUT_SIZE 64000 +# define XGRA_IDENTIFY_MESSAGE_SIZE 64000 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XME_menu.c b/alliance/src/xgra/src/XME_menu.c new file mode 100644 index 00000000..76377099 --- /dev/null +++ b/alliance/src/xgra/src/XME_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 : XGRA | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMV.h" +# include "XME.h" +# include "XMX.h" + +# include "XME_menu.h" +# include "XME_dialog.h" +# include "XME_edit.h" +# include "XME_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + XgraMenuItem XgraEditMenu[] = + + { + { + "Identify", + 'I', + "CtrlI", + "Ctrl I", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditIdentify, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + { + "Connected", + 'C', + "CtrlC", + "Ctrl C", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditConnected, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + { + "Search ", + 'S', + "CtrlS", + "Ctrl S", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackEditSearch, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackEditIdentify | +| | +\------------------------------------------------------------*/ + +void CallbackEditIdentify( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraChangeEditMode( XGRA_EDIT_IDENTIFY, + XgraPromptEditIdentify ); + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditConnected | +| | +\------------------------------------------------------------*/ + +void CallbackEditConnected( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraChangeEditMode( XGRA_EDIT_CONNECTED, + XgraPromptEditConnected ); + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditSearch | +| | +\------------------------------------------------------------*/ + +void CallbackEditSearch( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterDialog( &XgraSearchObjectDialog ); + + autend(); +} diff --git a/alliance/src/xgra/src/XME_menu.h b/alliance/src/xgra/src/XME_menu.h new file mode 100644 index 00000000..d9f2c9c0 --- /dev/null +++ b/alliance/src/xgra/src/XME_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 : XGRA | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_MENU +# define XGRA_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackEditIdentify(); + extern void CallbackEditConnected(); + extern void CallbackEditSearch(); + +# endif diff --git a/alliance/src/xgra/src/XME_message.c b/alliance/src/xgra/src/XME_message.c new file mode 100644 index 00000000..def648c8 --- /dev/null +++ b/alliance/src/xgra/src/XME_message.c @@ -0,0 +1,113 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Message.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XTB.h" +# include "XME.h" +# include "XME_edit.h" +# include "XME_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraPromptEditIdentify | +| | +\------------------------------------------------------------*/ + +void XgraPromptEditIdentify() + +{ + autbegin(); + + XgraDisplayMessage( XGRA_MESSAGE_MODE , "Identify" ); + XgraDisplayMessage( XGRA_MESSAGE_INFO , "Select object" ); + XgraDisplayMessage( XGRA_MESSAGE_PROMPT, "Enter select point" ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraPromptEditConnected | +| | +\------------------------------------------------------------*/ + +void XgraPromptEditConnected() + +{ + autbegin(); + + XgraDisplayMessage( XGRA_MESSAGE_MODE , "Connected" ); + XgraDisplayMessage( XGRA_MESSAGE_INFO , "Select object" ); + XgraDisplayMessage( XGRA_MESSAGE_PROMPT, "Enter select point" ); + + autend(); +} diff --git a/alliance/src/xgra/src/XME_message.h b/alliance/src/xgra/src/XME_message.h new file mode 100644 index 00000000..70170783 --- /dev/null +++ b/alliance/src/xgra/src/XME_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 : XGRA | +| | +| File : Message.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_MESSAGE +# define XGRA_MESSAGE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraPromptEditIdentify(); + extern void XgraPromptEditConnected(); + +# endif diff --git a/alliance/src/xgra/src/XME_panel.c b/alliance/src/xgra/src/XME_panel.c new file mode 100644 index 00000000..76eb8059 --- /dev/null +++ b/alliance/src/xgra/src/XME_panel.c @@ -0,0 +1,493 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XTB.h" +# include "XME.h" + +# include "XME_panel.h" +# include "XME_message.h" +# include "XME_dialog.h" +# include "XME_edit.h" +# include "XME_search.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Search View Panel | +| | +\------------------------------------------------------------*/ + + static char *XgraEditSearchViewButtonName[] = + + { + "Continue", + "Abort" + }; + + static XgraPanelButtonItem XgraEditSearchViewButton[] = + + { + { + &XgraEditSearchViewButtonName[0], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackEditSearchViewContinue, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraEditSearchViewButtonName[1], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 1, + 1, 1, + CallbackEditSearchViewAbort, + (XtPointer)NULL, + (Widget)NULL + } + , + NULL + }; + + XgraPanelItem XgraEditSearchViewPanel = + + { + "View search", + 1, + 0, + XGRA_EDIT_VIEW_SEARCH_X, + XGRA_EDIT_VIEW_SEARCH_Y, + 100, + 50, + 1, + 2, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + XgraEditSearchViewButton + }; + + int XgraEditSearchViewDefaultValues[ 5 ] = + + { + XGRA_EDIT_VIEW_SEARCH_X, + XGRA_EDIT_VIEW_SEARCH_Y, + 100, 50, 0 + }; + +/*------------------------------------------------------------\ +| | +| Panel Identify | +| | +\------------------------------------------------------------*/ + + static char *XgraPanelIdentifyButtonName[] = + + { + "Text", + "Close" + }; + + XgraPanelButtonItem XgraEditIdentifyButton[] = + + { + { + &XgraPanelIdentifyButtonName[0], + "Nothing", NULL, 0, 0, + NULL, + NULL, + 0, 0, + 8, 9, + NULL, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelIdentifyButtonName[1], + NULL, NULL, 0, 0, + NULL, + NULL, + 3, 9, + 2, 1, + CallbackEditCloseIdentify, + (XtPointer)NULL, + (Widget)NULL + } + , + NULL + }; + + XgraPanelItem XgraEditIdentifyPanel = + + { + "Identify", + 1, + 0, + XGRA_EDIT_IDENTIFY_X, + XGRA_EDIT_IDENTIFY_Y, + 360, + 250, + 8, + 10, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + XgraEditIdentifyButton + }; + + int XgraEditIdentifyDefaultValues[ 5 ] = + + { + XGRA_EDIT_IDENTIFY_X, + XGRA_EDIT_IDENTIFY_Y, + 360, 250, 0 + }; + +/*------------------------------------------------------------\ +| | +| Select Panel | +| | +\------------------------------------------------------------*/ + + static char *XgraEditSelectButtonName[] = + + { + "Select", + "Accept", + "Cancel" + }; + + XgraPanelButtonItem XgraEditSelectButton[] = + + { + { + &XgraEditSelectButtonName[0], + "List", + "List", 0, 0, + NULL, + NULL, + 0, 0, + 8, 9, + CallbackEditSelectList, + (XtPointer)1, + (Widget)NULL + } + , + { + &XgraEditSelectButtonName[1], + NULL, NULL, 0, 0, + NULL, + NULL, + 1, 9, + 2, 1, + CallbackEditSelectAccept, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraEditSelectButtonName[2], + NULL, NULL, 0, 0, + NULL, + NULL, + 5, 9, + 2, 1, + CallbackEditSelectCancel, + (XtPointer)NULL, + (Widget)NULL + } + , + NULL + }; + + XgraPanelItem XgraEditSelectPanel = + + { + "Select", + 1, + 0, + XGRA_EDIT_SELECT_X, + XGRA_EDIT_SELECT_Y, + 360, + 250, + 8, + 10, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + XgraEditSelectButton + }; + + int XgraEditSelectDefaultValues[ 5 ] = + + { + XGRA_EDIT_SELECT_X, + XGRA_EDIT_SELECT_Y, + 360, 250, 0 + }; + +/*------------------------------------------------------------\ +| | +| Callback For View Search | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackEditSearchViewContinue | +| | +\------------------------------------------------------------*/ + +void CallbackEditSearchViewContinue( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraExitDialog(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditSearchViewAbort | +| | +\------------------------------------------------------------*/ + +void CallbackEditSearchViewAbort( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraSearchAbort = XGRA_TRUE; + + XgraExitDialog(); + + autbegin(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Identify | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackEditCloseIdentify | +| | +\------------------------------------------------------------*/ + +void CallbackEditCloseIdentify( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraExitPanel( &XgraEditIdentifyPanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDisplayEditIdentify | +| | +\------------------------------------------------------------*/ + +void XgraDisplayEditIdentify( Message ) + + char *Message; +{ + autbegin(); + + XmTextSetString( XgraEditIdentifyButton[0].BUTTON, Message ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Select | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackEditSelectList | +| | +\------------------------------------------------------------*/ + +void CallbackEditSelectList( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmListCallbackStruct *CallData; +{ + autbegin(); + + if ( ClientData == (caddr_t)NULL ) + { + CallbackEditSelectAccept( MyWidget, (caddr_t)NULL, (caddr_t)NULL ); + } + else + { + XgraEditSelectObject( CallData->item_position - 1 ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditSelectAccept | +| | +\------------------------------------------------------------*/ + +void CallbackEditSelectAccept( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraExitPanel( &XgraEditSelectPanel ); + + XgraExitDialog(); + + XgraEditSelectAccept(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEditSelectCancel | +| | +\------------------------------------------------------------*/ + +void CallbackEditSelectCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraExitPanel( &XgraEditSelectPanel ); + + XgraExitDialog(); + + XgraEditSelectCancel(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDisplaySelectList | +| | +\------------------------------------------------------------*/ + +void XgraDisplaySelectList( Message ) + + char *Message; +{ + XmString Label; + + autbegin(); + + if ( Message == (char *)NULL ) + { + XmListDeleteAllItems( XgraEditSelectButton[ 0 ].BUTTON ); + } + else + { + Label = XmStringCreateSimple( Message ); + XmListAddItem( XgraEditSelectButton[ 0 ].BUTTON , Label , NULL ); + XmStringFree( Label ); + } + + autend(); +} diff --git a/alliance/src/xgra/src/XME_panel.h b/alliance/src/xgra/src/XME_panel.h new file mode 100644 index 00000000..a308180a --- /dev/null +++ b/alliance/src/xgra/src/XME_panel.h @@ -0,0 +1,90 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_EDIT_PANEL +# define XGRA_EDIT_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_EDIT_VIEW_SEARCH_X 790 +# define XGRA_EDIT_VIEW_SEARCH_Y 450 + +# define XGRA_EDIT_IDENTIFY_X 330 +# define XGRA_EDIT_IDENTIFY_Y 280 + +# define XGRA_EDIT_SELECT_X 330 +# define XGRA_EDIT_SELECT_Y 280 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackEditSearchViewContinue(); + extern void CallbackEditSearchViewAbort(); + + extern void CallbackEditCloseIdentify(); + + extern void CallbackEditSelectList(); + extern void CallbackEditSelectAccept(); + extern void CallbackEditSelectCancel(); + + extern void XgraDisplaySelectList(); + +# endif diff --git a/alliance/src/xgra/src/XME_search.c b/alliance/src/xgra/src/XME_search.c new file mode 100644 index 00000000..409714e3 --- /dev/null +++ b/alliance/src/xgra/src/XME_search.c @@ -0,0 +1,228 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Search.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" +# include "XGR.h" +# include "XME.h" +# include "XMV.h" + +# include "XME_search.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + char XgraSearchAbort; + int XgraSearchNumber; + char *XgraSearchString; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraEditInitializeSearch | +| | +\------------------------------------------------------------*/ + +void XgraEditInitializeSearch( Name ) + + char *Name; +{ + char *Star; + + autbegin(); + + Star = strrchr( Name, '*' ); + + if ( Star != (char *)NULL ) + { + XgraSearchNumber = (int)(Star - Name); + } + else + { + XgraSearchNumber = 0; + } + + XgraSearchString = Name; + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraEditSearchCompare | +| | +\------------------------------------------------------------*/ + +int XgraEditSearchCompare( Name ) + + char *Name; +{ + if ( Name != (char *)NULL ) + { + if ( XgraSearchNumber ) + { + return( ! strncmp( XgraSearchString, Name, XgraSearchNumber ) ); + } + else + { + return( Name == XgraSearchString ); + } + } + + return( 0 ); +} + +/*------------------------------------------------------------\ +| | +| XgraEditSearchObject | +| | +\------------------------------------------------------------*/ + +void XgraEditSearchObject( ObjectName ) + + char *ObjectName; +{ + xgraobj_list *Obj; + xgraselect_list *Search; + short Layer; + long X1; + long Y1; + + autbegin(); + + if ( XgraHeadConnect != (xgraselect_list *)NULL ) + { + XgraDelConnect(); + XgraZoomRefresh(); + } + + XgraEditInitializeSearch( ObjectName ); + + for ( Layer = 0; Layer < XGRA_MAX_LAYER; Layer++ ) + { + if ( XGRA_ACTIVE_LAYER_TABLE[ Layer ] == 0 ) continue; + + for ( Obj = XgraFigure->TEXT[ Layer ]; + Obj != (xgraobj_list *)NULL; + Obj = Obj->NEXT ) + { + if ( ! IsXgraSelect( Obj ) ) + { + if ( XgraEditSearchCompare( Obj->NAME ) ) + { + XgraAddSelect( Obj ); + } + } + } + } + + for ( Search = XgraHeadSelect; + Search != (xgraselect_list *)NULL; + Search = Search->NEXT ) + { + XgraUnselectObject( Search->OBJECT ); + } + + if ( XgraHeadSelect == (xgraselect_list *)NULL ) + { + XgraWarningMessage( XgraMainWindow, "No object found !" ); + } + else + { + XgraSearchAbort = XGRA_FALSE; + + for ( Search = XgraHeadSelect; + Search != (xgraselect_list *)NULL; + Search = Search->NEXT ) + { + Obj = Search->OBJECT; + + XgraAddConnect( Obj ); + + if ( XgraSearchAbort ) continue; + + X1 = ( Obj->X + ( Obj->DX >> 1 ) ) / XGRA_UNIT; + Y1 = ( Obj->Y + ( Obj->DY >> 1 ) ) / XGRA_UNIT; + + XgraZoomCenter( X1, Y1 ); + + if ( Search->NEXT != (xgraselect_list *)NULL ) + { + XgraEnterPanel( &XgraEditSearchViewPanel ); + XgraLimitedLoop( XgraEditSearchViewPanel.PANEL ); + } + } + + XgraDelSelect(); + + XgraExitPanel( &XgraEditSearchViewPanel ); + } + + autend(); +} diff --git a/alliance/src/xgra/src/XME_search.h b/alliance/src/xgra/src/XME_search.h new file mode 100644 index 00000000..29583f27 --- /dev/null +++ b/alliance/src/xgra/src/XME_search.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 : XGRA | +| | +| File : Search.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_SEARCH +# define XGRA_SEARCH + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char XgraSearchAbort; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraEditSearchObject(); + +# endif diff --git a/alliance/src/xgra/src/XME_select.c b/alliance/src/xgra/src/XME_select.c new file mode 100644 index 00000000..effd34ad --- /dev/null +++ b/alliance/src/xgra/src/XME_select.c @@ -0,0 +1,366 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Edit.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" +# include "XGR.h" +# include "XME.h" +# include "XMV.h" + +# include "XME_select.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Select Buffer | +| | +\------------------------------------------------------------*/ + + static char XgraSelectBuffer [ XGRA_SELECT_BUFFER_SIZE ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraAddSelectList | +| | +\------------------------------------------------------------*/ + +void XgraAddSelectList( Obj ) + + xgraobj_list *Obj; +{ + autnode_list *Node; + autarc_list *Arc; + + autbegin(); + + XgraSelectBuffer[0] = '\0'; + + if ( IsXgraNode( Obj ) ) + { + Node = (autnode_list *)( Obj->USER ); + + sprintf( XgraSelectBuffer, " NODE %s", Node->NAME ); + } + else + if ( IsXgraArc( Obj ) ) + { + Arc = (autarc_list *)( Obj->USER ); + + sprintf( XgraSelectBuffer, " ARC %s -> %s", + Arc->NODE_FROM->NAME, Arc->NODE_TO->NAME ); + } + + XgraDisplaySelectList( XgraSelectBuffer ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraEditSelectObject | +| | +\------------------------------------------------------------*/ + +void XgraEditSelectObject( Number ) + + int Number; +{ + xgraselect_list *Select; + int Counter; + + autbegin(); + + Select = XgraHeadSelect; + + for ( Counter = 0; Counter < Number; Counter++ ) + { + Select = Select->NEXT; + } + + if ( IsXgraAccept( Select->OBJECT ) ) + { + XgraRejectObject( Select->OBJECT ); + } + else + { + XgraAcceptObject( Select->OBJECT ); + } + + XgraDisplayObject( Select->OBJECT ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraEditSelectAccept | +| | +\------------------------------------------------------------*/ + +void XgraEditSelectAccept() +{ + autbegin(); + + XgraPurgeSelect(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraEditSelectCancel | +| | +\------------------------------------------------------------*/ + +void XgraEditSelectCancel() +{ + autbegin(); + + XgraEditUnselectAll(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Select Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraEditUnselectAll | +| | +\------------------------------------------------------------*/ + +void XgraEditUnselectAll() +{ + xgraobj_list *Obj; + + autbegin(); + + if ( XgraHeadSelect != (xgraselect_list *)NULL ) + { + if ( XgraHeadSelect->NEXT == (xgraselect_list *)NULL ) + { + Obj = XgraHeadSelect->OBJECT; + XgraDelSelect(); + XgraDisplayObject( Obj ); + } + else + { + XgraDelSelect(); + XgraZoomRefresh(); + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraEditObjectNearPoint | +| | +\------------------------------------------------------------*/ + +char XgraEditObjectNearPoint( Obj, X1, Y1 ) + + xgraobj_list *Obj; + long X1; + long Y1; +{ + short Type; + long X1r; + long Y1r; + long X2r; + long Y2r; + float VectorX; + float VectorY; + float LineX; + float LineY; + float Norm; + float Distance; + + Type = GetXgraObjectType( Obj ); + + if ( ( Obj->X <= X1 ) && + ( Obj->Y <= Y1 ) && + ( Obj->X + Obj->DX >= X1 ) && + ( Obj->Y + Obj->DY >= Y1 ) ) + { + if ( ( Type == XGRA_OBJECT_LINE ) || + ( Type == XGRA_OBJECT_ARROW ) ) + { + if ( ( Obj->DX == 0 ) && + ( Obj->DY == 0 ) ) + { + if ( ( Obj->X == X1 ) && + ( Obj->Y == Y1 ) ) + { + return( XGRA_TRUE ); + } + } + else + { + if ( IsXgraLineLeft( Obj ) ) + { + X1r = Obj->X + Obj->DX; + X2r = Obj->X; + } + else + { + X1r = Obj->X; + X2r = Obj->X + Obj->DX; + } + + if ( IsXgraLineDown( Obj ) ) + { + Y1r = Obj->Y + Obj->DY; + Y2r = Obj->Y; + } + else + { + Y1r = Obj->Y; + Y2r = Obj->Y + Obj->DY; + } + + LineX = (float)( X2r - X1r ); + LineY = (float)( Y2r - Y1r ); + Norm = sqrt( ( LineX * LineX ) + ( LineY * LineY ) ); + LineX /= Norm; + LineY /= Norm; + + VectorX = (float)( X2r - X1 ); + VectorY = (float)( Y2r - Y1 ); + + Distance = fabs( ( VectorX * LineY ) - ( VectorY * LineX ) ); + + if ( Distance < (float) XGRA_UNIT ) + { + return( XGRA_TRUE ); + } + } + } + else + { + return( XGRA_TRUE ); + } + } + + return( XGRA_FALSE ); +} + +/*------------------------------------------------------------\ +| | +| XgraEditSelectPoint | +| | +\------------------------------------------------------------*/ + +void XgraEditSelectPoint( X1, Y1 ) + + long X1; + long Y1; +{ + xgraobj_list *Obj; + xgraselect_list *Select; + int Layer; + + X1 = X1 * XGRA_UNIT; + Y1 = Y1 * XGRA_UNIT; + + for ( Layer = 0; Layer < XGRA_MAX_LAYER; Layer++ ) + { + if ( XGRA_ACTIVE_LAYER_TABLE[ Layer ] == 0 ) continue; + + for ( Obj = XgraFigure->OBJECT[ Layer ]; + Obj != (xgraobj_list *)NULL; + Obj = Obj->NEXT ) + { + if ( XGRA_ACTIVE_LAYER_TABLE[ Obj->LAYER ] == 0 ) continue; + + if ( ! IsXgraSelect( Obj ) ) + { + if ( XgraEditObjectNearPoint( Obj, X1, Y1 ) ) + { + XgraAddSelect( Obj ); + } + } + } + } + + for ( Select = XgraHeadSelect; + Select != (xgraselect_list *)NULL; + Select = Select->NEXT ) + { + XgraUnselectObject( Select->OBJECT ); + } +} diff --git a/alliance/src/xgra/src/XME_select.h b/alliance/src/xgra/src/XME_select.h new file mode 100644 index 00000000..f72c9c02 --- /dev/null +++ b/alliance/src/xgra/src/XME_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 : XGRA | +| | +| File : Select.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_SELECT +# define XGRA_SELECT + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_SELECT_BUFFER_SIZE 256 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraEditSelectObject(); + +# endif diff --git a/alliance/src/xgra/src/XMF.h b/alliance/src/xgra/src/XMF.h new file mode 100644 index 00000000..717b60be --- /dev/null +++ b/alliance/src/xgra/src/XMF.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 : XGRA | +| | +| File : XMF.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XMF +# define XGRA_XMF + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern XgraMenuItem XgraFileMenu []; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraBuildFileDialog(); + extern void XgraBuildPanelLibrary(); + +# endif diff --git a/alliance/src/xgra/src/XMF_dialog.c b/alliance/src/xgra/src/XMF_dialog.c new file mode 100644 index 00000000..7c457c1c --- /dev/null +++ b/alliance/src/xgra/src/XMF_dialog.c @@ -0,0 +1,235 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XTB.h" +# include "XMF.h" + +# include "XMF_dialog.h" +# include "XMF_file.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| File Dialog | +| | +\------------------------------------------------------------*/ + + XgraDialogItem XgraFileOpenDialog = + + { + "Open File", + XGRA_DIALOG_FILE, + (Widget)NULL, + (void *)CallbackFileOpenOk, + (XtPointer)NULL, + (void *)CallbackFileOpenCancel, + (XtPointer)NULL + }; + + XgraDialogItem XgraFileQuitDialog = + + { + "Do you really want to quit Xgra ?", + XGRA_DIALOG_WARNING, + (Widget)NULL, + (void *)CallbackFileQuitOk, + (XtPointer)NULL, + (void *)CallbackFileQuitCancel, + (XtPointer)NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraBuildFileDialog | +| | +\------------------------------------------------------------*/ + +void XgraBuildFileDialog() + +{ + autbegin(); + + XgraBuildDialog( XgraMainWindow, &XgraFileOpenDialog ); + XgraBuildDialog( XgraMainWindow, &XgraFileQuitDialog ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileQuitOk | +| | +\------------------------------------------------------------*/ + +void CallbackFileQuitOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraExitDialog(); + + XtCloseDisplay( XtDisplay( XtParent( MyWidget ) ) ); + + autend(); + + exit( 0 ); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileQuitCancel | +| | +\------------------------------------------------------------*/ + +void CallbackFileQuitCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraExitDialog(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileOpenOk | +| | +\------------------------------------------------------------*/ + +void CallbackFileOpenOk( MyWidget, ClientData, FileStruct ) + + Widget MyWidget; + caddr_t ClientData; + XmFileSelectionBoxCallbackStruct *FileStruct; +{ + char *FileName; + + autbegin(); + + XtUnmanageChild( XgraFileOpenDialog.WIDGET ); + + XgraExitDialog(); + + if ( FileStruct->value != NULL ) + { + XmStringGetLtoR( FileStruct->value, + XmSTRING_DEFAULT_CHARSET, + &FileName + ); + + FileName = XgraPostTreatString( FileName ); + + if ( FileName != (char *)NULL ) + { + XgraFileOpen( FileName ); + + XgraChangeEditMode( XGRA_EDIT_MEASURE, + XgraPromptEditMeasure ); + } + else + { + XgraErrorMessage( XgraMainWindow, "Unable to load this file !" ); + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileOpenCancel | +| | +\------------------------------------------------------------*/ + +void CallbackFileOpenCancel( MyWidget, ClientData, FileStruct ) + + Widget MyWidget; + caddr_t ClientData; + XmFileSelectionBoxCallbackStruct *FileStruct; +{ + autbegin(); + + XtUnmanageChild( XgraFileOpenDialog.WIDGET ); + + XgraExitDialog(); + + autend(); +} diff --git a/alliance/src/xgra/src/XMF_dialog.h b/alliance/src/xgra/src/XMF_dialog.h new file mode 100644 index 00000000..949586cc --- /dev/null +++ b/alliance/src/xgra/src/XMF_dialog.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 : XGRA | +| | +| File : Dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_FILE_DIALOG +# define XGRA_FILE_DIALOG + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern XgraDialogItem XgraFileOpenDialog; + extern XgraDialogItem XgraFileQuitDialog; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackFileQuitOk(); + extern void CallbackFileQuitCancel(); + extern void CallbackFileOpenOk(); + extern void CallbackFileOpenCancel(); + +# endif diff --git a/alliance/src/xgra/src/XMF_file.c b/alliance/src/xgra/src/XMF_file.c new file mode 100644 index 00000000..c1cc22af --- /dev/null +++ b/alliance/src/xgra/src/XMF_file.c @@ -0,0 +1,185 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : File.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XMX.h" +# include "XTB.h" +# include "XMF.h" +# include "XME.h" +# include "XMT.h" +# include "XMV.h" + +# include "XMF_file.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + char XgraFileFilter[ 10 ] = "*."; + char XgraFileExtention[ 10 ] = "."; + + char XgraFileBuffer[ 128 ]; + char XgraDirectoryBuffer[ 512 ]; + + char *XGRA_WORK_LIB = (char *)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraFileOpen | +| | +\------------------------------------------------------------*/ + +void XgraFileOpen( FileName ) + + char *FileName; +{ + int Index; + char *SWAP_WORK_LIB = WORK_LIB; + + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + XgraUndisplayCursor(); + + XgraDelConnect(); + XgraDelFigure(); + + XgraRecomputeBound = XGRA_TRUE; + + if ( XGRA_WORK_LIB == (char *)NULL ) + { + XGRA_WORK_LIB = WORK_LIB; + } + + if ( XgraFileFilter[2] == '\0' ) + { + strcat( XgraFileFilter, "gr" ); + strcat( XgraFileExtention, "gr" ); + } + + for ( Index = strlen( FileName ); Index >= 0; Index-- ) + { + if ( FileName[ Index ] == '/' ) break; + } + + if ( Index >= 0 ) + { + strcpy( XgraDirectoryBuffer, FileName ); + strcpy( XgraFileBuffer, FileName + Index + 1); + + XgraDirectoryBuffer[ Index + 1 ] = '\0'; + + WORK_LIB = XgraDirectoryBuffer; + } + else + { + strcpy( XgraFileBuffer, FileName ); + + WORK_LIB = XGRA_WORK_LIB; + } + + Index = strlen( XgraFileBuffer ) - strlen( XgraFileExtention ); + + if ( Index >= 0 ) + { + if ( ! strcmp( XgraFileBuffer + Index, XgraFileExtention ) ) + { + XgraFileBuffer[ Index ] = '\0'; + } + } + + XgraLoadFigure( XgraFileBuffer ); + + if ( XgraFigure != (xautgraph *)NULL ) + { + XgraChangeTopLevelTitle( XgraFileBuffer ); + } + else + { + XgraChangeTopLevelTitle( (char *)NULL ); + } + + XgraDisplayToolsMessage(); + + XgraInitializeZoom(); + XgraDisplayFigure( 0, 0, XgraGraphicDx, XgraGraphicDy ); + + XgraRefreshGraphicWindow( 0, 0, + XgraGraphicDx, XgraGraphicDy ); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + XgraDisplayCursor(); + + WORK_LIB = SWAP_WORK_LIB; + + autend(); +} diff --git a/alliance/src/xgra/src/XMF_file.h b/alliance/src/xgra/src/XMF_file.h new file mode 100644 index 00000000..96890b5c --- /dev/null +++ b/alliance/src/xgra/src/XMF_file.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 : XGRA | +| | +| File : File.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_FILE +# define XGRA_FILE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char XgraFileFilter[ 10 ]; + extern char XgraFileExtention[ 10 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraFileOpen(); + +# endif diff --git a/alliance/src/xgra/src/XMF_menu.c b/alliance/src/xgra/src/XMF_menu.c new file mode 100644 index 00000000..1f68ec29 --- /dev/null +++ b/alliance/src/xgra/src/XMF_menu.c @@ -0,0 +1,187 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XMX.h" +# include "XTB.h" +# include "XMF.h" + +# include "XMF_menu.h" +# include "XMF_dialog.h" +# include "XMF_file.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static XgraFirstFileOpen = 1; + +/*------------------------------------------------------------\ +| | +| Menu | +| | +\------------------------------------------------------------*/ + + XgraMenuItem XgraFileMenu[] = + + { + { + "Open", + 'O', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackFileOpen, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + { + "Quit ", + 'Q', + "CtrlQ", + "Ctrl Q", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackFileQuit, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackFileOpen | +| | +\------------------------------------------------------------*/ + +void CallbackFileOpen( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + XmString Filter; + + autbegin(); + + if ( XgraFirstFileOpen ) + { + XgraFirstFileOpen = 0; + + if ( XgraFileFilter[2] == '\0' ) + { + strcat( XgraFileFilter, "gr" ); + strcat( XgraFileExtention, "gr" ); + } + + Filter = XmStringCreateSimple( XgraFileFilter ); + + XtVaSetValues( XgraFileOpenDialog.WIDGET, + XmNpattern, Filter, NULL); + + XmStringFree( Filter ); + } + + XgraEnterDialog( &XgraFileOpenDialog ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackFileQuit | +| | +\------------------------------------------------------------*/ + +void CallbackFileQuit( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterDialog( &XgraFileQuitDialog ); + + autend(); +} diff --git a/alliance/src/xgra/src/XMF_menu.h b/alliance/src/xgra/src/XMF_menu.h new file mode 100644 index 00000000..0b509722 --- /dev/null +++ b/alliance/src/xgra/src/XMF_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 : XGRA | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_FILE_MENU +# define XGRA_FILE_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackFileOpen(); + extern void CallbackFileQuit(); + +# endif diff --git a/alliance/src/xgra/src/XMF_panel.c b/alliance/src/xgra/src/XMF_panel.c new file mode 100644 index 00000000..87cef184 --- /dev/null +++ b/alliance/src/xgra/src/XMF_panel.c @@ -0,0 +1,822 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XTB.h" +# include "XMF.h" + +# include "XMF_panel.h" +# include "XMF_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + XgraPanelItem XgraLibraryPanel = + + { + "Library", + 1, + 0, + XGRA_LIBRARY_X, + XGRA_LIBRARY_Y, + 250, + 375, + 0, + 0, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraPanelButtonItem *)NULL + }; + + int XgraLibraryDefaultValues[ 5 ] = + + { + XGRA_LIBRARY_X, + XGRA_LIBRARY_Y, + 250, 375, 0 + }; + + static char **XGRA_CATA_LIB = (char **)NULL; + static char *XGRA_WORK_LIB = (char *)NULL; + static char *XGRA_DEFAULT_LIB = (char *)NULL; + + static char XgraFirstLibrary = 1; + +/*------------------------------------------------------------\ +| | +| Buffer | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Widget For Library Panel | +| | +\------------------------------------------------------------*/ + + Widget XgraLibraryListLabel; + Widget XgraLibraryList; + + Widget XgraLibraryButtonOk; + Widget XgraLibraryButtonUpdate; + Widget XgraLibraryButtonCancel; + + Widget XgraLibraryCataLabel; + Widget XgraLibraryCata; + + Widget XgraLibraryWorkLabel; + Widget XgraLibraryWork; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraIsDirectory | +| | +\------------------------------------------------------------*/ + +char XgraIsDirectory( FileName ) + + char *FileName; +{ + struct stat Buffer; + + autbegin(); + + if ( stat( FileName, &Buffer ) != -1 ) + { + if ( ( Buffer.st_mode & S_IFMT ) == S_IFDIR ) + { + autend(); + return( 1 ); + } + } + + autend(); + return( 0 ); +} + +/*------------------------------------------------------------\ +| | +| XgraSetLibraryList | +| | +\------------------------------------------------------------*/ + +void XgraSetLibraryList() +{ + int Index; + XmString Label; + + autbegin(); + + XmListDeleteAllItems( XgraLibraryList ); + + for ( Index = 0; + XGRA_CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + Label = XmStringCreateSimple( XGRA_CATA_LIB[ Index ] ); + XmListAddItem( XgraLibraryList , Label , NULL ); + XmStringFree( Label ); + } + + Label = XmStringCreateSimple( XGRA_WORK_LIB ); + XmListAddItem( XgraLibraryList , Label , NULL ); + XmStringFree( Label ); + + XGRA_DEFAULT_LIB = (char *)NULL; + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraSetWorkLibrary | +| | +\------------------------------------------------------------*/ + +void XgraSetWorkLibrary() +{ + autbegin(); + + XmTextSetString( XgraLibraryWork, XGRA_WORK_LIB ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraSetCataLibrary | +| | +\------------------------------------------------------------*/ + +void XgraSetCataLibrary() +{ + int Index; + long Length; + char *Buffer; + char *Scan; + + autbegin(); + + for ( Index = 0, Length = 0; + XGRA_CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + Length = Length + strlen( XGRA_CATA_LIB[ Index ] ) + 1; + } + + Buffer = (char *)autallocblock( Length + 1 ); + Buffer[ 0 ] = '\0'; + Scan = Buffer; + + for ( Index = 0; + XGRA_CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + strcpy( Scan, XGRA_CATA_LIB[ Index ] ); + strcat( Scan, "\n" ); + + Scan = Scan + strlen( Scan ); + } + + XmTextSetString( XgraLibraryCata, Buffer ); + + autfreeblock( Buffer ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraInitializeLibrary | +| | +\------------------------------------------------------------*/ + +void XgraInitializeLibrary() +{ + int Index; + + autbegin(); + + for ( Index = 0; CATA_LIB[ Index ] != (char *)NULL; Index++ ); + + XGRA_CATA_LIB = (char **)autallocblock( sizeof(char *) * ( Index + 1 )); + + for ( Index = 0; + CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + XGRA_CATA_LIB[ Index ] = autallocblock( strlen( CATA_LIB[ Index ] ) + 1 ); + strcpy( XGRA_CATA_LIB[ Index ], CATA_LIB[ Index ] ); + } + + XGRA_CATA_LIB[ Index ] = (char *)NULL; + + XGRA_WORK_LIB = autallocblock( strlen( WORK_LIB ) + 1 ); + strcpy( XGRA_WORK_LIB, WORK_LIB ); + + XgraSetCataLibrary(); + XgraSetWorkLibrary(); + XgraSetLibraryList(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraGetCataLibrary | +| | +\------------------------------------------------------------*/ + + void XgraGetCataLibrary() + { + char *NewCata; + char *Scan; + int Index; + int Count; + int Length; + + autbegin(); + + for ( Index = 0; + XGRA_CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + autfreeblock( XGRA_CATA_LIB[ Index ] ); + } + + autfreeblock( XGRA_CATA_LIB ); + + NewCata = XmTextGetString( XgraLibraryCata ); + + Count = 1; + + for ( Index = 0; NewCata[ Index ] != '\0'; Index++ ) + { + if ( NewCata[ Index ] == '\n' ) + { + Count = Count + 1; + } + } + + XGRA_CATA_LIB = (char **)autallocblock( 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 ) && + ( XgraIsDirectory( Scan ) ) ) + { + XGRA_CATA_LIB[ Count ] = autallocblock( Length + 1 ); + strcpy( XGRA_CATA_LIB[ Count ], Scan ); + Count = Count + 1; + } + + Scan = NewCata + Index + 1; + } + else + if ( NewCata[ Index ] == ' ' ) + { + NewCata[ Index ] = '\0'; + } + } + + Length = strlen( Scan ); + + if ( Length > 0 ) + { + XGRA_CATA_LIB[ Count ] = autallocblock( Length + 1 ); + strcpy( XGRA_CATA_LIB[ Count ], Scan ); + Count = Count + 1; + } + + XGRA_CATA_LIB[ Count ] = (char *)NULL; + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraGetWorkLibrary | +| | +\------------------------------------------------------------*/ + +void XgraGetWorkLibrary() +{ + char *NewWork; + + autbegin(); + + autfreeblock( XGRA_WORK_LIB ); + + NewWork = XmTextGetString( XgraLibraryWork ); + + if ( XgraIsDirectory( NewWork ) ) + { + XGRA_WORK_LIB = autallocblock( strlen( NewWork ) + 1 ); + strcpy( XGRA_WORK_LIB, NewWork ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLibraryList | +| | +\------------------------------------------------------------*/ + +void CallbackLibraryList( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmListCallbackStruct *CallData; +{ + autbegin(); + + XGRA_DEFAULT_LIB = XGRA_CATA_LIB[ CallData->item_position - 1 ]; + + if ( XGRA_DEFAULT_LIB == (char *)NULL ) + { + XGRA_DEFAULT_LIB = XGRA_WORK_LIB; + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLibraryOk | +| | +\------------------------------------------------------------*/ + +void CallbackLibraryOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + XmString Label; + int Index; + + autbegin(); + + XgraExitPanel( &XgraLibraryPanel ); + + XgraExitDialog(); + + if ( XgraFirstLibrary == 0 ) + { + for ( Index = 0; + CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + autfreeblock( CATA_LIB[ Index ] ); + } + + autfreeblock( CATA_LIB ); + autfreeblock( WORK_LIB ); + } + + XgraFirstLibrary = 0; + + CATA_LIB = XGRA_CATA_LIB; + WORK_LIB = XGRA_WORK_LIB; + + if ( XGRA_DEFAULT_LIB != (char *)NULL ) + { + Label = XmStringCreateSimple( XGRA_DEFAULT_LIB ); + + XtVaSetValues( XgraFileOpenDialog.WIDGET, + XmNdirectory, Label, NULL ); + + XmStringFree( Label ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLibraryUpdate | +| | +\------------------------------------------------------------*/ + +void CallbackLibraryUpdate( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraGetCataLibrary(); + XgraGetWorkLibrary(); + XgraSetLibraryList(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLibraryCancel | +| | +\------------------------------------------------------------*/ + +void CallbackLibraryCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + int Index; + + autbegin(); + + for ( Index = 0; + XGRA_CATA_LIB[ Index ] != (char *)NULL; + Index++ ) + { + autfreeblock( XGRA_CATA_LIB[ Index ] ); + } + + autfreeblock( XGRA_CATA_LIB ); + autfreeblock( XGRA_WORK_LIB ); + + XgraExitPanel( &XgraLibraryPanel ); + + XgraExitDialog(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEnterLibrary | +| | +\------------------------------------------------------------*/ + +void CallbackEnterLibrary( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraInitializeLibrary(); + + XgraEnterPanel( &XgraLibraryPanel ); + XgraLimitedLoop( XgraLibraryPanel.PANEL ); + XgraReEnterDialog(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraBuildPanelLibrary | +| | +\------------------------------------------------------------*/ + +void XgraBuildPanelLibrary() +{ + Arg Args[15]; + XmString Label; + + autbegin(); + + XtSetArg( Args[0], XmNshadowType , XmSHADOW_ETCHED_IN ); + XtSetArg( Args[1], XmNdeleteResponse, XmDESTROY ); + XtSetArg( Args[2], XmNtitle , XgraLibraryPanel.TITLE ); + + XgraLibraryPanel.PANEL = + + XmCreateFormDialog( XgraMainWindow, "XgraLibraryPanel", Args, 3); + + XtAddCallback( XgraLibraryPanel.PANEL, XmNdestroyCallback, + XgraDestroyDialogCallback, NULL ); + + XgraLibraryPanel.PANEL_FORM = + + XtVaCreateManagedWidget( "XgraLibraryPanelForm", + xmFormWidgetClass, + XgraLibraryPanel.PANEL, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNfractionBase , 10, + NULL + ); + + XgraLibraryPanel.FRAME = + + XtVaCreateManagedWidget( "XgraLibraryFrame", + xmFrameWidgetClass, + XgraLibraryPanel.PANEL_FORM, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + NULL + ); + + XgraLibraryPanel.FORM = + + XtVaCreateManagedWidget( "XgraLibraryForm", + xmFormWidgetClass, + XgraLibraryPanel.FRAME, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNfractionBase , 120, + NULL + ); + + XgraLibraryButtonUpdate = + + XtVaCreateManagedWidget( "Update", + xmPushButtonWidgetClass, + XgraLibraryPanel.FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 10, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 40, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 105, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 115, + NULL + ); + + XgraLibraryButtonOk = + + XtVaCreateManagedWidget( "Ok", + xmPushButtonWidgetClass, + XgraLibraryPanel.FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 50, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 70, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 105, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 115, + NULL + ); + + XgraLibraryButtonCancel = + + XtVaCreateManagedWidget( "Cancel", + xmPushButtonWidgetClass, + XgraLibraryPanel.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" ); + + XgraLibraryListLabel = + + XtVaCreateManagedWidget( "XgraLibraryListLabel", + xmLabelGadgetClass , + XgraLibraryPanel.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 ); + + XgraLibraryList = + + XmCreateScrolledList( XgraLibraryPanel.FORM, + "XgraLibraryList", Args, 12 ); + + Label = XmStringCreateSimple( "Catalog libraries" ); + + XgraLibraryCataLabel = + + XtVaCreateManagedWidget( "XgraLibraryCataLabel", + xmLabelGadgetClass , + XgraLibraryPanel.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 ); + + XgraLibraryCata = + + XmCreateScrolledText( XgraLibraryPanel.FORM, + "XgraLibraryCata", Args, 14 ); + + Label = XmStringCreateSimple( "Work library" ); + + XgraLibraryWorkLabel = + + XtVaCreateManagedWidget( "XgraLibraryWorkLabel", + xmLabelGadgetClass , + XgraLibraryPanel.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 ); + + XgraLibraryWork = + + XmCreateText( XgraLibraryPanel.FORM, + "XgraLibraryWork", Args, 14 ); + + XtManageChild( XgraLibraryWork ); + XtManageChild( XgraLibraryList ); + XtManageChild( XgraLibraryCata ); + + XtAddCallback( XgraLibraryList, + XmNdefaultActionCallback, + CallbackLibraryList, NULL ); + + XtAddCallback( XgraLibraryButtonOk, + XmNactivateCallback, + CallbackLibraryOk, NULL ); + + XtAddCallback( XgraLibraryButtonCancel, + XmNactivateCallback, + CallbackLibraryCancel, NULL ); + + XtAddCallback( XgraLibraryButtonUpdate, + XmNactivateCallback, + CallbackLibraryUpdate, NULL ); + + XtVaSetValues( XgraLibraryPanel.PANEL, + XmNheight, XgraLibraryPanel.HEIGHT, + XmNwidth , XgraLibraryPanel.WIDTH, + XmNx , XgraLibraryPanel.X, + XmNy , XgraLibraryPanel.Y, + NULL ); + + Label = XmStringCreateSimple( "Library" ); + + XtVaSetValues( XmFileSelectionBoxGetChild( XgraFileOpenDialog.WIDGET, + XmDIALOG_HELP_BUTTON ), + XmNlabelString, Label, NULL ); + + XmStringFree( Label ); + + XtAddCallback( XmFileSelectionBoxGetChild( XgraFileOpenDialog.WIDGET, + XmDIALOG_HELP_BUTTON ), + XmNactivateCallback, + CallbackEnterLibrary, NULL ); + + autend(); +} diff --git a/alliance/src/xgra/src/XMF_panel.h b/alliance/src/xgra/src/XMF_panel.h new file mode 100644 index 00000000..23f688e1 --- /dev/null +++ b/alliance/src/xgra/src/XMF_panel.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 : XGRA | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_FILE_PANEL +# define XGRA_FILE_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_LIBRARY_X 100 +# define XGRA_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/xgra/src/XMH.h b/alliance/src/xgra/src/XMH.h new file mode 100644 index 00000000..ea74272b --- /dev/null +++ b/alliance/src/xgra/src/XMH.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 : XGRA | +| | +| File : XMH101.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XMH +# define XGRA_XMH + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern XgraMenuItem XgraHelpMenu[]; + extern XgraPanelItem XgraHelpPresentPanel; + + extern int XgraHelpPresentDefaultValues[5]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraBuildPresentPanel(); + extern void XgraEnterPresentPanel(); + +# endif diff --git a/alliance/src/xgra/src/XMH_help.c b/alliance/src/xgra/src/XMH_help.c new file mode 100644 index 00000000..688e9491 --- /dev/null +++ b/alliance/src/xgra/src/XMH_help.c @@ -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 : XGRA | +| | +| File : Help.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XTB.h" +# include "XSB.h" +# include "XMH.h" +# include "XMX.h" + +# include "XMH_help.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ diff --git a/alliance/src/xgra/src/XMH_help.h b/alliance/src/xgra/src/XMH_help.h new file mode 100644 index 00000000..20fb07e8 --- /dev/null +++ b/alliance/src/xgra/src/XMH_help.h @@ -0,0 +1,71 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Help.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +# ifndef XMH_HELP_H +# define XMH_HELP_H + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XMH_menu.c b/alliance/src/xgra/src/XMH_menu.c new file mode 100644 index 00000000..341b05d6 --- /dev/null +++ b/alliance/src/xgra/src/XMH_menu.c @@ -0,0 +1,124 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XTB.h" +# include "XSB.h" +# include "XMH.h" +# include "XMX.h" + +# include "XMH_menu.h" +# include "XMH_panel.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Help Menu | +| | +\------------------------------------------------------------*/ + + XgraMenuItem XgraHelpMenu[] = + + { + { + "About Xgra", + 'G', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackHelpAbout, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackHelpAbout | +| | +\------------------------------------------------------------*/ + +void CallbackHelpAbout( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterPresentPanel(); + + autend(); +} diff --git a/alliance/src/xgra/src/XMH_menu.h b/alliance/src/xgra/src/XMH_menu.h new file mode 100644 index 00000000..1bd45f1a --- /dev/null +++ b/alliance/src/xgra/src/XMH_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 : XGRA | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +# ifndef XMH_MENU_H +# define XMH_MENU_H + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackHelpAbout(); + +# endif diff --git a/alliance/src/xgra/src/XMH_panel.c b/alliance/src/xgra/src/XMH_panel.c new file mode 100644 index 00000000..446e7294 --- /dev/null +++ b/alliance/src/xgra/src/XMH_panel.c @@ -0,0 +1,588 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" +# include "XMH.h" + +# include "XMH_panel.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + XgraPanelItem XgraHelpPresentPanel = + + { + "Xgra present", + 1, + 0, + XGRA_HELP_PRESENT_X, + XGRA_HELP_PRESENT_Y, + 700, + 360, + 0, + 0, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraPanelButtonItem *)NULL + }; + + int XgraHelpPresentDefaultValues[ 5 ] = + + { + XGRA_HELP_PRESENT_X, + XGRA_HELP_PRESENT_Y, + 700, 360, 0 + }; + + + static char XgraHelpPresentPixmap[] = + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x15, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x22, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x68, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x94, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x85, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0xa5, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x59, 0x52, 0x02, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x46, 0x95, 0x02, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaa, 0xa4, + 0x04, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x40, 0x25, 0x29, 0x01, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfe, 0x00, 0x40, 0x29, 0x45, 0x0d, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xd7, 0x00, + 0x28, 0xc5, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xef, 0x7b, 0x00, 0x40, 0x92, 0x52, + 0x05, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x42, 0xef, 0xdd, 0x7f, 0x00, 0x94, 0x54, 0x15, 0x52, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0xe0, 0xf5, + 0xf7, 0x3d, 0x00, 0x50, 0x49, 0xc5, 0x44, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf7, 0xbf, 0x0e, 0x00, + 0x05, 0x51, 0x10, 0x90, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x0f, 0x00, 0x68, 0x75, 0x4d, + 0x55, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xb8, 0xdb, 0xff, 0x05, 0x80, 0x4a, 0x6c, 0x42, 0x26, 0x01, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x7c, 0xf7, + 0x1d, 0x00, 0x00, 0x24, 0xfb, 0x28, 0x8d, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xee, 0xff, 0x06, 0x00, 0x40, + 0x91, 0xf4, 0x51, 0x12, 0x02, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6b, 0xdf, 0x05, 0x00, 0x00, 0x48, 0xfd, 0x8a, + 0xa4, 0x04, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x80, 0xb5, 0xb5, 0x0f, 0x00, 0x90, 0x12, 0xaf, 0x53, 0x04, 0x08, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x80, 0xbf, 0xea, + 0x1d, 0x00, 0x00, 0xa0, 0xfe, 0x25, 0x59, 0x01, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xc4, 0xeb, 0x78, 0x1f, 0x00, 0xa0, + 0x2a, 0x7f, 0x0b, 0x81, 0x10, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0xbd, 0xa6, 0x1d, 0x00, 0x08, 0x40, 0xdc, 0xa7, + 0x14, 0x08, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0xf0, 0x6f, 0x71, 0x0d, 0x00, 0x80, 0x54, 0xb8, 0x0e, 0x41, 0x01, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xa8, 0x9b, 0xca, + 0x05, 0x00, 0x41, 0x20, 0xd0, 0x1d, 0x12, 0x40, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x42, 0xec, 0xaf, 0x5a, 0x07, 0x00, 0x08, + 0x10, 0xb0, 0xa2, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x20, 0xbc, 0xa7, 0x84, 0x01, 0x00, 0x00, 0x02, 0x60, 0x3d, + 0x14, 0x09, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, + 0xd6, 0x2b, 0xb5, 0x00, 0x00, 0x00, 0x04, 0x20, 0x25, 0x01, 0x60, 0x01, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x11, 0xff, 0x55, 0x44, + 0x01, 0x00, 0x24, 0x00, 0x40, 0x49, 0x20, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x84, 0xee, 0x4c, 0xa9, 0x00, 0x20, 0x01, + 0x03, 0x40, 0x92, 0x08, 0x03, 0x02, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0xa4, 0x40, 0x57, 0x50, 0x53, 0x00, 0x00, 0x00, 0x00, 0x80, 0x12, + 0x01, 0x90, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x02, 0xe4, + 0x37, 0x90, 0x2c, 0x00, 0x00, 0x80, 0x00, 0x00, 0x45, 0x82, 0x80, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x20, 0xa1, 0x1a, 0xa0, 0x12, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x01, 0x08, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x09, 0xb0, 0x1e, 0xa0, 0x0a, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x8a, 0x02, 0x00, 0x02, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x80, 0x00, 0xe9, 0x0b, 0x40, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, + 0x14, 0x00, 0x10, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x40, 0x22, 0xa8, + 0x06, 0x80, 0x07, 0x00, 0x00, 0x08, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x48, 0xde, 0x03, 0x80, 0x00, + 0x00, 0x00, 0x08, 0x00, 0x00, 0x88, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x90, 0x02, 0x35, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x90, 0x52, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x90, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, + 0x11, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xa8, 0x84, 0xd6, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x20, 0xa4, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x04, 0xc4, 0x3a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x09, 0x00, 0x00, 0x01, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x84, 0xa0, 0x57, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0a, + 0x00, 0x00, 0x80, 0x52, 0x01, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x22, 0x71, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x40, 0x19, 0x00, 0x00, 0x80, + 0x44, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x09, 0xd4, 0x0b, + 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x00, 0x12, 0x01, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x80, 0x24, 0x38, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x90, 0x28, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x40, 0x00, 0xed, 0x07, 0x00, 0x00, 0x00, 0x00, 0x28, 0x45, + 0x00, 0x00, 0x00, 0x8a, 0x02, 0x00, 0x08, 0x00, 0xf0, 0x00, 0x00, 0x20, + 0x15, 0x9a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0xa2, 0x00, 0x00, 0x00, + 0xa4, 0x08, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x20, 0x48, 0xf7, 0x01, + 0x00, 0x00, 0x00, 0x00, 0xa2, 0x08, 0x00, 0x00, 0x00, 0x10, 0x02, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x10, 0x81, 0xad, 0x00, 0x20, 0x00, 0x00, + 0x00, 0x0a, 0x45, 0x00, 0x00, 0x00, 0x48, 0x08, 0x00, 0x20, 0x00, 0xf0, + 0x00, 0x00, 0x48, 0x4a, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x10, + 0x01, 0x00, 0x00, 0x90, 0x12, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x04, + 0xd1, 0x37, 0x00, 0x00, 0x00, 0x00, 0x80, 0x10, 0x55, 0x02, 0x00, 0x00, + 0x20, 0x40, 0x00, 0x40, 0x00, 0xf0, 0x00, 0x00, 0x8a, 0xe4, 0x2f, 0x10, + 0x00, 0x00, 0x00, 0x40, 0x15, 0x04, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, + 0x80, 0x00, 0xf0, 0x00, 0x00, 0x26, 0xb1, 0x2f, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x25, 0x51, 0x09, 0x00, 0x00, 0x80, 0xa4, 0x00, 0x08, 0x00, 0xf0, + 0x00, 0x00, 0x91, 0x7c, 0x01, 0x85, 0x00, 0x00, 0x00, 0x50, 0xa1, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x01, 0xf0, 0x00, 0x80, 0x24, + 0x01, 0x54, 0x00, 0x00, 0x00, 0x00, 0x10, 0x4a, 0xa8, 0x12, 0x00, 0x00, + 0x00, 0x48, 0x4a, 0x40, 0x02, 0xf0, 0x00, 0x40, 0x49, 0x54, 0x81, 0x08, + 0x00, 0x00, 0x00, 0x50, 0x12, 0x02, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x28, 0x00, 0xf0, 0x00, 0x20, 0xca, 0x12, 0x4a, 0x42, 0x00, 0x00, 0x00, + 0x40, 0x44, 0xa8, 0x02, 0x00, 0x00, 0x00, 0xa2, 0x02, 0x02, 0x05, 0xf0, + 0x00, 0x40, 0x92, 0xa4, 0x10, 0x00, 0x00, 0x00, 0x00, 0x80, 0x92, 0x02, + 0x04, 0x00, 0x00, 0x00, 0x08, 0x42, 0x20, 0x00, 0xf0, 0x00, 0x90, 0x11, + 0x49, 0x85, 0x10, 0x04, 0x00, 0x00, 0x00, 0x24, 0xa4, 0x48, 0x00, 0x00, + 0x00, 0x04, 0x8d, 0x08, 0x04, 0xf0, 0x00, 0xa8, 0x24, 0x22, 0x08, 0x00, + 0x00, 0x01, 0x00, 0x80, 0x42, 0x01, 0x01, 0x01, 0x00, 0x00, 0x08, 0x18, + 0x10, 0x09, 0xf0, 0x00, 0x24, 0x95, 0x08, 0xa1, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x28, 0x24, 0x09, 0x01, 0x00, 0x00, 0x50, 0x0b, 0xa1, 0x10, 0xf0, + 0x00, 0x4a, 0x08, 0xa1, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x42, + 0x20, 0x02, 0x00, 0x00, 0x10, 0x40, 0x0a, 0x22, 0xf0, 0x00, 0x12, 0x29, + 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x09, 0x0a, 0x00, 0x00, + 0x80, 0x00, 0x12, 0x50, 0x04, 0xf0, 0x00, 0x51, 0x92, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x01, 0x48, 0x24, 0x80, 0x04, 0x00, 0x08, 0x00, 0x81, + 0x24, 0x51, 0xf0, 0x80, 0x0c, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x90, 0x08, 0x25, 0x01, 0x10, 0x01, 0x00, 0x90, 0x20, 0x82, 0xf0, + 0x40, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xa0, 0x22, + 0x00, 0x10, 0x01, 0x00, 0x08, 0x40, 0x8a, 0x24, 0xf0, 0x20, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x49, 0x48, 0x00, 0x00, + 0x00, 0x00, 0x8a, 0x20, 0x08, 0xf1, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x22, 0x00, 0x20, 0x4a, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x04, 0x40, 0x11, 0x28, 0x02, 0x01, 0x00, 0x00, 0x10, 0x42, 0x22, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x80, 0xa4, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x30, 0x00, 0x20, 0x01, 0x00, 0x4a, 0x13, 0x48, 0x00, + 0x00, 0x00, 0x80, 0x04, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x48, 0x00, 0xa5, 0x40, 0x01, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x02, + 0x00, 0x00, 0xa8, 0x0d, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x40, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x41, 0x00, 0x10, 0x01, 0x56, + 0x4b, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x45, 0x00, 0xa8, 0x1a, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x20, 0x00, 0x58, 0x15, 0x01, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x80, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x20, + 0x04, 0x05, 0xa0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0xc0, 0xdf, 0x00, 0x00, 0x00, 0x04, 0x04, 0x28, 0x08, 0xf0, + 0x35, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xfa, 0x01, 0x00, 0x00, 0x00, 0x40, 0x80, 0x12, 0xa0, 0xda, 0x48, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xdf, 0x02, 0x00, + 0x00, 0x10, 0x12, 0x11, 0x01, 0x40, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x08, 0x00, 0xf6, 0x02, 0x00, 0x00, 0x00, 0x80, + 0xa0, 0x4c, 0xa0, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x7a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x50, + 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0xdc, 0x0e, 0x00, 0x00, 0x00, 0xa0, 0xa4, 0x48, 0x88, 0x16, 0x00, 0x00, + 0x00, 0x80, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x58, 0x15, 0x00, + 0x00, 0x80, 0x04, 0x25, 0xa5, 0xa0, 0x01, 0x00, 0x00, 0x00, 0xb4, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xb0, 0x0b, 0x00, 0x00, 0x00, 0x20, + 0x0d, 0x21, 0x55, 0x0d, 0x00, 0x00, 0xc0, 0x29, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x60, 0x2e, 0x00, 0x00, 0x00, 0x80, 0x42, 0xa4, 0x29, + 0x02, 0x00, 0x40, 0x41, 0x1a, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x40, 0x53, 0x00, 0x00, 0x00, 0x92, 0x14, 0x4a, 0x4a, 0x01, 0x00, 0x18, + 0xa0, 0x16, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xa0, 0x94, 0x00, + 0x00, 0x00, 0x04, 0x6d, 0xa4, 0x5a, 0x00, 0x40, 0x01, 0x90, 0x0a, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x80, 0x52, 0x00, 0x00, 0x00, 0x40, + 0x52, 0x51, 0x49, 0x00, 0x10, 0x00, 0x38, 0x0d, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x80, 0x54, 0x01, 0x00, 0x00, 0x88, 0xbc, 0x34, 0x95, + 0x00, 0x00, 0x00, 0xd4, 0x02, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x25, 0x02, 0x00, 0x00, 0x10, 0xab, 0x90, 0x34, 0x00, 0x04, 0x00, + 0xaa, 0x01, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x05, + 0x00, 0x00, 0x40, 0x6b, 0x6d, 0x05, 0x00, 0x02, 0x00, 0x55, 0x01, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x18, 0x08, 0x00, 0x00, 0xc0, + 0xda, 0x2a, 0x19, 0x00, 0x01, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0xa4, 0x0a, 0x00, 0x00, 0x00, 0xb6, 0x4b, 0x05, + 0x80, 0x00, 0xc0, 0x5a, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x90, 0x00, 0x00, 0x00, 0x80, 0xed, 0xd5, 0x02, 0x40, 0x00, 0x80, + 0x2d, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x20, 0x2a, + 0x00, 0x00, 0x00, 0xf5, 0x54, 0x00, 0x00, 0x00, 0x70, 0x1b, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x20, 0x24, 0x00, 0x00, 0x00, + 0x3d, 0xab, 0x01, 0x20, 0x00, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x41, 0x00, 0x00, 0x00, 0x56, 0xa5, 0x00, + 0x10, 0x00, 0xd8, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x94, 0x00, 0x00, 0x00, 0x5c, 0x52, 0x00, 0x08, 0x00, 0x54, + 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x00, 0x90, 0x2a, 0x00, 0x15, 0x00, 0xaa, 0x08, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x02, 0x80, 0xa0, 0x02, 0x00, 0x00, + 0x28, 0x16, 0x00, 0x1a, 0x00, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x04, 0x00, 0x00, 0xc8, 0x01, 0x00, + 0x2e, 0x80, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x05, 0x00, 0x00, 0xa0, 0x0c, 0x00, 0x3f, 0x40, 0x59, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x08, 0x00, 0x00, 0x2a, 0x01, 0x80, 0x5b, 0x40, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x28, 0x11, 0x00, 0x00, + 0x48, 0x01, 0xc0, 0xee, 0xa0, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x08, 0x00, 0x80, 0x22, 0x00, 0xe0, + 0xff, 0xd9, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x22, 0x00, 0x00, 0x94, 0x00, 0xd0, 0xff, 0x55, 0x05, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, + 0x40, 0x00, 0x80, 0x22, 0x00, 0xb8, 0xff, 0xab, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x96, 0x00, 0x20, + 0x08, 0x00, 0xb4, 0xf6, 0x75, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x15, 0x00, 0xec, + 0xff, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x00, 0xa4, 0x40, 0x20, 0xbe, 0xfe, 0x4b, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x81, 0x02, 0x00, 0x0a, 0x0a, 0xab, 0x7a, 0x35, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0xa1, + 0x00, 0x80, 0xef, 0xf5, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x08, 0x10, 0x12, 0xc1, 0x7a, + 0xbb, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x82, 0x44, 0x21, 0xa0, 0xee, 0xdf, 0x05, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x19, 0x00, 0x00, 0x90, 0xfd, 0x7f, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x49, + 0x48, 0x08, 0x7f, 0xaf, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x15, 0x00, 0x02, 0xec, 0xdf, + 0xff, 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x00, 0x40, 0x4b, 0x14, 0x28, 0xf6, 0xfb, 0x55, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x04, 0x80, 0x00, 0xff, 0xff, 0x0b, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x24, + 0x84, 0xff, 0x3f, 0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x82, 0xd0, 0x7f, 0x01, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x50, 0xe2, 0x5f, 0x20, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x80, 0xf0, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, 0x00, 0x6a, + 0x04, 0x22, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x11, 0x08, 0x12, + 0x08, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0xa4, 0x40, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x84, 0x24, 0x00, 0x14, 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, + 0x14, 0x41, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x04, 0x41, 0x8a, 0x00, + 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x51, 0x94, 0x20, 0xea, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x08, 0x84, 0x20, 0x8a, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x90, 0x10, + 0x8a, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x85, 0x78, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0x60, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x0a, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0 + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraBuildPresentPanel | +| | +\------------------------------------------------------------*/ + +void XgraBuildPresentPanel() + +{ + Widget PanelLabel; + Widget PanelButton; + Pixmap PanelPixmap; + XmString PanelString; + XmString PanelString1; + XmString PanelString2; + XmFontList PanelFontList; + XFontStruct *PanelFont; + Display *PanelDisplay; + char Buffer[ 64 ]; + Arg Args[3]; + + autbegin(); + + PanelDisplay = XtDisplay( XgraMainWindow ); + 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, XmDESTROY ); + XtSetArg( Args[2], XmNtitle , "Xgra present" ); + + XgraHelpPresentPanel.PANEL = + + XmCreateFormDialog( XgraMainWindow, XgraHelpPresentPanel.TITLE, Args, 3); + + XtAddCallback( XgraHelpPresentPanel.PANEL, XmNdestroyCallback, + XgraDestroyDialogCallback, NULL ); + + XgraHelpPresentPanel.PANEL_FORM = + + XtVaCreateManagedWidget( "", + xmFormWidgetClass, + XgraHelpPresentPanel.PANEL, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + NULL + ); + + XgraHelpPresentPanel.FRAME = + + XtVaCreateManagedWidget( "", + xmFrameWidgetClass, + XgraHelpPresentPanel.PANEL_FORM, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 05, + XmNbottomAttachment, XmATTACH_POSITION, + XmNbottomPosition , 95, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 05, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 95, + NULL + ); + + XgraHelpPresentPanel.FORM = + + XtVaCreateManagedWidget( "", + xmFormWidgetClass, + XgraHelpPresentPanel.FRAME, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 05, + XmNbottomAttachment, XmATTACH_POSITION, + XmNbottomPosition , 95, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 05, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 95, + NULL + ); + + PanelPixmap = XgraCreatePixmap( XgraMainWindow, + XgraHelpPresentPixmap, + XGRA_PRESENT_PIXMAP_WIDTH, + XGRA_PRESENT_PIXMAP_HEIGHT ); + + + PanelLabel = XtVaCreateManagedWidget( "", + xmLabelGadgetClass, + XgraHelpPresentPanel.FORM, + XmNlabelType , XmPIXMAP, + XmNlabelPixmap , PanelPixmap, + NULL + ); + + sprintf( Buffer, "ALLIANCE CAD SYSTEM %s\n", ALLIANCE_VERSION ); + + PanelString = XmStringCreateLtoR( Buffer, "Panel_charset2" ); + + PanelLabel = XtVaCreateManagedWidget( "", + xmLabelWidgetClass, + XgraHelpPresentPanel.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( "Xgra" , "Panel_charset1" ); + PanelString2 = XmStringCreateLtoR( "\n( Touch Me )", "Panel_charset4" ); + PanelString = XmStringConcat( PanelString1, PanelString2 ); + + PanelButton = XtVaCreateManagedWidget( "", + xmPushButtonWidgetClass, + XgraHelpPresentPanel.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, + XgraExitDialogCallback, NULL ); + + sprintf( Buffer, "\nGraphic GRA Viewer\nVersion %s", ALLIANCE_VERSION ); + + PanelString = XmStringCreateLtoR( Buffer, "Panel_charset2" ); + + PanelLabel = XtVaCreateManagedWidget( "", + xmLabelWidgetClass, + XgraHelpPresentPanel.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 MASI, \ +CAO-VLSI Team\nE-mail support: cao-vlsi@masi.ibp.fr", "Panel_charset4" ); + + PanelLabel = XtVaCreateManagedWidget( "", + xmLabelWidgetClass, + XgraHelpPresentPanel.FORM, + XmNfontList , PanelFontList, + XmNlabelString , PanelString, + XmNtopAttachment , XmATTACH_WIDGET, + XmNtopWidget , PanelLabel, + XmNtopOffset , 5, + XmNrightAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + NULL + ); + XmStringFree( PanelString ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraEnterPresentPanel | +| | +\------------------------------------------------------------*/ + +void XgraEnterPresentPanel() + +{ + autbegin(); + + XgraEnterPanel( &XgraHelpPresentPanel ); + + XgraLimitedLoop( XgraHelpPresentPanel.PANEL ); + + XgraExitPanel( &XgraHelpPresentPanel ); + + autend(); +} diff --git a/alliance/src/xgra/src/XMH_panel.h b/alliance/src/xgra/src/XMH_panel.h new file mode 100644 index 00000000..0df4cc2a --- /dev/null +++ b/alliance/src/xgra/src/XMH_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 : XGRA | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +# ifndef XMH_HELP_PANEL +# define XMH_HELP_PANEL + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_PRESENT_PIXMAP_WIDTH 164 +# define XGRA_PRESENT_PIXMAP_HEIGHT 150 + +# define XGRA_HELP_PRESENT_X 180 +# define XGRA_HELP_PRESENT_Y 200 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XMS.h b/alliance/src/xgra/src/XMS.h new file mode 100644 index 00000000..297a65f9 --- /dev/null +++ b/alliance/src/xgra/src/XMS.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 : XGRA | +| | +| File : XMS.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XMS +# define XGRA_XMS + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern XgraMenuItem XgraSetupMenu[]; + extern XgraPanelItem XgraSetupInformationsPanel; + + extern int XgraSetupInformationsDefaultValues[ 5 ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackSetupLoadConfig(); + extern void CallbackSetupSaveConfig(); + extern void CallbackSetupDefaultConfig(); + extern void CallbackSetupInformations(); + + extern void XgraLoadConfig(); + extern void XgraLoadTopLevelConfig(); + +# endif diff --git a/alliance/src/xgra/src/XMS_dialog.c b/alliance/src/xgra/src/XMS_dialog.c new file mode 100644 index 00000000..13762e3f --- /dev/null +++ b/alliance/src/xgra/src/XMS_dialog.c @@ -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 : XGRA | +| | +| File : Dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XTB.h" +# include "XMS.h" + +# include "XMS_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ diff --git a/alliance/src/xgra/src/XMS_dialog.h b/alliance/src/xgra/src/XMS_dialog.h new file mode 100644 index 00000000..d74f1210 --- /dev/null +++ b/alliance/src/xgra/src/XMS_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 : XGRA | +| | +| File : Dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_SETUP_DIALOG +# define XGRA_SETUP_DIALOG + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XMS_menu.c b/alliance/src/xgra/src/XMS_menu.c new file mode 100644 index 00000000..1ece033d --- /dev/null +++ b/alliance/src/xgra/src/XMS_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 : XGRA | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMS.h" + +# include "XMS_menu.h" +# include "XMS_panel.h" +# include "XMS_setup.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + XgraMenuItem XgraSetupMenu[] = + + { + { + "Default Config", + 'D', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackSetupDefaultConfig, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + { + "Load Config", + 'L', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackSetupLoadConfig, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + { + "Save Config", + 'S', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackSetupSaveConfig, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + { + "Informations", + 'I', + NULL, + NULL, + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackSetupInformations, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + NULL + }; + + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackSetupLoadConfig | +| | +\------------------------------------------------------------*/ + +void CallbackSetupLoadConfig( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraLoadConfig( XGRA_TRUE ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackSetupSaveConfig | +| | +\------------------------------------------------------------*/ + +void CallbackSetupSaveConfig( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraSaveConfig(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackSetupDefaultConfig | +| | +\------------------------------------------------------------*/ + +void CallbackSetupDefaultConfig( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraDefaultConfig(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackSetupInformations | +| | +\------------------------------------------------------------*/ + +void CallbackSetupInformations( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraDisplayInformations(); + + autend(); +} + diff --git a/alliance/src/xgra/src/XMS_menu.h b/alliance/src/xgra/src/XMS_menu.h new file mode 100644 index 00000000..2a42f9e4 --- /dev/null +++ b/alliance/src/xgra/src/XMS_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 : XGRA | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_SETUP_MENU +# define XGRA_SETUP_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XMS_panel.c b/alliance/src/xgra/src/XMS_panel.c new file mode 100644 index 00000000..457d6567 --- /dev/null +++ b/alliance/src/xgra/src/XMS_panel.c @@ -0,0 +1,180 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XTB.h" +# include "XMS.h" + +# include "XMS_panel.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Panel | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Panel Informations | +| | +\------------------------------------------------------------*/ + + static char *XgraPanelInformationsButtonName[] = + + { + "Text", + "Close" + }; + + XgraPanelButtonItem XgraSetupInformationsButton[] = + + { + { + &XgraPanelInformationsButtonName[0], + "Nothing", NULL, 0, 0, + NULL, + NULL, + 0, 0, + 8, 9, + NULL, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelInformationsButtonName[1], + NULL, NULL, 0, 0, + NULL, + NULL, + 3, 9, + 2, 1, + XgraExitDialogCallback, + (XtPointer)NULL, + (Widget)NULL + } + , + NULL + }; + + XgraPanelItem XgraSetupInformationsPanel = + + { + "Informations", + 1, + 0, + XGRA_SETUP_INFORMATIONS_X, + XGRA_SETUP_INFORMATIONS_Y, + 360, + 250, + 8, + 10, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + XgraSetupInformationsButton + }; + + int XgraSetupInformationsDefaultValues[ 5 ] = + + { + XGRA_SETUP_INFORMATIONS_X, + XGRA_SETUP_INFORMATIONS_Y, + 360, 250, 0 + }; + +/*------------------------------------------------------------\ +| | +| Callback For Informations | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraDisplayInformations | +| | +\------------------------------------------------------------*/ + +void XgraDisplayInformations() + +{ + char *Message; + + autbegin(); + + Message = XgraGetInformations(); + + XmTextSetString( XgraSetupInformationsButton[0].BUTTON, Message ); + + XgraEnterPanel( &XgraSetupInformationsPanel ); + + XgraLimitedLoop( XgraSetupInformationsPanel.PANEL ); + + XgraExitPanel( &XgraSetupInformationsPanel ); + + autend(); +} diff --git a/alliance/src/xgra/src/XMS_panel.h b/alliance/src/xgra/src/XMS_panel.h new file mode 100644 index 00000000..6bdd1f4e --- /dev/null +++ b/alliance/src/xgra/src/XMS_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 : XGRA | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_SETUP_PANEL +# define XGRA_SETUP_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_SETUP_INFORMATIONS_X 330 +# define XGRA_SETUP_INFORMATIONS_Y 280 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraDisplayInformations(); + +# endif diff --git a/alliance/src/xgra/src/XMS_setup.c b/alliance/src/xgra/src/XMS_setup.c new file mode 100644 index 00000000..43ea62d0 --- /dev/null +++ b/alliance/src/xgra/src/XMS_setup.c @@ -0,0 +1,517 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Setup.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" +# include "XMF.h" +# include "XME.h" +# include "XMV.h" +# include "XMT.h" +# include "XMS.h" +# include "XMH.h" + +# include "XMS_setup.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static FILE *FileConfig; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Set Panel New Values | +| | +\------------------------------------------------------------*/ + +void XgraSetPanelValues( Panel, Values ) + + XgraPanelItem *Panel; + int *Values; +{ + autbegin(); + + 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 ) + { + XgraEnterPanel( Panel ); + } + else + { + XtUnmanageChild( Panel->PANEL ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Write TopLevel Values | +| | +\------------------------------------------------------------*/ + +void XgraWriteTopLevelValues() + +{ + Dimension Values[5]; + + autbegin(); + + XtVaGetValues( XgraTopLevel, + XmNx , &Values[0], + XmNy , &Values[1], + XmNwidth , &Values[2], + XmNheight , &Values[3], + NULL ); + + Values[0] = Values[0] - XGRA_TOPLEVEL_ARCLATE_X; + Values[1] = Values[1] - XGRA_TOPLEVEL_ARCLATE_Y; + Values[4] = 1; + + fprintf( FileConfig, "VERSION: %s\n", ALLIANCE_VERSION ); + fprintf( FileConfig, "X: %d, Y: %d, WIDTH: %d, HEIGHT: %d, MANAGED: %d\n", + Values[0], Values[1], Values[2], Values[3], Values[4] ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Write Panel Values | +| | +\------------------------------------------------------------*/ + +void XgraWritePanelValues( Panel ) + + XgraPanelItem *Panel; +{ + Dimension Values[5]; + + autbegin(); + + if ( Panel->COMPUTE == 0 ) + { + XtVaGetValues( Panel->PANEL, + XmNx , &Values[0], + XmNy , &Values[1], + XmNwidth , &Values[2], + XmNheight , &Values[3], + NULL ); + + Values[0] = Values[0] - XGRA_PANEL_ARCLATE_X; + Values[1] = Values[1] - XGRA_PANEL_ARCLATE_Y; + } + else + { + Values[0] = Panel->X; + Values[1] = Panel->Y; + Values[2] = Panel->WIDTH; + Values[3] = Panel->HEIGHT; + } + + 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] ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Read Panel Values | +| | +\------------------------------------------------------------*/ + +void XgraReadPanelValues( Panel ) + + XgraPanelItem *Panel; +{ + int Values[5]; + + autbegin(); + + fscanf( FileConfig, "X: %d, Y: %d, WIDTH: %d, HEIGHT: %d, MANAGED: %d\n", + &Values[0], &Values[1], &Values[2], &Values[3], &Values[4] ); + + XgraSetPanelValues( Panel, Values ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Read Panel Values | +| | +\------------------------------------------------------------*/ + +char XgraReadTopLevelValues() + +{ + int Values[5]; + char Version[64]; + + autbegin(); + + fscanf( FileConfig, "VERSION: %s\n", Version ); + + if ( strcmp( Version, ALLIANCE_VERSION ) ) + { + autend(); + 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( XgraTopLevel, + XmNx , Values[0], + XmNy , Values[1], + XmNwidth , Values[2], + XmNheight , Values[3], + NULL ); + autend(); + return( 1 ); +} + +/*------------------------------------------------------------\ +| | +| ReadActiveLayers | +| | +\------------------------------------------------------------*/ + +void XgraReadActiveLayers() + +{ + short Layer; + int Value; + + autbegin(); + + for ( Layer = 0; Layer < XGRA_MAX_LAYER; Layer++ ) + { + fscanf( FileConfig, "ACTIVE: %d\n", &Value ); + + XGRA_ACTIVE_LAYER_TABLE[ Layer ] = Value; + } + + for ( Layer = 0; Layer < XGRA_MAX_ACTIVE_NAME; Layer++ ) + { + fscanf( FileConfig, "ACTIVE: %d\n", &Value ); + + XGRA_ACTIVE_NAME_TABLE[ Layer ] = Value; + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| WriteActiveLayers | +| | +\------------------------------------------------------------*/ + +void XgraWriteActiveLayers() + +{ + char Layer; + + autbegin(); + + for ( Layer = 0; Layer < XGRA_MAX_LAYER; Layer++ ) + { + fprintf( FileConfig, "ACTIVE: %d\n", + XGRA_ACTIVE_LAYER_TABLE[ Layer ] ); + } + + for ( Layer = 0; Layer < XGRA_MAX_ACTIVE_NAME; Layer++ ) + { + fprintf( FileConfig, "ACTIVE: %d\n", + XGRA_ACTIVE_NAME_TABLE[ Layer ] ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDefaultTopLevelValues | +| | +\------------------------------------------------------------*/ + +void XgraDefaultTopLevelValues() + +{ + autbegin(); + + XtVaSetValues( XgraTopLevel, + XmNheight , XGRA_TOPLEVEL_HEIGHT, + XmNwidth , XGRA_TOPLEVEL_WIDTH, + XmNx , XGRA_TOPLEVEL_X, + XmNy , XGRA_TOPLEVEL_Y, + NULL + ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDefaultConfig | +| | +\------------------------------------------------------------*/ + +void XgraDefaultConfig() + +{ + short Layer; + + autbegin(); + + XgraDefaultTopLevelValues(); + + XgraSetPanelValues( &XgraViewArrowsPanel, + XgraViewArrowsDefaultValues ); + XgraSetPanelValues( &XgraViewZoomPanel, + XgraViewZoomDefaultValues ); + XgraSetPanelValues( &XgraViewGridPanel, + XgraViewGridDefaultValues ); + XgraSetPanelValues( &XgraViewLayerPanel, + XgraViewLayerDefaultValues ); + XgraSetPanelValues( &XgraViewMapPanel, + XgraViewMapDefaultValues ); + XgraSetPanelValues( &XgraEditSearchViewPanel, + XgraEditSearchViewDefaultValues ); + XgraSetPanelValues( &XgraEditSelectPanel, + XgraEditSelectDefaultValues ); + XgraSetPanelValues( &XgraEditIdentifyPanel, + XgraEditIdentifyDefaultValues ); + XgraSetPanelValues( &XgraToolsMessagePanel, + XgraToolsMessageDefaultValues ); + XgraSetPanelValues( &XgraSetupInformationsPanel, + XgraSetupInformationsDefaultValues ); + XgraSetPanelValues( &XgraHelpPresentPanel, + XgraHelpPresentDefaultValues ); + + for ( Layer = 0; Layer < XGRA_MAX_LAYER; Layer++ ) + { + XGRA_ACTIVE_LAYER_TABLE[ Layer ] = 1; + } + + for ( Layer = 0; Layer < XGRA_MAX_ACTIVE_NAME; Layer++ ) + { + XGRA_ACTIVE_NAME_TABLE[ Layer ] = 1; + } + + XgraInitializeLayer(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraLoadTopLevelConfig | +| | +\------------------------------------------------------------*/ + +void XgraLoadTopLevelConfig() + +{ + autbegin(); + + FileConfig = fopen( XGRA_XMS_FILE_NAME, "r" ); + + if ( FileConfig == (FILE *)NULL ) + { + XgraDefaultTopLevelValues(); + } + else + { + if ( ! XgraReadTopLevelValues() ) + { + XgraDefaultTopLevelValues(); + } + + fclose( FileConfig ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraLoadConfig | +| | +\------------------------------------------------------------*/ + +void XgraLoadConfig( Message ) + + char Message; +{ + autbegin(); + + FileConfig = fopen( XGRA_XMS_FILE_NAME, "r" ); + + if ( FileConfig == (FILE *)NULL ) + { + if ( Message ) + { + XgraErrorMessage( XgraMainWindow, + "Unable to open config file !" ); + } + else + { + XgraDefaultConfig(); + } + } + else + { + if ( XgraReadTopLevelValues() ) + { + XgraReadPanelValues( &XgraViewArrowsPanel ); + XgraReadPanelValues( &XgraViewZoomPanel ); + XgraReadPanelValues( &XgraViewGridPanel ); + XgraReadPanelValues( &XgraViewLayerPanel ); + XgraReadPanelValues( &XgraViewMapPanel ); + XgraReadPanelValues( &XgraEditSearchViewPanel ); + XgraReadPanelValues( &XgraEditSelectPanel ); + XgraReadPanelValues( &XgraEditIdentifyPanel ); + XgraReadPanelValues( &XgraToolsMessagePanel ); + XgraReadPanelValues( &XgraSetupInformationsPanel ); + XgraReadPanelValues( &XgraHelpPresentPanel ); + + XgraReadActiveLayers(); + XgraInitializeLayer(); + } + else + if ( Message ) + { + XgraErrorMessage( XgraMainWindow, + "Bad version, unable to open config file !" ); + } + + fclose( FileConfig ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraSaveConfig | +| | +\------------------------------------------------------------*/ + +void XgraSaveConfig() + +{ + autbegin(); + + FileConfig = fopen( XGRA_XMS_FILE_NAME, "w" ); + + if ( FileConfig == (FILE *)NULL ) + { + XgraErrorMessage( XgraMainWindow, + "Unable to open config file !" ); + } + else + { + XgraWriteTopLevelValues(); + + XgraWritePanelValues( &XgraViewArrowsPanel ); + XgraWritePanelValues( &XgraViewZoomPanel ); + XgraWritePanelValues( &XgraViewGridPanel ); + XgraWritePanelValues( &XgraViewLayerPanel ); + XgraWritePanelValues( &XgraViewMapPanel ); + XgraWritePanelValues( &XgraEditSearchViewPanel ); + XgraWritePanelValues( &XgraEditSelectPanel ); + XgraWritePanelValues( &XgraEditIdentifyPanel ); + XgraWritePanelValues( &XgraToolsMessagePanel ); + XgraWritePanelValues( &XgraSetupInformationsPanel ); + XgraWritePanelValues( &XgraHelpPresentPanel ); + + XgraWriteActiveLayers(); + + fclose( FileConfig ); + } + + autend(); +} diff --git a/alliance/src/xgra/src/XMS_setup.h b/alliance/src/xgra/src/XMS_setup.h new file mode 100644 index 00000000..abe82daf --- /dev/null +++ b/alliance/src/xgra/src/XMS_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 : XGRA | +| | +| File : Setup.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_SETUP +# define XGRA_SETUP + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_TOPLEVEL_ARCLATE_X 8 +# define XGRA_TOPLEVEL_ARCLATE_Y 25 +# define XGRA_PANEL_ARCLATE_X 0 +# define XGRA_PANEL_ARCLATE_Y 0 + +# define XGRA_TOPLEVEL_X 10 +# define XGRA_TOPLEVEL_Y 10 +# define XGRA_TOPLEVEL_WIDTH 1024 +# define XGRA_TOPLEVEL_HEIGHT 768 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraDefaultConfig(); + extern void XgraSaveConfig(); + extern void XgraLoadConfig(); + +# endif diff --git a/alliance/src/xgra/src/XMT.h b/alliance/src/xgra/src/XMT.h new file mode 100644 index 00000000..9dd53bcb --- /dev/null +++ b/alliance/src/xgra/src/XMT.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 : XGRA | +| | +| File : XMT.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XMT +# define XGRA_XMT + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern XgraMenuItem XgraToolsMenu[]; + extern XgraPanelItem XgraToolsMessagePanel; + + extern int XgraToolsMessageDefaultValues[ 5 ]; + + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraDisplayToolsMessage(); + +# endif diff --git a/alliance/src/xgra/src/XMT_dialog.c b/alliance/src/xgra/src/XMT_dialog.c new file mode 100644 index 00000000..cded7078 --- /dev/null +++ b/alliance/src/xgra/src/XMT_dialog.c @@ -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 : XGRA | +| | +| File : Dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XTB.h" +# include "XMT.h" + +# include "XMT_dialog.h" +# include "XMT_tools.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ diff --git a/alliance/src/xgra/src/XMT_dialog.h b/alliance/src/xgra/src/XMT_dialog.h new file mode 100644 index 00000000..ed75707f --- /dev/null +++ b/alliance/src/xgra/src/XMT_dialog.h @@ -0,0 +1,71 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_TOOLS_DIALOG +# define XGRA_TOOLS_DIALOG + + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XMT_menu.c b/alliance/src/xgra/src/XMT_menu.c new file mode 100644 index 00000000..9c9ec582 --- /dev/null +++ b/alliance/src/xgra/src/XMT_menu.c @@ -0,0 +1,122 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMV.h" +# include "XMT.h" +# include "XMX.h" + +# include "XMT_menu.h" +# include "XMT_tools.h" +# include "XMT_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + XgraMenuItem XgraToolsMenu[] = + + { + { + "Message", + 'M', + "CtrlM", + "Ctrl M", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackToolsMessage, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackToolsMessage | +| | +\------------------------------------------------------------*/ + +void CallbackToolsMessage( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterPanel( &XgraToolsMessagePanel ); + + autend(); +} diff --git a/alliance/src/xgra/src/XMT_menu.h b/alliance/src/xgra/src/XMT_menu.h new file mode 100644 index 00000000..d8e6e569 --- /dev/null +++ b/alliance/src/xgra/src/XMT_menu.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 : XGRA | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_MENU +# define XGRA_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackToolsMessage(); + +# endif diff --git a/alliance/src/xgra/src/XMT_message.c b/alliance/src/xgra/src/XMT_message.c new file mode 100644 index 00000000..58101c14 --- /dev/null +++ b/alliance/src/xgra/src/XMT_message.c @@ -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 : XGRA | +| | +| File : Message.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XTB.h" +# include "XMT.h" +# include "XMT_tools.h" +# include "XMT_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ diff --git a/alliance/src/xgra/src/XMT_message.h b/alliance/src/xgra/src/XMT_message.h new file mode 100644 index 00000000..27fffaa9 --- /dev/null +++ b/alliance/src/xgra/src/XMT_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 : XGRA | +| | +| File : Message.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_MESSAGE +# define XGRA_MESSAGE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XMT_panel.c b/alliance/src/xgra/src/XMT_panel.c new file mode 100644 index 00000000..06bcb6b8 --- /dev/null +++ b/alliance/src/xgra/src/XMT_panel.c @@ -0,0 +1,200 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XMX.h" +# include "XTB.h" +# include "XMT.h" + +# include "XMT_panel.h" +# include "XMT_message.h" +# include "XMT_dialog.h" +# include "XMT_tools.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Panel Message | +| | +\------------------------------------------------------------*/ + + static char *XgraPanelMessageButtonName[] = + + { + "Text", + "Close" + }; + + XgraPanelButtonItem XgraToolsMessageButton[] = + + { + { + &XgraPanelMessageButtonName[0], + "Nothing", NULL, 0, 0, + NULL, + NULL, + 0, 0, + 8, 9, + NULL, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelMessageButtonName[1], + NULL, NULL, 0, 0, + NULL, + NULL, + 3, 9, + 2, 1, + CallbackToolsCloseMessage, + (XtPointer)NULL, + (Widget)NULL + } + , + NULL + }; + + XgraPanelItem XgraToolsMessagePanel = + + { + "Message", + 1, + 0, + XGRA_TOOLS_MESSAGE_X, + XGRA_TOOLS_MESSAGE_Y, + 360, + 250, + 8, + 10, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + XgraToolsMessageButton + }; + + int XgraToolsMessageDefaultValues[ 5 ] = + + { + XGRA_TOOLS_MESSAGE_X, + XGRA_TOOLS_MESSAGE_Y, + 360, 250, 0 + }; + +/*------------------------------------------------------------\ +| | +| Callback For Message | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackToolsCloseMessage | +| | +\------------------------------------------------------------*/ + +void CallbackToolsCloseMessage( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraExitPanel( &XgraToolsMessagePanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDisplayToolsMessage | +| | +\------------------------------------------------------------*/ + +void XgraDisplayToolsMessage() +{ + char *Message; + + autbegin(); + + Message = XgraGetErrorMessage(); + + if ( Message != (char *)NULL ) + { + XmTextSetString( XgraToolsMessageButton[0].BUTTON, Message ); + + XgraEnterPanel( &XgraToolsMessagePanel ); + } + else + { + XmTextSetString( XgraToolsMessageButton[0].BUTTON, "" ); + } + + autend(); +} diff --git a/alliance/src/xgra/src/XMT_panel.h b/alliance/src/xgra/src/XMT_panel.h new file mode 100644 index 00000000..f73b232c --- /dev/null +++ b/alliance/src/xgra/src/XMT_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 : XGRA | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_TOOLS_PANEL +# define XGRA_TOOLS_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_TOOLS_MESSAGE_X 330 +# define XGRA_TOOLS_MESSAGE_Y 280 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void CallbackToolsCloseMessage(); + +# endif diff --git a/alliance/src/xgra/src/XMT_tools.c b/alliance/src/xgra/src/XMT_tools.c new file mode 100644 index 00000000..0a67b88f --- /dev/null +++ b/alliance/src/xgra/src/XMT_tools.c @@ -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 : XGRA | +| | +| File : Tools.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" +# include "XGR.h" +# include "XMV.h" +# include "XMT.h" + +# include "XMT_tools.h" +# include "XMT_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ diff --git a/alliance/src/xgra/src/XMT_tools.h b/alliance/src/xgra/src/XMT_tools.h new file mode 100644 index 00000000..17b84e6c --- /dev/null +++ b/alliance/src/xgra/src/XMT_tools.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 : XGRA | +| | +| File : Tools.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_TOOLS +# define XGRA_TOOLS + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XMV.h b/alliance/src/xgra/src/XMV.h new file mode 100644 index 00000000..adc48dd8 --- /dev/null +++ b/alliance/src/xgra/src/XMV.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 : XGRA | +| | +| File : XMV.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XMV +# define XGRA_XMV + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char XgraFirstViewLayer; + +/*------------------------------------------------------------\ +| | +| Panel And Menu | +| | +\------------------------------------------------------------*/ + + extern XgraMenuItem XgraViewMenu[]; + extern XgraPanelItem XgraViewArrowsPanel; + extern XgraPanelItem XgraViewZoomPanel; + extern XgraPanelItem XgraViewGridPanel; + extern XgraPanelItem XgraViewLayerPanel; + extern XgraPanelItem XgraViewMapPanel; + + extern int XgraPercentZoom; + extern int XgraPercentMoveX; + extern int XgraPercentMoveY; + + extern int XgraViewArrowsDefaultValues[5]; + extern int XgraViewZoomDefaultValues[5]; + extern int XgraViewLayerDefaultValues[5]; + extern int XgraViewGridDefaultValues[5]; + extern int XgraViewMapDefaultValues[5]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Values | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Zoom | +| | +\------------------------------------------------------------*/ + + extern void XgraComputeAndDisplayMap(); + extern void XgraInitializeZoom(); + extern void XgraBuildViewDialog(); + extern void XgraBuildPanelMap(); + extern void XgraInitializeMapEvent(); + + extern void XgraZoomCenter(); + extern void XgraZoomRefresh(); + extern void XgraZoomIn(); + extern void XgraZoomPan(); + + extern void XgraPromptZoomIn(); + extern void XgraPromptZoomPan(); + extern void XgraPromptZoomCenter(); + +# endif diff --git a/alliance/src/xgra/src/XMV_dialog.c b/alliance/src/xgra/src/XMV_dialog.c new file mode 100644 index 00000000..11165985 --- /dev/null +++ b/alliance/src/xgra/src/XMV_dialog.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 : XGRA | +| | +| File : Dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" +# include "XMV.h" + +# include "XMV_dialog.h" +# include "XMV_view.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Dialog Box | +| | +\------------------------------------------------------------*/ + + XgraDialogItem XgraViewZoomSetDialog = + + { + "Zoom set", + XGRA_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackViewZoomSetOk, + (XtPointer)NULL, + (void *)CallbackViewZoomSetCancel, + (XtPointer)NULL + }; + + XgraDialogItem XgraViewZoomGotoDialog = + + { + "Goto X,Y", + XGRA_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackViewZoomGotoOk, + (XtPointer)NULL, + (void *)CallbackViewZoomGotoCancel, + (XtPointer)NULL + }; + + XgraDialogItem XgraViewMoveSetDialog = + + { + "Move set dx,dy", + XGRA_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackViewMoveSetOk, + (XtPointer)NULL, + (void *)CallbackViewMoveSetCancel, + (XtPointer)NULL + }; + + XgraDialogItem XgraViewGridXDialog = + + { + "Grid X", + XGRA_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackViewGridXOk, + (XtPointer)NULL, + (void *)CallbackViewGridXCancel, + (XtPointer)NULL + }; + + XgraDialogItem XgraViewGridYDialog = + + { + "Grid Y", + XGRA_DIALOG_PROMPT, + (Widget)NULL, + (void *)CallbackViewGridYOk, + (XtPointer)NULL, + (void *)CallbackViewGridYCancel, + (XtPointer)NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Build Dialog Box | +| | +\------------------------------------------------------------*/ + +void XgraBuildViewDialog() + +{ + autbegin(); + + XgraBuildDialog( XgraMainWindow, &XgraViewZoomSetDialog ); + XgraBuildDialog( XgraMainWindow, &XgraViewZoomGotoDialog ); + XgraBuildDialog( XgraMainWindow, &XgraViewMoveSetDialog ); + XgraBuildDialog( XgraMainWindow, &XgraViewGridXDialog ); + XgraBuildDialog( XgraMainWindow, &XgraViewGridYDialog ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Dialog | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackViewZoomSetOk | +| | +\------------------------------------------------------------*/ + +void CallbackViewZoomSetOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *ZoomSet; + int ZoomPercent; + + autbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &ZoomSet ); + + XtUnmanageChild( XgraViewZoomSetDialog.WIDGET ); + + XgraExitDialog(); + + if ( ZoomSet != (char *)NULL ) + { + ZoomPercent = atoi( ZoomSet ); + + if ( ( ZoomPercent < XGRA_PERCENT_ZOOM_MIN ) || + ( ZoomPercent > XGRA_PERCENT_ZOOM_MAX ) ) + { + XgraErrorMessage( XgraMainWindow, "The value must be between 5% and 95% !" ); + } + else + { + XgraPercentZoom = ZoomPercent; + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewZoomSetCancel | +| | +\------------------------------------------------------------*/ + +void CallbackViewZoomSetCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + autbegin(); + + XtUnmanageChild( XgraViewZoomSetDialog.WIDGET ); + + XgraExitDialog(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewZoomGotoOk | +| | +\------------------------------------------------------------*/ + +void CallbackViewZoomGotoOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *ZoomGoto; + int Index; + long GotoX; + long GotoY; + + autbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &ZoomGoto ); + + XtUnmanageChild( XgraViewZoomGotoDialog.WIDGET ); + + XgraExitDialog(); + + if ( ZoomGoto != (char *)NULL ) + { + for ( Index = 0; ZoomGoto[ Index ]; Index++ ) + { + if ( ZoomGoto[ Index ] == ',' ) + { + ZoomGoto[ Index ] = '\0'; + + if ( Index == 0 ) + { + GotoX = XgraUnitGridX + ( XgraUnitGridDx >> 1 ); + } + else + { + GotoX = atoi( ZoomGoto ); + } + + if ( ZoomGoto[ Index + 1 ] == '\0' ) + { + GotoY = XgraUnitGridY + ( XgraUnitGridDy >> 1 ); + } + else + { + GotoY = atoi( ZoomGoto + Index + 1 ); + } + + ZoomGoto = (char *)NULL; + + XgraZoomCenter( GotoX, GotoY ); + + break; + } + } + + if ( ZoomGoto != (char *)NULL ) + { + XgraErrorMessage( XgraMainWindow, "A coordinate must be specified !" ); + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewZoomGotoCancel | +| | +\------------------------------------------------------------*/ + +void CallbackViewZoomGotoCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + autbegin(); + + XtUnmanageChild( XgraViewZoomGotoDialog.WIDGET ); + + XgraExitDialog(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewMoveSetOk | +| | +\------------------------------------------------------------*/ + +void CallbackViewMoveSetOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *MoveSet; + int MovePercentX; + int MovePercentY; + int Index; + + autbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &MoveSet ); + + XtUnmanageChild( XgraViewMoveSetDialog.WIDGET ); + + XgraExitDialog(); + + if ( MoveSet != (char *)NULL ) + { + for ( Index = 0; MoveSet[ Index ]; Index++ ) + { + if ( MoveSet[ Index ] == ',' ) + { + MoveSet[ Index ] = '\0'; + + MovePercentX = atoi( MoveSet ); + MovePercentY = atoi( MoveSet + Index + 1 ); + MoveSet = (char *)NULL; + + break; + } + } + + if ( MoveSet != (char *)NULL ) + { + MovePercentY = MovePercentX = atoi( MoveSet ); + } + + if ( ( MovePercentX < XGRA_PERCENT_MOVE_MIN ) || + ( MovePercentX > XGRA_PERCENT_MOVE_MAX ) || + ( MovePercentY < XGRA_PERCENT_MOVE_MIN ) || + ( MovePercentY > XGRA_PERCENT_MOVE_MAX ) ) + { + XgraErrorMessage( XgraMainWindow, "The values must be between 5% and 95% !" ); + } + else + { + XgraPercentMoveX = MovePercentX; + XgraPercentMoveY = MovePercentY; + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewMoveSetCancel | +| | +\------------------------------------------------------------*/ + +void CallbackViewMoveSetCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + autbegin(); + + XtUnmanageChild( XgraViewMoveSetDialog.WIDGET ); + + XgraExitDialog(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewGridXOk | +| | +\------------------------------------------------------------*/ + +void CallbackViewGridXOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *GridSet; + int GridPercent; + + autbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &GridSet ); + + XtUnmanageChild( XgraViewGridXDialog.WIDGET ); + + XgraExitDialog(); + + if ( GridSet != (char *)NULL ) + { + GridPercent = atoi( GridSet ); + + if ( GridPercent < 2 ) + { + XgraErrorMessage( XgraMainWindow, "The value must be greater than one !" ); + } + else + { + XgraUnitUserGridDx = GridPercent; + XgraZoomRefresh(); + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewGridXCancel | +| | +\------------------------------------------------------------*/ + +void CallbackViewGridXCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + autbegin(); + + XtUnmanageChild( XgraViewGridXDialog.WIDGET ); + + XgraExitDialog(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewGridYOk | +| | +\------------------------------------------------------------*/ + +void CallbackViewGridYOk( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + char *GridSet; + int GridPercent; + + autbegin(); + + XmStringGetLtoR( CallData->value, + XmSTRING_DEFAULT_CHARSET, + &GridSet ); + + XtUnmanageChild( XgraViewGridYDialog.WIDGET ); + + XgraExitDialog(); + + if ( GridSet != (char *)NULL ) + { + GridPercent = atoi( GridSet ); + + if ( GridPercent < 2 ) + { + XgraErrorMessage( XgraMainWindow, "The value must be greater than one !" ); + } + else + { + XgraUnitUserGridDy = GridPercent; + XgraZoomRefresh(); + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewGridYCancel | +| | +\------------------------------------------------------------*/ + +void CallbackViewGridYCancel( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + XmSelectionBoxCallbackStruct *CallData; +{ + autbegin(); + + XtUnmanageChild( XgraViewGridYDialog.WIDGET ); + + XgraExitDialog(); + + autend(); +} diff --git a/alliance/src/xgra/src/XMV_dialog.h b/alliance/src/xgra/src/XMV_dialog.h new file mode 100644 index 00000000..d26909e0 --- /dev/null +++ b/alliance/src/xgra/src/XMV_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 : XGRA | +| | +| File : Dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_VIEW_DIALOG +# define XGRA_VIEW_DIALOG + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern XgraDialogItem XgraViewZoomSetDialog; + extern XgraDialogItem XgraViewZoomGotoDialog; + extern XgraDialogItem XgraViewMoveSetDialog; + extern XgraDialogItem XgraViewGridXDialog; + extern XgraDialogItem XgraViewGridYDialog; + +/*------------------------------------------------------------\ +| | +| 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/xgra/src/XMV_map.c b/alliance/src/xgra/src/XMV_map.c new file mode 100644 index 00000000..d5c9167a --- /dev/null +++ b/alliance/src/xgra/src/XMV_map.c @@ -0,0 +1,754 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Map.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XTB.h" +# include "XMX.h" +# include "XMV.h" + +# include "XMV_map.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + XgraPanelItem XgraViewMapPanel = + + { + "Map", + 1, + 0, + XGRA_VIEW_MAP_X, + XGRA_VIEW_MAP_Y, + 190, + 200, + 0, + 0, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraPanelButtonItem *)NULL + }; + + int XgraViewMapDefaultValues[ 5 ] = + + { + XGRA_VIEW_MAP_X, + XGRA_VIEW_MAP_Y, + 190, 200, 0 + }; + +/*------------------------------------------------------------\ +| | +| Graphic Map Window | +| | +\------------------------------------------------------------*/ + + Widget XgraMapWindow; + Widget XgraMapButtonCompute; + Widget XgraMapButtonClose; + + Dimension XgraMapDx = 0; + Dimension XgraMapDy = 0; + + static char XgraFirstEnterMap = XGRA_TRUE; + static char XgraFirstExpose = XGRA_TRUE; + +/*------------------------------------------------------------\ +| | +| Unit Map | +| | +\------------------------------------------------------------*/ + + float XgraUnitMapStep; + + long XgraUnitMapX; + long XgraUnitMapY; + long XgraUnitMapDx; + long XgraUnitMapDy; + + long XgraBoundMapX; + long XgraBoundMapY; + long XgraBoundMapDx; + long XgraBoundMapDy; + + long XgraPixelMapX; + long XgraPixelMapY; + +/*------------------------------------------------------------\ +| | +| Expose | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Arclation | +| | +\------------------------------------------------------------*/ + + static String XgraMapEventArclation = + + ": 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; +{ + autbegin(); + + XgraExitPanel( &XgraViewMapPanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackMapCompute | +| | +\------------------------------------------------------------*/ + +void CallbackMapCompute( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraComputeAndDisplayMap(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackMapEvent | +| | +\------------------------------------------------------------*/ + +void CallbackMapEvent ( MyWidget, Event, Args, Argc ) + + Widget MyWidget; + XButtonEvent *Event; + String *Args; + int *Argc; +{ + Display *EventDisplay; + char MouseEvent; + long X; + long Y; + + autbegin(); + + EventDisplay = Event->display; + MouseEvent = Args[ 0 ][ 0 ] - '0'; + + X = Event->x; + Y = XgraMapDy - Event->y; + + X = X + XgraPixelMapX; + Y = Y + XgraPixelMapY; + + if ( X < 0 ) + { + X = ((float)(X) / XgraUnitMapStep) - 0.5 ; + } + else + { + X = ((float)(X) / XgraUnitMapStep) + 0.5 ; + } + + if ( Y < 0 ) + { + Y = ((float)(Y) / XgraUnitMapStep) - 0.5 ; + } + else + { + Y = ((float)(Y) / XgraUnitMapStep) + 0.5 ; + } + + switch ( MouseEvent ) + { + case XGRA_B1UP : + case XGRA_B2UP : + case XGRA_B3UP : + + XgraZoomCenter( X, Y ); + + break; + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackMapResize | +| | +\------------------------------------------------------------*/ + +void CallbackMapResize( MyWidget, ClientData, CallData ) + + Widget MyWidget; + XtPointer ClientData; + XmDrawingAreaCallbackStruct *CallData; +{ + if ( ! XgraFirstExpose ) + { + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + XgraResizeMapWindow(); + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); + } +} + +/*------------------------------------------------------------\ +| | +| CallbackMapExpose | +| | +\------------------------------------------------------------*/ + +void CallbackMapExpose( MyWidget, ClientData, CallData ) + + Widget MyWidget; + XtPointer ClientData; + XmDrawingAreaCallbackStruct *CallData; +{ + XExposeEvent *ExposeEvent; + + autbegin(); + + ExposeEvent = (XExposeEvent *)CallData->event; + + if ( XgraFirstExpose ) + { + XgraFirstExpose = XGRA_FALSE; + + XgraInitializeMapWindow(); + } + + XgraRefreshMapWindow(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Initialize Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgrasnitializeMapWindow | +| | +\------------------------------------------------------------*/ + +void XgraInitializeMapWindow() + +{ + autbegin(); + + XtVaGetValues( XgraMapWindow, + XmNwidth , &XgraMapDx, + XmNheight, &XgraMapDy, + NULL + ); + + XgraInitializeUnitMap(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Graphic Window Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraRefreshMapWindow | +| | +\------------------------------------------------------------*/ + +void XgraRefreshMapWindow() +{ + autbegin(); + + XgraClearMapWindow(); + XgraDisplayUnitMap(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraClearMapWindow | +| | +\------------------------------------------------------------*/ + +void XgraClearMapWindow() + +{ + XFillRectangle( XtDisplay( XgraMapWindow ), + XtWindow( XgraMapWindow ), + XgraBackgroundGC, + 0, 0, XgraMapDx, XgraMapDy ); +} + +/*------------------------------------------------------------\ +| | +| XgraResizeMapWindow | +| | +\------------------------------------------------------------*/ + +void XgraResizeMapWindow() + +{ + autbegin(); + + XtVaGetValues( XgraMapWindow, + XmNwidth, &XgraMapDx, + XmNheight, &XgraMapDy, + NULL + ); + + XgraComputeAndDisplayMap(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraInitializeMapEvent | +| | +\------------------------------------------------------------*/ + +void XgraInitializeMapEvent() + +{ + XtActionsRec NewActions; + + autbegin(); + + XtVaSetValues( XgraMapWindow, + XmNtranslations, + XtParseTranslationTable( XgraMapEventArclation ), + NULL + ); + + NewActions.string = "CallbackMapEvent"; + NewActions.proc = CallbackMapEvent; + + XtAppAddActions( XgraApplication, &NewActions, 1 ); + + XtAddCallback( XgraMapWindow, + XmNresizeCallback, + CallbackMapResize, NULL ); + + XtAddCallback( XgraMapWindow, + XmNexposeCallback, + CallbackMapExpose, NULL ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Unit Map Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraInitializeUnitMap | +| | +\------------------------------------------------------------*/ + +void XgraInitializeUnitMap() + +{ + autbegin(); + + if ( ! XgraComputeBound() ) + { + XgraBoundMapX = XGRA_DEFAULT_MAP_X; + XgraBoundMapY = XGRA_DEFAULT_MAP_Y; + XgraBoundMapDx = XGRA_DEFAULT_MAP_DX; + XgraBoundMapDy = XGRA_DEFAULT_MAP_DY; + } + else + { + XgraBoundMapX = XgraBoundXmin / XGRA_UNIT; + XgraBoundMapY = XgraBoundYmin / XGRA_UNIT; + XgraBoundMapDx = XgraBoundXmax / XGRA_UNIT; + XgraBoundMapDy = XgraBoundYmax / XGRA_UNIT; + XgraBoundMapDx = XgraBoundMapDx - XgraBoundMapX; + XgraBoundMapDy = XgraBoundMapDy - XgraBoundMapY; + } + + XgraUnitMapX = XgraBoundMapX - 2; + XgraUnitMapY = XgraBoundMapY - 2; + XgraUnitMapDx = XgraBoundMapDx + 4; + XgraUnitMapDy = XgraBoundMapDy + 4; + + XgraComputeUnitMap(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraComputeUnitMap | +| | +\------------------------------------------------------------*/ + +void XgraComputeUnitMap() + +{ + long Delta; + float StepX; + float StepY; + + autbegin(); + + StepX = (float)(XgraMapDx) / (float)(XgraUnitMapDx); + StepY = (float)(XgraMapDy) / (float)(XgraUnitMapDy); + + if ( StepX < StepY ) + { + XgraUnitMapStep = StepX; + Delta = XgraUnitMapDy; + XgraUnitMapDy = 1 + ( XgraMapDy / StepX ); + Delta = ( XgraUnitMapDy - Delta ) >> 1; + XgraUnitMapY = XgraUnitMapY - Delta; + } + else + { + XgraUnitMapStep = StepY; + Delta = XgraUnitMapDx; + XgraUnitMapDx = 1 + ( XgraMapDx / StepY ); + Delta = ( XgraUnitMapDx - Delta ) >> 1; + XgraUnitMapX = XgraUnitMapX - Delta; + } + + XgraPixelMapX = (float)(XgraUnitMapX) * XgraUnitMapStep; + XgraPixelMapY = (float)(XgraUnitMapY) * XgraUnitMapStep; + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDisplayUnitMap | +| | +\------------------------------------------------------------*/ + +void XgraDisplayUnitMap() +{ + long X1; + long Y1; + long X2; + long Y2; + + autbegin(); + + X1 = (float)( XgraBoundMapX ) * XgraUnitMapStep; + Y1 = (float)( XgraBoundMapY ) * XgraUnitMapStep; + X2 = (float)( XgraBoundMapX + XgraBoundMapDx ) * XgraUnitMapStep; + Y2 = (float)( XgraBoundMapY + XgraBoundMapDy ) * XgraUnitMapStep; + + X1 = X1 - XgraPixelMapX; + X2 = X2 - XgraPixelMapX; + Y1 = Y1 - XgraPixelMapY; + Y2 = Y2 - XgraPixelMapY; + + XDrawRectangle( XtDisplay( XgraMapWindow ), + XtWindow( XgraMapWindow ), + XgraLargeTextGC, + X1, XgraMapDy - Y2, + X2 - X1, Y2 - Y1 ); + + X1 = XgraUnitGridX + ( XgraUnitGridDx >> 1 ); + Y1 = XgraUnitGridY + ( XgraUnitGridDy >> 1 ); + X1 = (float)( X1 ) * XgraUnitMapStep; + Y1 = (float)( Y1 ) * XgraUnitMapStep; + + X1 = X1 - XgraPixelMapX; + Y1 = Y1 - XgraPixelMapY; + Y1 = XgraMapDy - Y1; + + if ( ( X1 > 0 ) && + ( Y1 > 0 ) && + ( X1 < XgraMapDx ) && + ( Y1 < XgraMapDy ) ) + { + XDrawLine( XtDisplay( XgraMapWindow ), + XtWindow( XgraMapWindow ), + XgraLargeTextGC, + X1 - 2, Y1, + X1 + 2, Y1 ); + + XDrawLine( XtDisplay( XgraMapWindow ), + XtWindow( XgraMapWindow ), + XgraLargeTextGC, + X1, Y1 - 2, + X1, Y1 + 2 ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraBuildPanelMap | +| | +\------------------------------------------------------------*/ + +void XgraBuildPanelMap() +{ + Arg Args[3]; + + autbegin(); + + XtSetArg( Args[0], XmNshadowType , XmSHADOW_ETCHED_IN ); + XtSetArg( Args[1], XmNdeleteResponse, XmDESTROY ); + XtSetArg( Args[2], XmNtitle , XgraViewMapPanel.TITLE ); + + XgraViewMapPanel.PANEL = + + XmCreateFormDialog( XgraMainWindow, "XgraViewMapPanel", Args, 3); + + XtAddCallback( XgraViewMapPanel.PANEL, XmNdestroyCallback, + XgraDestroyDialogCallback, NULL ); + + XgraViewMapPanel.PANEL_FORM = + + XtVaCreateManagedWidget( "XgraViewMapPanelForm", + xmFormWidgetClass, + XgraViewMapPanel.PANEL, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNfractionBase , 100, + NULL + ); + + XgraViewMapPanel.FRAME = + + XtVaCreateManagedWidget( "XgraViewMapFrame", + xmFrameWidgetClass, + XgraViewMapPanel.PANEL_FORM, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + NULL + ); + + XgraViewMapPanel.FORM = + + XtVaCreateManagedWidget( "XgraViewMapForm", + xmFormWidgetClass, + XgraViewMapPanel.FRAME, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNfractionBase , 100, + NULL + ); + + XgraMapButtonCompute = + + XtVaCreateManagedWidget( "Compute", + xmPushButtonWidgetClass, + XgraViewMapPanel.FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 1, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 44, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 89, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 99, + NULL + ); + XgraMapButtonClose = + + XtVaCreateManagedWidget( "Close", + xmPushButtonWidgetClass, + XgraViewMapPanel.FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , 45, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 99, + XmNtopAttachment , XmATTACH_POSITION, + XmNtopPosition , 89, + XmNbottomAttachment , XmATTACH_POSITION, + XmNbottomPosition , 99, + NULL + ); + + XgraMapWindow = + + XtVaCreateManagedWidget( "XgraMapWindow", + xmDrawingAreaWidgetClass, + XgraViewMapPanel.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( XgraMapButtonCompute, + XmNactivateCallback, + CallbackMapCompute, NULL ); + + XtAddCallback( XgraMapButtonClose, + XmNactivateCallback, + CallbackCloseMap, NULL ); + + XtVaSetValues( XgraViewMapPanel.PANEL, + XmNheight, XgraViewMapPanel.HEIGHT, + XmNwidth , XgraViewMapPanel.WIDTH, + XmNx , XgraViewMapPanel.X, + XmNy , XgraViewMapPanel.Y, + NULL ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraEnterMapPanel | +| | +\------------------------------------------------------------*/ + +void XgraEnterMapPanel() + +{ + autbegin(); + + XgraFirstEnterMap = XGRA_FALSE; + + XgraEnterPanel( &XgraViewMapPanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraComputeAndDisplayMap | +| | +\------------------------------------------------------------*/ + +void XgraComputeAndDisplayMap() + +{ + + if ( ! XgraFirstEnterMap ) + { + autbegin(); + + XgraInitializeUnitMap(); + XgraClearMapWindow(); + XgraDisplayUnitMap(); + + autend(); + } +} diff --git a/alliance/src/xgra/src/XMV_map.h b/alliance/src/xgra/src/XMV_map.h new file mode 100644 index 00000000..a70375a8 --- /dev/null +++ b/alliance/src/xgra/src/XMV_map.h @@ -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 : XGRA | +| | +| File : Map.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_MAP +# define XGRA_MAP + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_B1UP 0 +# define XGRA_B2UP 1 +# define XGRA_B3UP 2 + +# define XGRA_VIEW_MAP_X 25 +# define XGRA_VIEW_MAP_Y 520 + +# define XGRA_DEFAULT_MAP_X 0 +# define XGRA_DEFAULT_MAP_Y 0 +# define XGRA_DEFAULT_MAP_DX 40 +# define XGRA_DEFAULT_MAP_DY 40 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern Widget XgraMapPanel; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraComputeUnitMap(); + extern void XgraInitializeUnitMap(); + extern void XgraDisplayUnitMap(); + + extern void XgraEnterMapPanel(); + extern void XgraClearMapWindow(); + extern void XgraResizeMapWindow(); + extern void XgraRefreshMapWindow(); + extern void XgraInitializeMapWindow(); + + extern void CallbackCloseMap(); + extern void CallbackMapCompute(); + extern void CallbackMapResize(); + extern void CallbackMapExpose(); + extern void CallbackMapEvent(); + +# endif diff --git a/alliance/src/xgra/src/XMV_menu.c b/alliance/src/xgra/src/XMV_menu.c new file mode 100644 index 00000000..a23554cf --- /dev/null +++ b/alliance/src/xgra/src/XMV_menu.c @@ -0,0 +1,282 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" +# include "XMV.h" + +# include "XMV_menu.h" +# include "XMV_dialog.h" +# include "XMV_view.h" +# include "XMV_map.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + char XgraFirstViewLayer = 1; + +/*------------------------------------------------------------\ +| | +| Menu | +| | +\------------------------------------------------------------*/ + + XgraMenuItem XgraViewMenu[] = + + { + { + "Zoom", + 'Z', + "MetaZ", + "Meta Z", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackViewZoom, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + { + "Layers ", + 'L', + "MetaL", + "Meta L", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackViewLayer, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + { + "Map", + 'M', + "MetaP", + "Meta P", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackViewMap, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + { + "Arrows ", + 'A', + "MetaA", + "Meta A", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackViewArrows, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + { + "Grid ", + 'G', + "MetaG", + "Meta G", + &xmPushButtonGadgetClass, + False, + False, + False, + CallbackViewGrid, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + (XgraMenuItem *)NULL + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback For Menu | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackViewLayer | +| | +\------------------------------------------------------------*/ + +void CallbackViewLayer( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + if ( XgraFirstViewLayer ) + { + XgraFirstViewLayer = 0; + + XgraInitializeLayer(); + } + + XgraEnterPanel( &XgraViewLayerPanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewGrid | +| | +\------------------------------------------------------------*/ + +void CallbackViewGrid( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterPanel( &XgraViewGridPanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewArrows | +| | +\------------------------------------------------------------*/ + +void CallbackViewArrows( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterPanel( &XgraViewArrowsPanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewZoom | +| | +\------------------------------------------------------------*/ + +void CallbackViewZoom( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterPanel( &XgraViewZoomPanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackViewMap | +| | +\------------------------------------------------------------*/ + +void CallbackViewMap( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterMapPanel(); + + autend(); +} diff --git a/alliance/src/xgra/src/XMV_menu.h b/alliance/src/xgra/src/XMV_menu.h new file mode 100644 index 00000000..fd43433f --- /dev/null +++ b/alliance/src/xgra/src/XMV_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 : XGRA | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_VIEW_MENU +# define XGRA_VIEW_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback View Menu | +| | +\------------------------------------------------------------*/ + + + extern void CallbackViewZoom(); + extern void CallbackViewGrid(); + extern void CallbackViewLayer(); + extern void CallbackViewMap(); + extern void CallbackViewArrows(); + +# endif diff --git a/alliance/src/xgra/src/XMV_message.c b/alliance/src/xgra/src/XMV_message.c new file mode 100644 index 00000000..a12de754 --- /dev/null +++ b/alliance/src/xgra/src/XMV_message.c @@ -0,0 +1,155 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Message.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XTB.h" +# include "XMV.h" +# include "XMV_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraPromptZoomIn | +| | +\------------------------------------------------------------*/ + +void XgraPromptZoomIn() + +{ + autbegin(); + + XgraDisplayMessage( XGRA_MESSAGE_MODE, "Zoom In" ); + XgraDisplayMessage( XGRA_MESSAGE_INFO, "Select window" ); + + switch ( XgraCountEventZoom ) + { + case 0 : + + XgraDisplayMessage( XGRA_MESSAGE_PROMPT, "Enter first corner" ); + + break; + + case 1 : + + XgraDisplayMessage( XGRA_MESSAGE_PROMPT, "Enter second corner" ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraPromptZoomPan | +| | +\------------------------------------------------------------*/ + +void XgraPromptZoomPan() + +{ + autbegin(); + + XgraDisplayMessage( XGRA_MESSAGE_MODE, "Zoom Pan" ); + XgraDisplayMessage( XGRA_MESSAGE_INFO, "Select line" ); + + switch ( XgraCountEventZoom ) + { + case 0 : + + XgraDisplayMessage( XGRA_MESSAGE_PROMPT, "Enter source point" ); + + break; + + case 1 : + + XgraDisplayMessage( XGRA_MESSAGE_PROMPT, "Enter target point" ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraPromptZoomCenter | +| | +\------------------------------------------------------------*/ + +void XgraPromptZoomCenter() + +{ + autbegin(); + + XgraDisplayMessage( XGRA_MESSAGE_MODE, "Zoom Center" ); + XgraDisplayMessage( XGRA_MESSAGE_INFO, "Select point" ); + XgraDisplayMessage( XGRA_MESSAGE_PROMPT, "Enter center point" ); + + autend(); +} + diff --git a/alliance/src/xgra/src/XMV_message.h b/alliance/src/xgra/src/XMV_message.h new file mode 100644 index 00000000..72f930d6 --- /dev/null +++ b/alliance/src/xgra/src/XMV_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 : XGRA | +| | +| File : Message.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_MESSAGE +# define XGRA_MESSAGE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraPromptZoomIn(); + extern void XgraPromptZoomCenter(); + extern void XgraPromptZoomPan(); + +# endif diff --git a/alliance/src/xgra/src/XMV_panel.c b/alliance/src/xgra/src/XMV_panel.c new file mode 100644 index 00000000..4a528d62 --- /dev/null +++ b/alliance/src/xgra/src/XMV_panel.c @@ -0,0 +1,1903 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" +# include "XMV.h" + +# include "XMV_panel.h" +# include "XMV_dialog.h" +# include "XMV_view.h" +# include "XMV_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Panel Pixmap | +| | +\------------------------------------------------------------*/ + + static char XgraPixmapDownArrow[] = + + { + 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 XgraPixmapLeftArrow[] = + + { + 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 XgraPixmapRightArrow[] = + + { + 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 XgraPixmapUpArrow[] = + + { + 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 char *XgraPanelArrowsButtonName[] = + + { + "Left", + "Up", + "Down", + "Right", + "Move Set", + "Close" + }; + + static XgraPanelButtonItem XgraViewArrowsButton[] = + + { + { + &XgraPanelArrowsButtonName[0], + NULL, XgraPixmapLeftArrow, 32, 32, + NULL, + NULL, + 0, 0, + 1, 2, + CallbackLeftArrow, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelArrowsButtonName[1], + NULL, XgraPixmapUpArrow, 32, 32, + NULL, + NULL, + 1, 0, + 1, 2, + CallbackUpArrow, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelArrowsButtonName[2], + NULL, XgraPixmapDownArrow, 32, 32, + NULL, + NULL, + 0, 2, + 1, 2, + CallbackDownArrow, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelArrowsButtonName[3], + NULL, XgraPixmapRightArrow, 32, 32, + NULL, + NULL, + 1, 2, + 1, 2, + CallbackRightArrow, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelArrowsButtonName[4], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 4, + 2, 1, + CallbackMoveSet, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelArrowsButtonName[5], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 5, + 2, 1, + CallbackCloseArrows, + (XtPointer)NULL, + (Widget)NULL + } + , + NULL + }; + + XgraPanelItem XgraViewArrowsPanel = + + { + "Arrows", + 1, + 0, + XGRA_VIEW_ARROWS_X, + XGRA_VIEW_ARROWS_Y, + 100, + 125, + 2, + 6, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + XgraViewArrowsButton + }; + + int XgraViewArrowsDefaultValues[ 5 ] = + + { + XGRA_VIEW_ARROWS_X, + XGRA_VIEW_ARROWS_Y, + 100, 125 , 1 + }; + +/*------------------------------------------------------------\ +| | +| Panel Zoom | +| | +\------------------------------------------------------------*/ + + static char *XgraPanelZoomButtonName[] = + + { + "Refresh", + "UnZoom", + "Zoom", + "Mooz", + "Zoom Set", + "Zoom In", + "Center", + "Goto", + "Pan", + "Fit", + "Close" + }; + + + XgraPanelButtonItem XgraViewZoomButton[] = + + { + { + &XgraPanelZoomButtonName[0], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackZoomRefresh, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelZoomButtonName[1], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 1, + 1, 1, + CallbackZoomPrevious, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelZoomButtonName[2], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 2, + 1, 1, + CallbackZoomMore, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelZoomButtonName[3], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 3, + 1, 1, + CallbackZoomLess, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelZoomButtonName[4], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 4, + 1, 1, + CallbackZoomSet, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelZoomButtonName[5], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 5, + 1, 1, + CallbackZoomIn, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelZoomButtonName[6], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 6, + 1, 1, + CallbackZoomCenter, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelZoomButtonName[7], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 7, + 1, 1, + CallbackZoomGoto, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelZoomButtonName[8], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 8, + 1, 1, + CallbackZoomPan, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelZoomButtonName[9], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 9, + 1, 1, + CallbackZoomFit, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelZoomButtonName[10], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 10, + 1, 1, + CallbackCloseZoom, + (XtPointer)NULL, + (Widget)NULL + } + , + NULL + }; + + XgraPanelItem XgraViewZoomPanel = + + { + "Zoom", + 1, + 0, + XGRA_VIEW_ZOOM_X, + XGRA_VIEW_ZOOM_Y, + 100, + 275, + 1, + 11, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + XgraViewZoomButton + }; + + int XgraViewZoomDefaultValues[ 5 ] = + + { + XGRA_VIEW_ZOOM_X, + XGRA_VIEW_ZOOM_Y, + 100, 275, 1 + }; + +/*------------------------------------------------------------\ +| | +| Panel Grid | +| | +\------------------------------------------------------------*/ + + static char *XgraPanelGridButtonName[] = + + { + "Grid X", + "Grid Y", + "Grid Off", + "Close" + }; + + + XgraPanelButtonItem XgraViewGridButton[] = + + { + { + &XgraPanelGridButtonName[0], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackSetGridX, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelGridButtonName[1], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 1, + 1, 1, + CallbackSetGridY, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelGridButtonName[2], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 2, + 1, 1, + CallbackGridOnOff, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelGridButtonName[3], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 3, + 1, 1, + CallbackCloseGrid, + (XtPointer)NULL, + (Widget)NULL + } + , + NULL + }; + + XgraPanelItem XgraViewGridPanel = + + { + "Grid", + 1, + 0, + XGRA_VIEW_GRID_X, + XGRA_VIEW_GRID_Y, + 100, + 100, + 1, + 4, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + XgraViewGridButton + }; + + int XgraViewGridDefaultValues[ 5 ] = + + { + XGRA_VIEW_GRID_X, + XGRA_VIEW_GRID_Y, + 100, 100, 0 + }; + +/*------------------------------------------------------------\ +| | +| Panel Layer | +| | +\------------------------------------------------------------*/ + + static char *XgraViewLayerButtonBackground = "Black"; + static char *XgraViewLayerButtonForeground = "White"; + + static char *XgraPanelLayerButtonName[] = + + { + "All visible", + "All invisible", + "Node Text", + "Arc Text", + "Apply", + "Close" + }; + + XgraPanelButtonItem XgraViewLayerButton[] = + + { + { + &XgraPanelLayerButtonName[0], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 0, + 1, 1, + CallbackLayerAllVisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelLayerButtonName[1], + NULL, NULL, 0, 0, + NULL, + NULL, + 1, 0, + 1, 1, + CallbackLayerAllInvisible, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 0 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 0 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 0 ][ 2 ], + 0, 1, + 1, 1, + CallbackLayerVisible, + (XtPointer)0, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 0 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 0 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 0 ][ 2 ], + 1, 1, + 1, 1, + CallbackLayerInvisible, + (XtPointer)0, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 1 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 1 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 1 ][ 2 ], + 0, 2, + 1, 1, + CallbackLayerVisible, + (XtPointer)1, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 1 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 1 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 1 ][ 2 ], + 1, 2, + 1, 1, + CallbackLayerInvisible, + (XtPointer)1, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 2 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 2 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 2 ][ 2 ], + 0, 3, + 1, 1, + CallbackLayerVisible, + (XtPointer)2, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 2 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 2 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 2 ][ 2 ], + 1, 3, + 1, 1, + CallbackLayerInvisible, + (XtPointer)2, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 3 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 3 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 3 ][ 2 ], + 0, 4, + 1, 1, + CallbackLayerVisible, + (XtPointer)3, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 3 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 3 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 3 ][ 2 ], + 1, 4, + 1, 1, + CallbackLayerInvisible, + (XtPointer)3, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 4 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 4 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 4 ][ 2 ], + 0, 5, + 1, 1, + CallbackLayerVisible, + (XtPointer)4, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 4 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 4 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 4 ][ 2 ], + 1, 5, + 1, 1, + CallbackLayerInvisible, + (XtPointer)4, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 5 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 5 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 5 ][ 2 ], + 0, 6, + 1, 1, + CallbackLayerVisible, + (XtPointer)5, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 5 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 5 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 5 ][ 2 ], + 1, 6, + 1, 1, + CallbackLayerInvisible, + (XtPointer)5, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 6 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 6 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 6 ][ 2 ], + 0, 7, + 1, 1, + CallbackLayerVisible, + (XtPointer)6, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 6 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 6 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 6 ][ 2 ], + 1, 7, + 1, 1, + CallbackLayerInvisible, + (XtPointer)6, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 7 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 7 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 7 ][ 2 ], + 0, 8, + 1, 1, + CallbackLayerVisible, + (XtPointer)7, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 7 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 7 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 7 ][ 2 ], + 1, 8, + 1, 1, + CallbackLayerInvisible, + (XtPointer)7, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 8 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 8 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 8 ][ 2 ], + 0, 9, + 1, 1, + CallbackLayerVisible, + (XtPointer)8, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 8 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 8 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 8 ][ 2 ], + 1, 9, + 1, 1, + CallbackLayerInvisible, + (XtPointer)8, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 9 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 9 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 9 ][ 2 ], + 0, 10, + 1, 1, + CallbackLayerVisible, + (XtPointer)9, + (Widget)NULL + } + , + { + &XGRA_LAYER_NAME_TABLE[ 9 ][ 0 ], + NULL, NULL, 0, 0, + &XGRA_LAYER_NAME_TABLE[ 9 ][ 1 ], + &XGRA_LAYER_NAME_TABLE[ 9 ][ 2 ], + 1, 10, + 1, 1, + CallbackLayerInvisible, + (XtPointer)9, + (Widget)NULL + } + , + { + &XgraPanelLayerButtonName[2], + NULL, NULL, 0, 0, + &XgraViewLayerButtonForeground, + &XgraViewLayerButtonBackground, + 0, 11, + 1, 1, + CallbackNameVisible, + (XtPointer)0, + (Widget)NULL + } + , + { + &XgraPanelLayerButtonName[2], + NULL, NULL, 0, 0, + &XgraViewLayerButtonForeground, + &XgraViewLayerButtonBackground, + 1, 11, + 1, 1, + CallbackNameInvisible, + (XtPointer)0, + (Widget)NULL + } + , + { + &XgraPanelLayerButtonName[3], + NULL, NULL, 0, 0, + &XgraViewLayerButtonForeground, + &XgraViewLayerButtonBackground, + 0, 12, + 1, 1, + CallbackNameVisible, + (XtPointer)1, + (Widget)NULL + } + , + { + &XgraPanelLayerButtonName[3], + NULL, NULL, 0, 0, + &XgraViewLayerButtonForeground, + &XgraViewLayerButtonBackground, + 1, 12, + 1, 1, + CallbackNameInvisible, + (XtPointer)1, + (Widget)NULL + } + , + { + &XgraPanelLayerButtonName[4], + NULL, NULL, 0, 0, + NULL, + NULL, + 0, 13, + 1, 1, + CallbackLayerApply, + (XtPointer)NULL, + (Widget)NULL + } + , + { + &XgraPanelLayerButtonName[5], + NULL, NULL, 0, 0, + NULL, + NULL, + 1, 13, + 1, 1, + CallbackCloseLayer, + (XtPointer)NULL, + (Widget)NULL + } + , + NULL + }; + + XgraPanelItem XgraViewLayerPanel = + + { + "Layer", + 1, + 0, + XGRA_VIEW_LAYER_X, + XGRA_VIEW_LAYER_Y, + 200, + 350, + 2, + 14, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + (Widget)NULL, + XgraViewLayerButton + }; + + int XgraViewLayerDefaultValues[ 5 ] = + + { + XGRA_VIEW_LAYER_X, + XGRA_VIEW_LAYER_Y, + 200, 350, 0 + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Callback For Arrows | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackLeftArrow | +| | +\------------------------------------------------------------*/ + +void CallbackLeftArrow( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraZoomLeft(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackRightArrow | +| | +\------------------------------------------------------------*/ + +void CallbackRightArrow( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraZoomRight(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackUpArrow | +| | +\------------------------------------------------------------*/ + +void CallbackUpArrow( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraZoomUp(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackDownArrow | +| | +\------------------------------------------------------------*/ + +void CallbackDownArrow( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraZoomDown(); + + autend(); +} + + +/*------------------------------------------------------------\ +| | +| CallbackMoveSet | +| | +\------------------------------------------------------------*/ + +void CallbackMoveSet( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterDialog( &XgraViewMoveSetDialog ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackCloseArrows | +| | +\------------------------------------------------------------*/ + +void CallbackCloseArrows( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraExitPanel( &XgraViewArrowsPanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Zoom Callback | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackZoomRefresh | +| | +\------------------------------------------------------------*/ + +void CallbackZoomRefresh( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraZoomRefresh(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomPrevious | +| | +\------------------------------------------------------------*/ + +void CallbackZoomPrevious( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraZoomUndo(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomLess | +| | +\------------------------------------------------------------*/ + +void CallbackZoomLess( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraZoomLess(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomMore | +| | +\------------------------------------------------------------*/ + +void CallbackZoomMore( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraZoomMore(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomSet | +| | +\------------------------------------------------------------*/ + +void CallbackZoomSet( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterDialog( &XgraViewZoomSetDialog ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackCloseZoom | +| | +\------------------------------------------------------------*/ + +void CallbackCloseZoom( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraExitPanel( &XgraViewZoomPanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomIn | +| | +\------------------------------------------------------------*/ + +void CallbackZoomIn( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraChangeEditMode( XGRA_ZOOM_IN, + XgraPromptZoomIn ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomCenter | +| | +\------------------------------------------------------------*/ + +void CallbackZoomCenter( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraChangeEditMode( XGRA_ZOOM_CENTER, + XgraPromptZoomCenter ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomGoto | +| | +\------------------------------------------------------------*/ + +void CallbackZoomGoto( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterDialog( &XgraViewZoomGotoDialog ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomPan | +| | +\------------------------------------------------------------*/ + +void CallbackZoomPan( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraChangeEditMode( XGRA_ZOOM_PAN, + XgraPromptZoomPan ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackZoomFit | +| | +\------------------------------------------------------------*/ + +void CallbackZoomFit( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraZoomFit(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Grid | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackSetGridX | +| | +\------------------------------------------------------------*/ + +void CallbackSetGridX( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterDialog( &XgraViewGridXDialog ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackSetGridY | +| | +\------------------------------------------------------------*/ + +void CallbackSetGridY( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraEnterDialog( &XgraViewGridYDialog ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackGridOnOff | +| | +\------------------------------------------------------------*/ + +void CallbackGridOnOff( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + XmString Label; + + autbegin(); + + XgraUnitUserGrid = ! XgraUnitUserGrid; + + if ( XgraUnitUserGrid == XGRA_FALSE ) + { + Label = XmStringCreateSimple( "Grid Off" ); + } + else + { + Label = XmStringCreateSimple( "Grid On" ); + } + + XtVaSetValues( MyWidget, XmNlabelString, Label, + XmNresizable , False, + NULL ); + XmStringFree( Label ); + + XgraZoomRefresh(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackCloseGrid | +| | +\------------------------------------------------------------*/ + +void CallbackCloseGrid( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraExitPanel( &XgraViewGridPanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Callback For Layer | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| CallbackLayerAllVisible | +| | +\------------------------------------------------------------*/ + +void CallbackLayerAllVisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraLayerAllVisible(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerAllInvisible | +| | +\------------------------------------------------------------*/ + +void CallbackLayerAllInvisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraLayerAllInvisible(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerVisible | +| | +\------------------------------------------------------------*/ + +void CallbackLayerVisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + if ( XGRA_ACTIVE_LAYER_TABLE[ (int)ClientData ] == 0 ) + { + XgraSetLayerVisible( (int)ClientData ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerInvisible | +| | +\------------------------------------------------------------*/ + +void CallbackLayerInvisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + if ( XGRA_ACTIVE_LAYER_TABLE[ (int)ClientData ] ) + { + XgraSetLayerInvisible( (int)ClientData ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackNameVisible | +| | +\------------------------------------------------------------*/ + +void CallbackNameVisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + if ( XGRA_ACTIVE_NAME_TABLE[ (int)ClientData ] == 0 ) + { + XgraSetNameVisible( ClientData ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackNameInvisible | +| | +\------------------------------------------------------------*/ + +void CallbackNameInvisible( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + if ( XGRA_ACTIVE_NAME_TABLE[ (int)ClientData ] ) + { + XgraSetNameInvisible( ClientData ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackLayerApply | +| | +\------------------------------------------------------------*/ + +void CallbackLayerApply( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraZoomRefresh(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackCloseLayer | +| | +\------------------------------------------------------------*/ + +void CallbackCloseLayer( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + autbegin(); + + XgraExitPanel( &XgraViewLayerPanel ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraSetLayerVisible | +| | +\------------------------------------------------------------*/ + +void XgraSetLayerVisible( Layer ) + + int Layer; +{ + int Index; + char *Background; + char *Foreground; + + autbegin(); + + Index = ( Layer << 1 ) + 2; + + if ( XgraViewLayerButton[ Index ].BUTTON != NULL ) + { + XGRA_ACTIVE_LAYER_TABLE[ Layer ] = 1; + + XtVaSetValues( XgraViewLayerButton[ Index + 1 ].BUTTON, + XtVaTypedArg , + XmNbackground , + XmRString , + XGRA_BLACK_COLOR_NAME , + strlen( XGRA_BLACK_COLOR_NAME ) + 1 , + NULL + ); + + XtVaSetValues( XgraViewLayerButton[ Index + 1 ].BUTTON, + XtVaTypedArg , + XmNforeground , + XmRString , + XGRA_BLACK_COLOR_NAME , + strlen( XGRA_BLACK_COLOR_NAME ) + 1 , + NULL + ); + + Background = *XgraViewLayerButton[ Index ].BACKGROUND; + Foreground = *XgraViewLayerButton[ Index ].FOREGROUND; + + XtVaSetValues( XgraViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNbackground , + XmRString , + Background , + strlen( Background ) + 1, + NULL + ); + + XtVaSetValues( XgraViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNforeground , + XmRString , + Foreground , + strlen( Foreground ) + 1, + NULL + ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraSetNameVisible | +| | +\------------------------------------------------------------*/ + +void XgraSetNameVisible( Name ) + + int Name; +{ + int Index; + char *Background; + char *Foreground; + + autbegin(); + + Index = 2 + ( ( XGRA_MAX_LAYER + Name ) << 1 ); + + if ( XgraViewLayerButton[ Index ].BUTTON != NULL ) + { + XGRA_ACTIVE_NAME_TABLE[ Name ] = 1; + + XtVaSetValues( XgraViewLayerButton[ Index + 1 ].BUTTON, + XtVaTypedArg , + XmNbackground , + XmRString , + XGRA_BLACK_COLOR_NAME , + strlen( XGRA_BLACK_COLOR_NAME ) + 1, + NULL + ); + + XtVaSetValues( XgraViewLayerButton[ Index + 1 ].BUTTON, + XtVaTypedArg , + XmNforeground , + XmRString , + XGRA_BLACK_COLOR_NAME , + strlen( XGRA_BLACK_COLOR_NAME ) + 1 , + NULL + ); + + Background = *XgraViewLayerButton[ Index ].BACKGROUND; + Foreground = *XgraViewLayerButton[ Index ].FOREGROUND; + + XtVaSetValues( XgraViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNbackground , + XmRString , + Background , + strlen( Background ) + 1, + NULL + ); + + XtVaSetValues( XgraViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNforeground , + XmRString , + Foreground , + strlen( Foreground ) + 1, + NULL + ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraSetLayerInvisible | +| | +\------------------------------------------------------------*/ + +void XgraSetLayerInvisible( Layer ) + + int Layer; +{ + int Index; + char *Background; + char *Foreground; + + autbegin(); + + Index = 3 + ( Layer << 1 ); + + if ( XgraViewLayerButton[ Index ].BUTTON != NULL ) + { + XGRA_ACTIVE_LAYER_TABLE[ Layer ] = 0; + + XtVaSetValues( XgraViewLayerButton[ Index - 1 ].BUTTON, + XtVaTypedArg , + XmNbackground , + XmRString , + XGRA_BLACK_COLOR_NAME , + strlen( XGRA_BLACK_COLOR_NAME ) + 1 , + NULL + ); + + XtVaSetValues( XgraViewLayerButton[ Index - 1 ].BUTTON, + XtVaTypedArg , + XmNforeground , + XmRString , + XGRA_BLACK_COLOR_NAME , + strlen( XGRA_BLACK_COLOR_NAME ) + 1 , + NULL + ); + + Background = *XgraViewLayerButton[ Index ].BACKGROUND; + Foreground = *XgraViewLayerButton[ Index ].FOREGROUND; + + XtVaSetValues( XgraViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNbackground , + XmRString , + Background , + strlen( Background ) + 1 , + NULL + ); + + XtVaSetValues( XgraViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNforeground , + XmRString , + Foreground , + strlen( Foreground ) + 1 , + NULL + ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraSetNameInvisible | +| | +\------------------------------------------------------------*/ + +void XgraSetNameInvisible( Name ) + + int Name; +{ + int Index; + char *Background; + char *Foreground; + + autbegin(); + + Index = 3 + ( ( XGRA_MAX_LAYER + Name ) << 1 ); + + if ( XgraViewLayerButton[ Index ].BUTTON != NULL ) + { + XGRA_ACTIVE_NAME_TABLE[ Name ] = 0; + + XtVaSetValues( XgraViewLayerButton[ Index - 1 ].BUTTON, + XtVaTypedArg , + XmNbackground , + XmRString , + XGRA_BLACK_COLOR_NAME , + strlen( XGRA_BLACK_COLOR_NAME ) + 1 , + NULL + ); + + XtVaSetValues( XgraViewLayerButton[ Index - 1 ].BUTTON, + XtVaTypedArg , + XmNforeground , + XmRString , + XGRA_BLACK_COLOR_NAME , + strlen( XGRA_BLACK_COLOR_NAME ) + 1 , + NULL + ); + + Background = *XgraViewLayerButton[ Index ].BACKGROUND; + Foreground = *XgraViewLayerButton[ Index ].FOREGROUND; + + XtVaSetValues( XgraViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNbackground , + XmRString , + Background , + strlen( Background ) + 1 , + NULL + ); + + XtVaSetValues( XgraViewLayerButton[ Index ].BUTTON , + XtVaTypedArg , + XmNforeground , + XmRString , + Foreground , + strlen( Foreground ) + 1 , + NULL + ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraLayerAllVisible | +| | +\------------------------------------------------------------*/ + +void XgraLayerAllVisible() + +{ + int Index; + + autbegin(); + + for ( Index = 0; Index < XGRA_MAX_LAYER; Index++ ) + { + XgraSetLayerVisible( Index ); + } + + for ( Index = 0; Index < XGRA_MAX_ACTIVE_NAME; Index++ ) + { + XgraSetNameVisible( Index ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraInitializeLayer | +| | +\------------------------------------------------------------*/ + +void XgraInitializeLayer() + +{ + int Index; + + autbegin(); + + for ( Index = 0; Index < XGRA_MAX_LAYER; Index++ ) + { + if ( XGRA_ACTIVE_LAYER_TABLE[ Index ] == 0 ) + { + XgraSetLayerInvisible( Index ); + } + else + { + XgraSetLayerVisible( Index ); + } + } + + for ( Index = 0; Index < XGRA_MAX_ACTIVE_NAME; Index++ ) + { + if ( XGRA_ACTIVE_NAME_TABLE[ Index ] == 0 ) + { + XgraSetNameInvisible( Index ); + } + else + { + XgraSetNameVisible( Index ); + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraLayerAllInvisible | +| | +\------------------------------------------------------------*/ + +void XgraLayerAllInvisible() + +{ + int Index; + + autbegin(); + + for ( Index = 0; Index < XGRA_MAX_LAYER; Index++ ) + { + XgraSetLayerInvisible( Index ); + } + + for ( Index = 0; Index < XGRA_MAX_ACTIVE_NAME; Index++ ) + { + XgraSetNameInvisible( Index ); + } + + autend(); +} diff --git a/alliance/src/xgra/src/XMV_panel.h b/alliance/src/xgra/src/XMV_panel.h new file mode 100644 index 00000000..8e3ac8a5 --- /dev/null +++ b/alliance/src/xgra/src/XMV_panel.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 : XGRA | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_VIEW_PANEL +# define XGRA_VIEW_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_VIEW_ARROWS_X 990 +# define XGRA_VIEW_ARROWS_Y 80 +# define XGRA_VIEW_ZOOM_X 990 +# define XGRA_VIEW_ZOOM_Y 230 +# define XGRA_VIEW_GRID_X 470 +# define XGRA_VIEW_GRID_Y 330 +# define XGRA_VIEW_LAYER_X 430 +# define XGRA_VIEW_LAYER_Y 190 + +/*------------------------------------------------------------\ +| | +| 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 CallbackSetGridX(); + extern void CallbackSetGridY(); + extern void CallbackGridOnOff(); + extern void CallbackCloseGrid(); + + extern void CallbackLayerAllVisible(); + extern void CallbackLayerAllInvisible(); + extern void CallbackLayerVisible(); + extern void CallbackLayerInvisible(); + extern void CallbackNameVisible(); + extern void CallbackNameInvisible(); + extern void CallbackLayerApply(); + extern void CallbackCloseLayer(); + + extern void XgraSetLayerVisible(); + extern void XgraSetLayerInvisible(); + extern void XgraSetNameVisible(); + extern void XgraSetNameInvisible(); + extern void XgraLayerAllVisible(); + extern void XgraLayerAllInvisible(); + +# endif diff --git a/alliance/src/xgra/src/XMV_view.c b/alliance/src/xgra/src/XMV_view.c new file mode 100644 index 00000000..deb76429 --- /dev/null +++ b/alliance/src/xgra/src/XMV_view.c @@ -0,0 +1,670 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : View.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XGR.h" +# include "XMX.h" +# include "XMV.h" + +# include "XMV_view.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + xgrazoom *XgraHeadZoom = (xgrazoom *)NULL; + + int XgraPercentZoom = XGRA_PERCENT_ZOOM; + int XgraPercentMoveX = XGRA_PERCENT_MOVE; + int XgraPercentMoveY = XGRA_PERCENT_MOVE; + +/*------------------------------------------------------------\ +| | +| Menu | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraAllocZoom | +| | +\------------------------------------------------------------*/ + +xgrazoom *XgraAllocZoom () + +{ + return ( (xgrazoom *) autalloc( sizeof ( xgrazoom ), 1)); +} + +/*------------------------------------------------------------\ +| | +| XgraFreeZoom | +| | +\------------------------------------------------------------*/ + +void XgraFreeZoom ( FreeZoom ) + + xgrazoom *FreeZoom; + +{ + autfree( (char *)FreeZoom, sizeof(FreeZoom) ); +} + +/*------------------------------------------------------------\ +| | +| XgraAddZoom | +| | +\------------------------------------------------------------*/ + +void XgraAddZoom () + +{ + xgrazoom *XgraZoom; + + autbegin(); + + XgraZoom = XgraAllocZoom (); + XgraZoom->X = XgraUnitGridX; + XgraZoom->Y = XgraUnitGridY; + XgraZoom->DX = XgraUnitGridDx; + XgraZoom->DY = XgraUnitGridDy; + XgraZoom->NEXT = XgraHeadZoom; + XgraHeadZoom = XgraZoom; + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDelZoom | +| | +\------------------------------------------------------------*/ + +char XgraDelZoom() + +{ + xgrazoom *XgraZoom; + + if ( XgraHeadZoom != (xgrazoom *) NULL ) + { + autbegin(); + + XgraZoom = XgraHeadZoom; + XgraHeadZoom = XgraHeadZoom->NEXT; + XgraFreeZoom( XgraZoom ); + + autend(); + return( XGRA_TRUE ); + } + + return( XGRA_FALSE ); +} + +/*------------------------------------------------------------\ +| | +| XgraInitializeZoom | +| | +\------------------------------------------------------------*/ + +void XgraInitializeZoom() + +{ + autbegin(); + + while( XgraDelZoom() != XGRA_FALSE ); + + if ( XgraComputeBound() == XGRA_FALSE ) + { + XgraInitializeUnitGrid(); + } + else + { + XgraUnitGridX = ( XgraBoundXmin / XGRA_UNIT ) - 1; + XgraUnitGridY = ( XgraBoundYmin / XGRA_UNIT ) - 1; + XgraUnitGridDx = ( XgraBoundXmax / XGRA_UNIT ); + XgraUnitGridDy = ( XgraBoundYmax / XGRA_UNIT ); + XgraUnitGridDx = XgraUnitGridDx - XgraUnitGridX + 1; + XgraUnitGridDy = XgraUnitGridDy - XgraUnitGridY + 1; + + XgraComputeUnitGrid(); + } + + XgraComputeAndDisplayMap(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraZoomUndo | +| | +\------------------------------------------------------------*/ + +void XgraZoomUndo() + +{ + autbegin(); + + if ( XgraHeadZoom == (xgrazoom *)NULL ) + { + XgraErrorMessage( XgraMainWindow, "No previous zoom !" ); + } + else + { + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + XgraUnitGridX = XgraHeadZoom->X; + XgraUnitGridY = XgraHeadZoom->Y; + XgraUnitGridDx = XgraHeadZoom->DX; + XgraUnitGridDy = XgraHeadZoom->DY; + + XgraComputeUnitGrid(); + XgraComputeAndDisplayMap(); + + XgraDisplayFigure( 0, 0, + XgraGraphicDx, XgraGraphicDy ); + + XgraRefreshGraphicWindow( 0, 0, + XgraGraphicDx, XgraGraphicDy); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + XgraDelZoom(); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraZoomRight | +| | +\------------------------------------------------------------*/ + +void XgraZoomRight() + +{ + long Delta; + long Offset; + long XgraOldPixelGridX; + + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + Delta = ( XgraPercentMoveX * XgraUnitGridDx ) / 100; + + if ( Delta == 0 ) Delta = 1; + + XgraUnitGridX = XgraUnitGridX + Delta; + XgraOldPixelGridX = XgraPixelGridX; + XgraPixelGridX = (float)(XgraUnitGridX) * XgraUnitGridStep; + Offset = XgraPixelGridX - XgraOldPixelGridX; + + XCopyArea( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraGraphicPixmap, + XgraBackgroundGC, + Offset, 0, + XgraGraphicDx - Offset, + XgraGraphicDy, + 0, 0 + ); + + XgraComputeAndDisplayMap(); + XgraDisplayFigure( XgraGraphicDx - Offset, 0, + XgraGraphicDx, XgraGraphicDy ); + XgraRefreshGraphicWindow( 0, 0, + XgraGraphicDx, XgraGraphicDy); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraZoomLeft | +| | +\------------------------------------------------------------*/ + +void XgraZoomLeft() + +{ + long Delta; + long Offset; + long XgraOldPixelGridX; + + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + Delta = ( XgraPercentMoveX * XgraUnitGridDx ) / 100; + + if ( Delta == 0 ) Delta = 1; + + XgraUnitGridX = XgraUnitGridX - Delta; + XgraOldPixelGridX = XgraPixelGridX; + XgraPixelGridX = (float)(XgraUnitGridX) * XgraUnitGridStep; + Offset = XgraOldPixelGridX - XgraPixelGridX; + + XCopyArea( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraGraphicPixmap, + XgraBackgroundGC, + 0, 0, + XgraGraphicDx - Offset, + XgraGraphicDy, + Offset, 0 + ); + + XgraComputeAndDisplayMap(); + XgraDisplayFigure( 0, 0, Offset, XgraGraphicDy ); + XgraRefreshGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraZoomDown | +| | +\------------------------------------------------------------*/ + +void XgraZoomDown() + +{ + long Delta; + long Offset; + long XgraOldPixelGridY; + + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + Delta = ( XgraPercentMoveY * XgraUnitGridDy ) / 100; + + if ( Delta == 0 ) Delta = 1; + + XgraUnitGridY = XgraUnitGridY - Delta; + XgraOldPixelGridY = XgraPixelGridY; + XgraPixelGridY = (float)(XgraUnitGridY) * XgraUnitGridStep; + Offset = XgraOldPixelGridY - XgraPixelGridY; + + XCopyArea( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraGraphicPixmap, + XgraBackgroundGC, + 0, Offset, + XgraGraphicDx, + XgraGraphicDy - Offset, + 0, 0 + ); + + XgraComputeAndDisplayMap(); + XgraDisplayFigure( 0, 0, XgraGraphicDx, Offset ); + XgraRefreshGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraZoomUp | +| | +\------------------------------------------------------------*/ + +void XgraZoomUp() + +{ + long Delta; + long Offset; + long XgraOldPixelGridY; + + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + Delta = ( XgraPercentMoveY * XgraUnitGridDy ) / 100; + + if ( Delta == 0 ) Delta = 1; + + XgraUnitGridY = XgraUnitGridY + Delta; + XgraOldPixelGridY = XgraPixelGridY; + XgraPixelGridY = (float)(XgraUnitGridY) * XgraUnitGridStep; + Offset = XgraPixelGridY - XgraOldPixelGridY; + + XCopyArea( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraGraphicPixmap, + XgraBackgroundGC, + 0, 0, + XgraGraphicDx, + XgraGraphicDy - Offset, + 0, Offset + ); + + XgraComputeAndDisplayMap(); + XgraDisplayFigure( 0, XgraGraphicDy - Offset, + XgraGraphicDx, XgraGraphicDy ); + XgraRefreshGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraZoomMore | +| | +\------------------------------------------------------------*/ + +void XgraZoomMore() + +{ + long DeltaX; + long DeltaY; + + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + DeltaX = ( XgraPercentZoom * XgraUnitGridDx ) / 100; + DeltaY = ( XgraPercentZoom * XgraUnitGridDy ) / 100; + + if ( ( DeltaX >= 2 ) && + ( DeltaY >= 2 ) ) + { + XgraAddZoom(); + + XgraUnitGridX = XgraUnitGridX + (DeltaX >> 1); + XgraUnitGridY = XgraUnitGridY + (DeltaY >> 1); + XgraUnitGridDx = XgraUnitGridDx - DeltaX; + XgraUnitGridDy = XgraUnitGridDy - DeltaY; + + XgraComputeUnitGrid(); + XgraComputeAndDisplayMap(); + XgraDisplayFigure( 0, 0, XgraGraphicDx, XgraGraphicDy ); + XgraRefreshGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy ); + } + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraZoomLess | +| | +\------------------------------------------------------------*/ + +void XgraZoomLess() + +{ + long DeltaX; + long DeltaY; + + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + DeltaX = 100 * XgraUnitGridDx / ( 100 - XgraPercentZoom ); + DeltaY = 100 * XgraUnitGridDy / ( 100 - XgraPercentZoom ); + + XgraAddZoom(); + + XgraUnitGridX = XgraUnitGridX - ((DeltaX - XgraUnitGridDx) >> 1); + XgraUnitGridY = XgraUnitGridY - ((DeltaY - XgraUnitGridDy) >> 1); + XgraUnitGridDx = DeltaX; + XgraUnitGridDy = DeltaY; + + XgraComputeUnitGrid(); + XgraComputeAndDisplayMap(); + XgraDisplayFigure( 0, 0, XgraGraphicDx, XgraGraphicDy ); + XgraRefreshGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy ); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraZoomFit | +| | +\------------------------------------------------------------*/ + +void XgraZoomFit() + +{ + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + if ( XgraComputeBound() == XGRA_FALSE ) + { + XgraErrorMessage( XgraMainWindow, "No element to display !" ); + } + else + { + XgraAddZoom(); + + XgraUnitGridX = ( XgraBoundXmin / XGRA_UNIT ) - 1; + XgraUnitGridY = ( XgraBoundYmin / XGRA_UNIT ) - 1; + XgraUnitGridDx = XgraBoundXmax / XGRA_UNIT; + XgraUnitGridDy = XgraBoundYmax / XGRA_UNIT; + XgraUnitGridDx = XgraUnitGridDx - XgraUnitGridX + 1; + XgraUnitGridDy = XgraUnitGridDy - XgraUnitGridY + 1; + + XgraComputeUnitGrid(); + XgraComputeAndDisplayMap(); + XgraDisplayFigure( 0, 0, XgraGraphicDx, XgraGraphicDy ); + XgraRefreshGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy ); + } + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraZoomCenter | +| | +\------------------------------------------------------------*/ + +void XgraZoomCenter( UnitX, UnitY ) + + long UnitX; + long UnitY; +{ + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + XgraUnitGridX = UnitX - ( XgraUnitGridDx >> 1 ); + XgraUnitGridY = UnitY - ( XgraUnitGridDy >> 1 ); + + XgraComputeUnitGrid(); + XgraComputeAndDisplayMap(); + XgraDisplayFigure( 0, 0, XgraGraphicDx, XgraGraphicDy ); + XgraRefreshGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy ); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraZoomIn | +| | +\------------------------------------------------------------*/ + +void XgraZoomIn( UnitX1, UnitY1, UnitX2, UnitY2 ) + + long UnitX1; + long UnitY1; + long UnitX2; + long UnitY2; +{ + long Swap; + + autbegin(); + + if ( ( UnitX1 != UnitX2 ) && + ( UnitY1 != UnitY2 ) ) + { + if ( UnitX1 > UnitX2 ) + { + Swap = UnitX1; UnitX1 = UnitX2; UnitX2 = Swap; + } + + if ( UnitY1 > UnitY2 ) + { + Swap = UnitY1; UnitY1 = UnitY2; UnitY2 = Swap; + } + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + XgraAddZoom(); + + XgraUnitGridX = UnitX1; + XgraUnitGridY = UnitY1; + XgraUnitGridDx = UnitX2 - UnitX1; + XgraUnitGridDy = UnitY2 - UnitY1; + + XgraComputeUnitGrid(); + XgraComputeAndDisplayMap(); + XgraDisplayFigure( 0, 0, XgraGraphicDx, XgraGraphicDy ); + XgraRefreshGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy ); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraZoomPan | +| | +\------------------------------------------------------------*/ + +void XgraZoomPan( UnitX1, UnitY1, UnitX2, UnitY2 ) + + long UnitX1; + long UnitY1; + long UnitX2; + long UnitY2; +{ + if ( ( UnitX1 != UnitX2 ) || + ( UnitY1 != UnitY2 ) ) + { + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + XgraUnitGridX = XgraUnitGridX + ( UnitX1 - UnitX2 ); + XgraUnitGridY = XgraUnitGridY + ( UnitY1 - UnitY2 ); + + XgraComputeUnitGrid(); + XgraComputeAndDisplayMap(); + XgraDisplayFigure( 0, 0, XgraGraphicDx, XgraGraphicDy ); + XgraRefreshGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy ); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); + } +} + +/*------------------------------------------------------------\ +| | +| XgraZoomRefresh | +| | +\------------------------------------------------------------*/ + +void XgraZoomRefresh() + +{ + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + + XgraDisplayFigure( 0, 0, XgraGraphicDx, XgraGraphicDy ); + XgraRefreshGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy ); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); +} diff --git a/alliance/src/xgra/src/XMV_view.h b/alliance/src/xgra/src/XMV_view.h new file mode 100644 index 00000000..03858ac4 --- /dev/null +++ b/alliance/src/xgra/src/XMV_view.h @@ -0,0 +1,108 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : View.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_VIEW +# define XGRA_VIEW + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_PERCENT_ZOOM 30 +# define XGRA_PERCENT_ZOOM_MIN 5 +# define XGRA_PERCENT_ZOOM_MAX 95 + +# define XGRA_PERCENT_MOVE 30 +# define XGRA_PERCENT_MOVE_MIN 5 +# define XGRA_PERCENT_MOVE_MAX 95 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ + + typedef struct xgrazoom + { + struct xgrazoom *NEXT; + + long X; + long Y; + long DX; + long DY; + + } xgrazoom; + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern int XgraPercentZoom; + extern int XgraPercentMove; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraZoomUndo(); + extern void XgraZoomRefresh(); + + extern void XgraZoomLeft(); + extern void XgraZoomRight(); + extern void XgraZoomUp(); + extern void XgraZoomDown(); + + extern void XgraZoomMore(); + extern void XgraZoomLess(); + + extern void XgraZoomFit(); + +# endif diff --git a/alliance/src/xgra/src/XMX.h b/alliance/src/xgra/src/XMX.h new file mode 100644 index 00000000..d104f7b8 --- /dev/null +++ b/alliance/src/xgra/src/XMX.h @@ -0,0 +1,274 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : XMX.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XMX +# define XGRA_XMX + +/*------------------------------------------------------------\ +| | +| Graphic Context | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Colors Define | +| | +\------------------------------------------------------------*/ + +# define XGRA_BLACK_COLOR_NAME "Black" + +/*------------------------------------------------------------\ +| | +| Xgra Message | +| | +\------------------------------------------------------------*/ + +# define XGRA_MAX_MESSAGE 7 + +# define XGRA_MESSAGE_X 0 +# define XGRA_MESSAGE_Y 1 +# define XGRA_MESSAGE_DX 2 +# define XGRA_MESSAGE_DY 3 +# define XGRA_MESSAGE_MODE 4 +# define XGRA_MESSAGE_INFO 5 +# define XGRA_MESSAGE_PROMPT 6 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Xgra Widget | +| | +\------------------------------------------------------------*/ + + extern XtAppContext XgraApplication; + extern Widget XgraTopLevel; + extern Widget XgraMainWindow; + extern Widget XgraMainForm; + + extern Widget XgraMenuBar; + + extern Widget XgraGraphicFrame; + extern Widget XgraGraphicWindow; + extern Display *XgraGraphicDisplay; + + extern Widget XgraMessageMainPaned; + extern Widget XgraMessageMainForm; + extern Widget XgraMessageForm [ XGRA_MAX_MESSAGE ]; + extern Widget XgraMessageText [ XGRA_MAX_MESSAGE ]; + extern Widget XgraMessageLabel [ XGRA_MAX_MESSAGE ]; + extern Widget XgraMessageFrame [ XGRA_MAX_MESSAGE ]; + +/*------------------------------------------------------------\ +| | +| Xgra Graphic Context | +| | +\------------------------------------------------------------*/ + + extern GC XgraBackgroundGC; + extern GC XgraGridGC; + extern GC XgraXorGC; + extern GC XgraAcceptDrawGC; + extern GC XgraConnectDrawGC; + extern GC XgraLayerDrawGC[ XGRA_MAX_LAYER ]; + extern GC XgraSmallTextGC; + extern GC XgraMediumTextGC; + extern GC XgraLargeTextGC; + + extern XFontStruct *XgraSmallTextFont; + extern XFontStruct *XgraLargeTextFont; + extern XFontStruct *XgraMediumTextFont; + +/*------------------------------------------------------------\ +| | +| Xgra Graphic Pixmap | +| | +\------------------------------------------------------------*/ + + extern Pixmap XgraGraphicPixmap; + +/*------------------------------------------------------------\ +| | +| Xgra Graphic Size | +| | +\------------------------------------------------------------*/ + + extern Dimension XgraOldGraphicDx; + extern Dimension XgraOldGraphicDy; + extern Dimension XgraGraphicDx; + extern Dimension XgraGraphicDy; + +/*------------------------------------------------------------\ +| | +| Xgra Unit Grid | +| | +\------------------------------------------------------------*/ + + extern float XgraUnitGridStep; + extern long XgraUnitGridX; + extern long XgraUnitGridY; + extern long XgraUnitGridDx; + extern long XgraUnitGridDy; + extern long XgraPixelGridX; + extern long XgraPixelGridY; + +/*------------------------------------------------------------\ +| | +| User Unit Grid | +| | +\------------------------------------------------------------*/ + + extern long XgraUnitUserGridDx; + extern long XgraUnitUserGridDy; + extern char XgraUnitUserGrid; + +/*------------------------------------------------------------\ +| | +| Xgra Cursor | +| | +\------------------------------------------------------------*/ + + extern long XgraUnitCursorX; + extern long XgraUnitCursorY; + +/*------------------------------------------------------------\ +| | +| Xgra Event | +| | +\------------------------------------------------------------*/ + + extern char XgraCountEventZoom; + extern char XgraCountEventEdit; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraInitializeRessources | +| | +\------------------------------------------------------------*/ + + extern void XgraInitializeRessources(); + +/*------------------------------------------------------------\ +| | +| Xgra Change Title | +| | +\------------------------------------------------------------*/ + + extern void XgraChangeTopLevelTitle(); + +/*------------------------------------------------------------\ +| | +| Xgra Edit Mode | +| | +\------------------------------------------------------------*/ + + extern void XgraChangeEditMode(); + extern void XgraContinueEditMode(); + +/*------------------------------------------------------------\ +| | +| XgraDisplayMessage | +| | +\------------------------------------------------------------*/ + + extern void XgraDisplayMessage(); + extern void XgraPromptEditMeasure(); + +/*------------------------------------------------------------\ +| | +| Xgra Graphic Window | +| | +\------------------------------------------------------------*/ + + extern void XgraClearGraphicWindow(); + extern void XgraResizeGraphicWindow(); + extern void XgraRefreshGraphicWindow(); + +/*------------------------------------------------------------\ +| | +| Xgra Unit Grid | +| | +\------------------------------------------------------------*/ + + extern void XgraComputeUnitGrid(); + extern void XgraResizeUnitGrid(); + +/*------------------------------------------------------------\ +| | +| Xgra Display Figure | +| | +\------------------------------------------------------------*/ + + extern void XgraDisplayFigure(); + extern void XgraDisplayObject(); + +/*------------------------------------------------------------\ +| | +| Xgra Cursor | +| | +\------------------------------------------------------------*/ + + extern void XgraDisplayCursor(); + extern void XgraUndisplayCursor(); + +# endif diff --git a/alliance/src/xgra/src/XMX_color.c b/alliance/src/xgra/src/XMX_color.c new file mode 100644 index 00000000..95843775 --- /dev/null +++ b/alliance/src/xgra/src/XMX_color.c @@ -0,0 +1,291 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Colors.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XMX_color.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + GC XgraBackgroundGC; + GC XgraGridGC; + GC XgraAcceptDrawGC; + GC XgraConnectDrawGC; + GC XgraLayerDrawGC[ XGRA_MAX_LAYER ]; + + GC XgraSmallTextGC; + GC XgraMediumTextGC; + GC XgraLargeTextGC; + GC XgraXorGC; + + XFontStruct *XgraLargeTextFont; + XFontStruct *XgraMediumTextFont; + XFontStruct *XgraSmallTextFont; + +/*------------------------------------------------------------\ +| | +| Layer Color Define | +| | +\------------------------------------------------------------*/ + + static char **XgraColorName[ 5 ] = + + { + &XGRA_BACKGROUND_COLOR_NAME, + &XGRA_FOREGROUND_COLOR_NAME, + &XGRA_CURSOR_COLOR_NAME, + &XGRA_ACCEPT_COLOR_NAME, + &XGRA_CONNECT_COLOR_NAME + }; + + static int XgraColor[ XGRA_MAX_COLOR ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraInitializeColors | +| | +\------------------------------------------------------------*/ + +void XgraInitializeColors() + +{ + XColor ForgetIt; + XColor GetIt; + Window Root; + int Counter; + Colormap ColorMap; + char Error; + char *ColorName; + + autbegin(); + + ColorMap = DefaultColormapOfScreen ( XtScreen ( XgraGraphicWindow ) ); + Error = False; + + for ( Counter = 0; Counter < XGRA_MAX_COLOR; Counter++ ) + { + if ( Counter < 5 ) + { + ColorName = *XgraColorName[ Counter ]; + } + else + { + ColorName = XGRA_LAYER_NAME_TABLE[ Counter - 5 ][ 1 ]; + } + + if ( ColorName != (char *)NULL ) + { + if ( ! XAllocNamedColor( XgraGraphicDisplay, + ColorMap, ColorName, + &GetIt, &ForgetIt ) ) + { + fprintf ( stderr, "\nXmx100: Color name '%s' is not in X11 database !\n", + ColorName ); + + Error = True; + } + + XgraColor[ Counter ] = GetIt.pixel; + } + else + { + XgraColor[ Counter ] = XgraColor[ 0 ]; + } + } + + if ( Error == True ) exit( 1 ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraInitializeGraphicContext | +| | +\------------------------------------------------------------*/ + +void XgraInitializeGraphicContext() + +{ + XGCValues GraphicValue; + int Counter; + Window Root; + + autbegin(); + + XgraLargeTextFont = XLoadQueryFont( XgraGraphicDisplay, + XGRA_LARGE_TEXT_FONT_NAME ); + + XgraMediumTextFont = XLoadQueryFont( XgraGraphicDisplay, + XGRA_MEDIUM_TEXT_FONT_NAME ); + + XgraSmallTextFont = XLoadQueryFont( XgraGraphicDisplay, + XGRA_SMALL_TEXT_FONT_NAME ); + + GraphicValue.foreground = XgraColor[ 0 ]; /* Black */ + GraphicValue.background = XgraColor[ 0 ]; + GraphicValue.plane_mask = AllPlanes; + + Root = RootWindowOfScreen ( XtScreen ( XgraGraphicWindow ) ), + + XgraBackgroundGC = XCreateGC ( XgraGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + GraphicValue.foreground = XgraColor[ 1 ]; /* White */ + + XgraGridGC = XCreateGC ( XgraGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + GraphicValue.foreground = XgraColor[ 1 ]; /* Text */ + + XgraSmallTextGC = XCreateGC ( XgraGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + XgraMediumTextGC = XCreateGC ( XgraGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + XgraLargeTextGC = XCreateGC ( XgraGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + XSetFont( XgraGraphicDisplay, + XgraSmallTextGC, XgraSmallTextFont->fid ); + + XSetFont( XgraGraphicDisplay, + XgraMediumTextGC, XgraMediumTextFont->fid ); + + XSetFont( XgraGraphicDisplay, + XgraLargeTextGC, XgraLargeTextFont->fid ); + + GraphicValue.background = XgraColor[ 2 ]; /* Xor Color */ + GraphicValue.foreground = XgraColor[ 2 ]; /* Xor Color */ + GraphicValue.function = GXxor; + + XgraXorGC = XCreateGC ( XgraGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCFunction | + GCPlaneMask ), + &GraphicValue ); + + GraphicValue.background = XgraColor[ 0 ]; /* Black */ + GraphicValue.foreground = XgraColor[ 3 ]; /* Accept Color */ + + XgraAcceptDrawGC = XCreateGC ( XgraGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + GraphicValue.foreground = XgraColor[ 4 ]; /* Connect Color */ + + XgraConnectDrawGC = XCreateGC ( XgraGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + + for ( Counter = 0; Counter < XGRA_MAX_LAYER; Counter++ ) + { + GraphicValue.foreground = XgraColor[ Counter + 5 ]; + + XgraLayerDrawGC[ Counter ] = + + XCreateGC ( XgraGraphicDisplay, + Root, + ( GCForeground | + GCBackground | + GCPlaneMask ), + &GraphicValue ); + } + + autend(); +} diff --git a/alliance/src/xgra/src/XMX_color.h b/alliance/src/xgra/src/XMX_color.h new file mode 100644 index 00000000..e2ec0be1 --- /dev/null +++ b/alliance/src/xgra/src/XMX_color.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 : XGRA | +| | +| File : Color.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_COLOR +# define XGRA_COLOR + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Pattern | +| | +\------------------------------------------------------------*/ + +# define XGRA_MAX_COLOR ( 5 + XGRA_MAX_LAYER ) + +# define XGRA_LARGE_TEXT_FONT_NAME "9x15" +# define XGRA_MEDIUM_TEXT_FONT_NAME "7x13" +# define XGRA_SMALL_TEXT_FONT_NAME "5x8" + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraInitializeGraphicContext(); + extern void XgraInitializeColors(); + +# endif diff --git a/alliance/src/xgra/src/XMX_cursor.c b/alliance/src/xgra/src/XMX_cursor.c new file mode 100644 index 00000000..9352c27c --- /dev/null +++ b/alliance/src/xgra/src/XMX_cursor.c @@ -0,0 +1,514 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Cursor.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XMX_grid.h" +# include "XMX_cursor.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Buffer | +| | +\------------------------------------------------------------*/ + + static char XgraCursorBuffer[ XGRA_MAX_CURSOR_BUFFER ]; + +/*------------------------------------------------------------\ +| | +| Coordinates | +| | +\------------------------------------------------------------*/ + + Position XgraCursorX = 0; + Position XgraCursorY = 0; + Position XgraCursorSaveX = 0; + Position XgraCursorSaveY = 0; + char XgraCursorSaved = XGRA_FALSE; + char XgraCursorInside = XGRA_FALSE; + char XgraCursorType = XGRA_INPUT_HALF_BOX; + + long XgraUnitCursorX = 0; + long XgraUnitCursorY = 0; + long XgraPixelCursorX = 0; + long XgraPixelCursorY = 0; + + long XgraUnitCursorSaveX[ 2 ] = { 0, 0 }; + long XgraUnitCursorSaveY[ 2 ] = { 0, 0 }; + char XgraCursorIndex = 0; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraComputeCursor | +| | +\------------------------------------------------------------*/ + +void XgraComputeCursor( X, Y ) + + Position X; + Position Y; +{ + autbegin(); + + Y = XgraGraphicDy - Y; + + XgraUnitCursorX = X + XgraPixelGridX; + XgraUnitCursorY = Y + XgraPixelGridY; + + if ( XgraUnitCursorX < 0 ) + { + XgraUnitCursorX = ((float)(XgraUnitCursorX) / XgraUnitGridStep) - 0.5 ; + } + else + { + XgraUnitCursorX = ((float)(XgraUnitCursorX) / XgraUnitGridStep) + 0.5 ; + } + + if ( XgraUnitCursorY < 0 ) + { + XgraUnitCursorY = ((float)(XgraUnitCursorY) / XgraUnitGridStep) - 0.5 ; + } + else + { + XgraUnitCursorY = ((float)(XgraUnitCursorY) / XgraUnitGridStep) + 0.5 ; + } + + XgraPixelCursorX = ((float)(XgraUnitCursorX) * XgraUnitGridStep); + XgraPixelCursorY = ((float)(XgraUnitCursorY) * XgraUnitGridStep); + + XgraCursorX = XgraPixelCursorX - XgraPixelGridX; + XgraCursorY = XgraPixelCursorY - XgraPixelGridY; + XgraCursorY = XgraGraphicDy - XgraCursorY; + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDisplayCoordinates | +| | +\------------------------------------------------------------*/ + +void XgraDisplayCoordinates() + +{ + autbegin(); + + sprintf( XgraCursorBuffer, "%d", XgraUnitCursorX ); + XgraDisplayMessage( XGRA_MESSAGE_X, XgraCursorBuffer ); + + sprintf( XgraCursorBuffer, "%d", XgraUnitCursorY ); + XgraDisplayMessage( XGRA_MESSAGE_Y, XgraCursorBuffer ); + + sprintf( XgraCursorBuffer, "%d", XgraUnitCursorX - XgraUnitCursorSaveX[0] ); + XgraDisplayMessage( XGRA_MESSAGE_DX, XgraCursorBuffer ); + + sprintf( XgraCursorBuffer, "%d", XgraUnitCursorY - XgraUnitCursorSaveY[0] ); + XgraDisplayMessage( XGRA_MESSAGE_DY, XgraCursorBuffer ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraPointCursor | +| | +\------------------------------------------------------------*/ + +void XgraPointCursor() + +{ + autbegin(); + + XgraUndisplayCursor(); + + XgraUnitCursorSaveX[ XgraCursorIndex ] = XgraUnitCursorX; + XgraUnitCursorSaveY[ XgraCursorIndex ] = XgraUnitCursorY; + + XgraCursorIndex = XgraCursorIndex + 1; + + XgraDisplayCursor(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraResetCursor | +| | +\------------------------------------------------------------*/ + +void XgraResetCursor() + +{ + autbegin(); + + XgraUndisplayCursor(); + + XgraCursorIndex = XgraCursorIndex - 1; + + XgraDisplayCursor(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraChangeCursor | +| | +\------------------------------------------------------------*/ + +void XgraChangeCursorType( ArrayX, ArrayY, Index, Type ) + + long *ArrayX; + long *ArrayY; + char Index; + char Type; +{ + autbegin(); + + XgraUndisplayCursor(); + + XgraCursorType = Type; + XgraCursorIndex = Index; + + if ( Index != 0 ) + { + XgraUnitCursorSaveX[ 0 ] = ArrayX[0]; + XgraUnitCursorSaveY[ 0 ] = ArrayY[0]; + XgraUnitCursorSaveX[ 1 ] = ArrayX[1]; + XgraUnitCursorSaveY[ 1 ] = ArrayY[1]; + } + + XgraDisplayCursor(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDrawCursor | +| | +\------------------------------------------------------------*/ + +void XgraDrawCursor() + +{ + long X1; + long Y1; + long X2; + long Y2; + long DeltaX; + long DeltaY; + long Swap; + char DrawLine; + + autbegin(); + + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + XgraCursorSaveX - XGRA_CURSOR_SIZE, + XgraCursorSaveY - XGRA_CURSOR_SIZE, + XgraCursorSaveX + XGRA_CURSOR_SIZE, + XgraCursorSaveY + XGRA_CURSOR_SIZE ); + + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + XgraCursorSaveX - XGRA_CURSOR_SIZE, + XgraCursorSaveY + XGRA_CURSOR_SIZE, + XgraCursorSaveX + XGRA_CURSOR_SIZE, + XgraCursorSaveY - XGRA_CURSOR_SIZE ); + + if ( XgraCursorIndex > 0 ) + { + X1 = (float)(XgraUnitCursorSaveX[0]) * XgraUnitGridStep; + Y1 = (float)(XgraUnitCursorSaveY[0]) * XgraUnitGridStep; + X1 = X1 - XgraPixelGridX; + Y1 = Y1 - XgraPixelGridY; + Y1 = XgraGraphicDy - Y1; + + if ( XgraCursorIndex == 1 ) + { + X2 = XgraCursorSaveX; + Y2 = XgraCursorSaveY; + } + else + { + X2 = (float)(XgraUnitCursorSaveX[1]) * XgraUnitGridStep; + Y2 = (float)(XgraUnitCursorSaveY[1]) * XgraUnitGridStep; + X2 = X2 - XgraPixelGridX; + Y2 = Y2 - XgraPixelGridY; + Y2 = XgraGraphicDy - Y2; + } + + switch( XgraCursorType ) + { + case XGRA_INPUT_POINT : + + break; + + case XGRA_INPUT_LINE : + + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + X1, Y1, X2, Y2 ); + break; + + case XGRA_INPUT_HALF_BOX : + + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + X1, Y1, X2, Y1 ); + + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + X2, Y1, X2, Y2 ); + break; + + case XGRA_INPUT_ORTHO : + case XGRA_INPUT_SORTHO : + case XGRA_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 > XgraGraphicDx ) X2 = XgraGraphicDx; + + if ( ( X1 < X2 ) && + ( Y1 >= 0 ) && + ( Y1 <= XgraGraphicDy ) ) + { + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + X1, Y1, X2, Y2 ); + } + } + else + { + X2 = X1; + + if ( Y1 > Y2 ) { Swap = Y1; Y1 = Y2; Y2 = Swap; } + + if ( Y1 < 0 ) Y1 = 0; + if ( Y2 > XgraGraphicDy ) Y2 = XgraGraphicDy; + + if ( ( Y1 < Y2 ) && + ( X1 >= 0 ) && + ( X1 <= XgraGraphicDx ) ) + { + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + X1, Y1, X2, Y2 ); + } + } + + break; + + case XGRA_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 |= XGRA_WEST; } + if ( X2 > XgraGraphicDx ) { X2 = XgraGraphicDx; DrawLine |= XGRA_EAST; } + if ( Y1 < 0 ) { Y1 = 0; DrawLine |= XGRA_SOUTH; } + if ( Y2 > XgraGraphicDy ) { Y2 = XgraGraphicDy; DrawLine |= XGRA_NORTH; } + + if ( DrawLine == 0 ) + { + XDrawRectangle( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + X1, Y1, + X2 - X1, Y2 - Y1 ); + } + else + { + if ( ( DrawLine & XGRA_WEST ) == 0 ) + { + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + X1, Y2, + X1, Y1 ); + } + + if ( ( DrawLine & XGRA_EAST ) == 0 ) + { + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + X2, Y2, + X2, Y1 ); + } + + if ( ( DrawLine & XGRA_SOUTH ) == 0 ) + { + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + X1, Y1, + X2, Y1 ); + } + + if ( ( DrawLine & XGRA_NORTH ) == 0 ) + { + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraXorGC, + X1, Y2, + X2, Y2 ); + } + } + + break; + + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraUndisplayCursor | +| | +\------------------------------------------------------------*/ + +void XgraUndisplayCursor() + +{ + autbegin(); + + if ( XgraCursorInside == XGRA_TRUE ) + { + if ( XgraCursorSaved == XGRA_TRUE ) + { + XgraDrawCursor(); + } + + XgraCursorSaved = XGRA_FALSE; + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDisplayCursor | +| | +\------------------------------------------------------------*/ + +void XgraDisplayCursor() + +{ + autbegin(); + + if ( XgraCursorInside == XGRA_TRUE ) + { + if ( XgraCursorSaved == XGRA_TRUE ) + { + XgraDrawCursor(); + + XgraCursorSaved = XGRA_FALSE; + } + + if ( ( XgraCursorY >= 0 ) && + ( XgraCursorX <= XgraGraphicDx ) ) + { + XgraCursorSaveX = XgraCursorX; + XgraCursorSaveY = XgraCursorY; + + XgraDrawCursor(); + + XgraCursorSaved = XGRA_TRUE; + } + } + + autend(); +} diff --git a/alliance/src/xgra/src/XMX_cursor.h b/alliance/src/xgra/src/XMX_cursor.h new file mode 100644 index 00000000..f304872e --- /dev/null +++ b/alliance/src/xgra/src/XMX_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 : XGRA | +| | +| File : Cursor.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_CURSOR +# define XGRA_CURSOR + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_MAX_CURSOR_BUFFER 128 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern Position XgraCursorX; + extern Position XgraCursorY; + extern Position XgraCursorSaveX; + extern Position XgraCursorSaveY; + extern char XgraCursorSaved; + extern char XgraCursorInside; + extern long XgraLambdaCursorX; + extern long XgraLambdaCursorY; + + extern long XgraPixelCursorX; + extern long XgraPixelCursorY; + + extern long XgraPixelCursorX1; + extern long XgraPixelCursorY1; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraComputeCursor(); + extern void XgraChangeCursorType(); + extern void XgraPointCursor(); + extern void XgraResetCursor(); + extern void XgraDisplayCoordinates(); + +# endif diff --git a/alliance/src/xgra/src/XMX_dialog.c b/alliance/src/xgra/src/XMX_dialog.c new file mode 100644 index 00000000..fa8bb963 --- /dev/null +++ b/alliance/src/xgra/src/XMX_dialog.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 : XGRA | +| | +| File : Dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMF.h" +# include "XMV.h" +# include "XMT.h" +# include "XME.h" +# include "XMS.h" +# include "XMH.h" +# include "XMX.h" + +# include "XMX_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraInitializeDialog | +| | +\------------------------------------------------------------*/ + +void XgraInitializeDialog() + +{ + autbegin(); + + XgraBuildFileDialog(); + XgraBuildEditDialog(); + XgraBuildViewDialog(); + + autend(); +} diff --git a/alliance/src/xgra/src/XMX_dialog.h b/alliance/src/xgra/src/XMX_dialog.h new file mode 100644 index 00000000..1826c419 --- /dev/null +++ b/alliance/src/xgra/src/XMX_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 : XGRA | +| | +| File : dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_DIALOG +# define XGRA_DIALOG + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraInitializeDialog(); + +# endif diff --git a/alliance/src/xgra/src/XMX_event.c b/alliance/src/xgra/src/XMX_event.c new file mode 100644 index 00000000..776be062 --- /dev/null +++ b/alliance/src/xgra/src/XMX_event.c @@ -0,0 +1,780 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Event.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" +# include "XTB.h" +# include "XME.h" +# include "XMV.h" +# include "XMF.h" +# include "XMS.h" +# include "XMH.h" + +# include "XMX_motif.h" +# include "XMX_grid.h" +# include "XMX_cursor.h" +# include "XMX_event.h" +# include "XMX_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Arclation | +| | +\------------------------------------------------------------*/ + + static String XgraEventArclation = + + ": 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"; + + +/*------------------------------------------------------------\ +| | +| Event Count | +| | +\------------------------------------------------------------*/ + + static char XgraMaxEventEditTable[] = + + { + 2, /* XGRA_EDIT_MEASURE */ + 1, /* XGRA_EDIT_IDENTIFY */ + 1 /* XGRA_EDIT_CONNECTED */ + }; + + static char XgraInputEventEditTable[] = + + { + XGRA_INPUT_HALF_BOX, /* XGRA_EDIT_MEASURE */ + XGRA_INPUT_POINT, /* XGRA_EDIT_IDENTIFY */ + XGRA_INPUT_POINT /* XGRA_EDIT_CONNECTED */ + }; + + static char XgraMaxEventZoomTable[] = + + { + 1, /* XGRA_ZOOM_CENTER */ + 2, /* XGRA_ZOOM_IN */ + 2 /* XGRA_ZOOM_PAN */ + }; + + static char XgraInputEventZoomTable[] = + + { + XGRA_INPUT_POINT, /* XGRA_ZOOM_CENTER */ + XGRA_INPUT_BOX, /* XGRA_ZOOM_IN */ + XGRA_INPUT_LINE /* XGRA_ZOOM_PAN */ + }; + +/*------------------------------------------------------------\ +| | +| Arclation | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Expose Edit Zoom | +| | +\------------------------------------------------------------*/ + + static long XgraUnitEventZoomX[ 2 ] = { 0, 0 }; + static long XgraUnitEventZoomY[ 2 ] = { 0, 0 }; + static char XgraMaxEventZoom = 0; + char XgraCountEventZoom = 0; + + static long XgraUnitEventEditX[ 2 ] = { 0, 0 }; + static long XgraUnitEventEditY[ 2 ] = { 0, 0 }; + static char XgraMaxEventEdit = 2; + char XgraCountEventEdit = 0; + + static char XgraFirstExpose = XGRA_TRUE; + +/*------------------------------------------------------------\ +| | +| Input | +| | +\------------------------------------------------------------*/ + + static char XgraInputMode = XGRA_INPUT_HALF_BOX; + static char XgraSaveInputMode = XGRA_INPUT_HALF_BOX; + static char XgraEditMode = XGRA_EDIT_MEASURE; + static char XgraSaveEditMode = XGRA_EDIT_MEASURE; + +/*------------------------------------------------------------\ +| | +| Edit Message | +| | +\------------------------------------------------------------*/ + + static void (*XgraPromptMessage)() = XgraPromptEditMeasure; + static void (*XgraSavePromptMessage)() = XgraPromptEditMeasure; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraChangeEditMode | +| | +\------------------------------------------------------------*/ + +void XgraChangeEditMode( EditMode , PromptMessage ) + + char EditMode; + void (*PromptMessage)(); +{ + autbegin(); + + if ( EditMode & XGRA_ZOOM_MARK ) + { + EditMode = EditMode & ~XGRA_ZOOM_MARK; + + XgraCountEventZoom = 0; + XgraMaxEventZoom = XgraMaxEventZoomTable[ EditMode ]; + + if ( ! ( XgraEditMode & XGRA_ZOOM_MARK ) ) + { + XgraSaveEditMode = XgraEditMode; + XgraSaveInputMode = XgraInputMode; + XgraSavePromptMessage = XgraPromptMessage; + } + + XgraInputMode = XgraInputEventZoomTable[ EditMode ]; + XgraPromptMessage = PromptMessage; + XgraEditMode = EditMode | XGRA_ZOOM_MARK; + + XgraChangeCursorType( NULL, NULL, 0, XgraInputMode ); + } + else + { + if ( XgraEditMode & XGRA_ZOOM_MARK ) + { + XgraSaveEditMode = EditMode; + XgraSaveInputMode = XgraInputEventEditTable[ EditMode ]; + XgraSavePromptMessage = PromptMessage; + XgraCountEventEdit = 0; + XgraMaxEventEdit = XgraMaxEventEditTable[ EditMode ]; + } + else + { + if ( XgraEditMode != EditMode ) + { + XgraCountEventEdit = 0; + XgraMaxEventEdit = XgraMaxEventEditTable[ EditMode ]; + XgraEditMode = EditMode; + XgraInputMode = XgraInputEventEditTable[ EditMode ]; + XgraPromptMessage = PromptMessage; + + XgraChangeCursorType( NULL, NULL, 0, XgraInputMode ); + } + } + + XgraEditUnselectAll(); + } + + XgraPromptMessage(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraContinueEditMode | +| | +\------------------------------------------------------------*/ + +void XgraContinueEditMode( EditMode , PromptMessage, CountEvent ) + + char EditMode; + void (*PromptMessage)(); + char CountEvent; +{ + autbegin(); + + if ( XgraEditMode & XGRA_ZOOM_MARK ) + { + XgraSaveEditMode = EditMode; + XgraSaveInputMode = XgraInputEventEditTable[ EditMode ]; + XgraSavePromptMessage = PromptMessage; + XgraCountEventEdit = CountEvent; + XgraMaxEventEdit = XgraMaxEventEditTable[ EditMode ]; + } + else + { + XgraCountEventEdit = CountEvent; + XgraMaxEventEdit = XgraMaxEventEditTable[ EditMode ]; + XgraEditMode = EditMode; + XgraInputMode = XgraInputEventEditTable[ EditMode ]; + XgraPromptMessage = PromptMessage; + + XgraChangeCursorType( XgraUnitEventEditX, + XgraUnitEventEditY, + XgraCountEventEdit, + XgraInputMode ); + + } + + XgraPromptMessage(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraTreatEventZoom | +| | +\------------------------------------------------------------*/ + +void XgraTreatEventZoom() + +{ + autbegin(); + + XgraChangeCursorType( XgraUnitEventEditX, + XgraUnitEventEditY, + XgraCountEventEdit, + XgraSaveInputMode ); + + switch ( XgraEditMode ) + { + case XGRA_ZOOM_CENTER : + + XgraZoomCenter( XgraUnitEventZoomX[ 0 ], + XgraUnitEventZoomY[ 0 ] ); + break; + + case XGRA_ZOOM_IN : + + XgraZoomIn( XgraUnitEventZoomX[ 0 ], + XgraUnitEventZoomY[ 0 ], + XgraUnitEventZoomX[ 1 ], + XgraUnitEventZoomY[ 1 ] ); + break; + + case XGRA_ZOOM_PAN : + + XgraZoomPan( XgraUnitEventZoomX[ 0 ], + XgraUnitEventZoomY[ 0 ], + XgraUnitEventZoomX[ 1 ], + XgraUnitEventZoomY[ 1 ] ); + break; + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraTreatEventEdit | +| | +\------------------------------------------------------------*/ + +void XgraTreatEventEdit() + +{ + long DeltaX; + long DeltaY; + long X1; + long X2; + long Y1; + long Y2; + + autbegin(); + + X1 = XgraUnitEventEditX[0]; + X2 = XgraUnitEventEditX[1]; + Y1 = XgraUnitEventEditY[0]; + Y2 = XgraUnitEventEditY[1]; + + if ( ( XgraInputMode == XGRA_INPUT_LSTRING ) || + ( XgraInputMode == XGRA_INPUT_ORTHO ) || + ( XgraInputMode == XGRA_INPUT_SORTHO ) ) + { + DeltaX = X1 - X2; + DeltaY = Y1 - Y2; + + if ( DeltaX < 0 ) DeltaX = - DeltaX; + if ( DeltaY < 0 ) DeltaY = - DeltaY; + + if ( DeltaX > DeltaY ) + { + Y2 = Y1; + + XgraUnitEventEditX[0] = X2; + XgraUnitEventEditY[0] = Y2; + } + else + { + X2 = X1; + + XgraUnitEventEditX[0] = X2; + XgraUnitEventEditY[0] = Y2; + } + } + + if ( XgraInputMode == XGRA_INPUT_LSTRING ) + { + XgraChangeCursorType( XgraUnitEventEditX, + XgraUnitEventEditY, + 1, XgraInputMode ); + + XgraCountEventEdit = 1; + } + else + { + XgraChangeCursorType( NULL, NULL, 0, + XgraInputMode ); + + XgraCountEventEdit = 0; + } + + switch ( XgraEditMode ) + { + case XGRA_EDIT_MEASURE : + + break; + + case XGRA_EDIT_IDENTIFY : + + XgraEditIdentify( X1, Y1 ); + + break; + + case XGRA_EDIT_CONNECTED : + + XgraEditConnected( X1, Y1 ); + + break; + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackEvent | +| | +\------------------------------------------------------------*/ + +void CallbackEvent ( MyWidget, Event, Args, Argc ) + + Widget MyWidget; + XButtonEvent *Event; + String *Args; + int *Argc; +{ + Display *EventDisplay; + char MouseEvent; + Position OldUnitCursorX; + Position OldUnitCursorY; + + autbegin(); + + EventDisplay = Event->display; + + MouseEvent = atoi( Args[ 0 ] ); + + if ( MouseEvent == XGRA_LEAVE ) + { + XgraUndisplayCursor(); + XgraCursorInside = XGRA_FALSE; + } + else + { + OldUnitCursorX = XgraUnitCursorX; + OldUnitCursorY = XgraUnitCursorY; + + XgraComputeCursor( Event->x, Event->y ); + + switch ( MouseEvent ) + { + case XGRA_B1DN : + + if ( XgraEditMode & XGRA_ZOOM_MARK ) + { + if ( XgraCountEventZoom < XgraMaxEventZoom ) + { + XgraUnitEventZoomX[ XgraCountEventZoom ] = XgraUnitCursorX; + XgraUnitEventZoomY[ XgraCountEventZoom ] = XgraUnitCursorY; + + XgraCountEventZoom = XgraCountEventZoom + 1; + + XgraPointCursor(); + + if ( XgraCountEventZoom == XgraMaxEventZoom ) + { + XgraChangeCursorType( NULL, NULL, 0, XgraInputMode ); + + XgraTreatEventZoom(); + + XgraInputMode = XgraSaveInputMode; + XgraEditMode = XgraSaveEditMode; + XgraPromptMessage = XgraSavePromptMessage; + XgraSaveEditMode = XGRA_EDIT_MEASURE; + XgraSaveInputMode = XGRA_INPUT_HALF_BOX; + XgraCountEventZoom = 0; + XgraMaxEventZoom = 0; + + XgraChangeCursorType( XgraUnitEventEditX, + XgraUnitEventEditY, + XgraCountEventEdit, + XgraInputMode ); + + XgraComputeCursor( Event->x, Event->y ); + XgraDisplayCursor(); + } + } + } + else + { + if ( XgraCountEventEdit < XgraMaxEventEdit ) + { + XgraUnitEventEditX[ XgraCountEventEdit ] = XgraUnitCursorX; + XgraUnitEventEditY[ XgraCountEventEdit ] = XgraUnitCursorY; + + XgraCountEventEdit = XgraCountEventEdit + 1; + + XgraPointCursor(); + + if ( XgraCountEventEdit == XgraMaxEventEdit ) + { + XgraTreatEventEdit(); + + XgraDisplayCursor(); + } + } + } + + XgraPromptMessage(); + + break; + + case XGRA_B3DN : + + if ( XgraEditMode & XGRA_ZOOM_MARK ) + { + if ( XgraCountEventZoom != 0 ) + { + XgraCountEventZoom = XgraCountEventZoom - 1; + + XgraResetCursor(); + } + else + { + XgraChangeCursorType( XgraUnitEventEditX, + XgraUnitEventEditY, + XgraCountEventEdit, + XgraSaveInputMode ); + + XgraInputMode = XgraSaveInputMode; + XgraEditMode = XgraSaveEditMode; + XgraPromptMessage = XgraSavePromptMessage; + XgraSaveEditMode = XGRA_EDIT_MEASURE; + XgraSaveInputMode = XGRA_INPUT_HALF_BOX; + XgraSavePromptMessage = XgraPromptEditMeasure; + XgraCountEventZoom = 0; + XgraMaxEventZoom = 0; + } + } + else + { + if ( XgraCountEventEdit != 0 ) + { + XgraCountEventEdit = XgraCountEventEdit - 1; + + XgraResetCursor(); + } + else + { + XgraEditUnselectAll(); + + XgraChangeCursorType( NULL, NULL, 0, + XGRA_INPUT_HALF_BOX ); + + XgraInputMode = XGRA_INPUT_HALF_BOX; + XgraEditMode = XGRA_EDIT_MEASURE; + XgraPromptMessage = XgraPromptEditMeasure; + XgraCountEventEdit = 0; + XgraMaxEventEdit = 2; + } + } + + XgraPromptMessage(); + + break; + + case XGRA_MOTION : + + break; + + case XGRA_ENTER : XgraCursorInside = XGRA_TRUE; + XgraDisplayCursor(); + break; + + case XGRA_KEY_UP : XgraZoomUp(); + + break; + + case XGRA_KEY_DN : XgraZoomDown(); + + break; + + case XGRA_KEY_LEFT : XgraZoomLeft(); + + break; + + case XGRA_KEY_RIGHT : XgraZoomRight(); + + break; + + case XGRA_KEY_MORE : XgraZoomMore(); + + break; + + case XGRA_KEY_LESS : XgraZoomLess(); + + break; + + case XGRA_KEY_FIT : XgraZoomFit(); + + break; + + case XGRA_KEY_REFRESH : XgraZoomRefresh(); + + break; + + case XGRA_KEY_UNZOOM : XgraZoomUndo(); + + break; + + case XGRA_KEY_ZOOM_IN : + + XgraChangeEditMode( XGRA_ZOOM_IN, XgraPromptZoomIn ); + + break; + + case XGRA_KEY_CENTER : + + XgraChangeEditMode( XGRA_ZOOM_CENTER, XgraPromptZoomCenter ); + + break; + + case XGRA_KEY_PAN : + + XgraChangeEditMode( XGRA_ZOOM_PAN, XgraPromptZoomPan ); + + break; + } + + if ( ( OldUnitCursorX != XgraUnitCursorX ) || + ( OldUnitCursorY != XgraUnitCursorY ) ) + { + XgraDisplayCoordinates(); + XgraDisplayCursor(); + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| CallbackResize | +| | +\------------------------------------------------------------*/ + +void CallbackResize( MyWidget, ClientData, CallData ) + + Widget MyWidget; + XtPointer ClientData; + XmDrawingAreaCallbackStruct *CallData; +{ + if ( XgraFirstExpose == XGRA_FALSE ) + { + autbegin(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_WATCH_CURSOR ); + XgraUndisplayCursor(); + + XgraResizeGraphicWindow(); + XgraRefreshGraphicWindow( 0, 0, + XgraGraphicDx, XgraGraphicDy ); + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + XgraDisplayCursor(); + + autend(); + } +} + +/*------------------------------------------------------------\ +| | +| CallbackExpose | +| | +\------------------------------------------------------------*/ + +void CallbackExpose( MyWidget, ClientData, CallData ) + + Widget MyWidget; + XtPointer ClientData; + XmDrawingAreaCallbackStruct *CallData; +{ + XExposeEvent *ExposeEvent; + + ExposeEvent = (XExposeEvent *)CallData->event; + + autbegin(); + + if ( XgraFirstExpose == XGRA_TRUE ) + { + XgraFirstExpose = XGRA_FALSE; + + XgraInitializeGraphicWindow(); + XgraUndisplayCursor(); + + XgraLoadConfig( XGRA_FALSE ); + + if ( XgraFirstFileName != (char *)NULL ) + { + XgraDisplayCursor(); + XgraFileOpen( XgraFirstFileName ); + + XgraFirstFileName = (char *)NULL; + } + else + { + XgraChangeTopLevelTitle( (char *)NULL ); + + XgraRefreshGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy ); + XgraDisplayCursor(); + } + + XgraEnterPresentPanel(); + } + else + { + XgraUndisplayCursor(); + XgraRefreshGraphicWindow( ExposeEvent->x, ExposeEvent->y, + ExposeEvent->width, ExposeEvent->height ); + XgraDisplayCursor(); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraInitializeEvent | +| | +\------------------------------------------------------------*/ + +void XgraInitializeEvent() + +{ + XtActionsRec NewActions; + + autbegin(); + + XtVaSetValues( XgraGraphicWindow, + XmNtranslations, + XtParseTranslationTable( XgraEventArclation ), + NULL + ); + + NewActions.string = "CallbackEvent"; + NewActions.proc = CallbackEvent; + + XtAppAddActions( XgraApplication, &NewActions, 1 ); + + XtAddCallback( XgraGraphicWindow, + XmNresizeCallback, + CallbackResize, NULL ); + + XtAddCallback( XgraGraphicWindow, + XmNexposeCallback, + CallbackExpose, NULL ); + + autend(); +} diff --git a/alliance/src/xgra/src/XMX_event.h b/alliance/src/xgra/src/XMX_event.h new file mode 100644 index 00000000..87fa0885 --- /dev/null +++ b/alliance/src/xgra/src/XMX_event.h @@ -0,0 +1,98 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Event.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_EVENT +# define XGRA_EVENT + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_B1DN 0 +# define XGRA_B3DN 1 +# define XGRA_MOTION 2 +# define XGRA_ENTER 3 +# define XGRA_LEAVE 4 + +# define XGRA_KEY_UP 5 +# define XGRA_KEY_DN 6 +# define XGRA_KEY_LEFT 7 +# define XGRA_KEY_RIGHT 8 + +# define XGRA_KEY_MORE 9 +# define XGRA_KEY_LESS 10 + +# define XGRA_KEY_FIT 11 +# define XGRA_KEY_REFRESH 12 +# define XGRA_KEY_UNZOOM 13 + +# define XGRA_KEY_ZOOM_IN 14 +# define XGRA_KEY_CENTER 15 +# define XGRA_KEY_PAN 16 + +# define XGRA_MAX_EVENT_BUFFER 128 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraInitializeEvent(); + extern void XgraDisplayEditMeasure(); + +# endif diff --git a/alliance/src/xgra/src/XMX_graphic.c b/alliance/src/xgra/src/XMX_graphic.c new file mode 100644 index 00000000..e886586d --- /dev/null +++ b/alliance/src/xgra/src/XMX_graphic.c @@ -0,0 +1,314 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Graphic.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" + +# include "XMX_graphic.h" +# include "XMX_grid.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + Widget XgraGraphicFrame; + Widget XgraGraphicWindow; + Display *XgraGraphicDisplay = (Display *)NULL; + + Dimension XgraGraphicDx = 0; + Dimension XgraGraphicDy = 0; + Dimension XgraOldGraphicDx = 0; + Dimension XgraOldGraphicDy = 0; + + Pixmap XgraGraphicPixmap = (Pixmap)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraInitializeGraphicWindow | +| | +\------------------------------------------------------------*/ + +void XgraInitializeGraphicWindow() + +{ + autbegin(); + + XtVaGetValues( XgraGraphicWindow, + XmNwidth, &XgraGraphicDx, + XmNheight, &XgraGraphicDy, + NULL + ); + + XgraOldGraphicDx = XgraGraphicDx; + XgraOldGraphicDy = XgraGraphicDy; + + XgraGraphicPixmap = + + XCreatePixmap ( XgraGraphicDisplay, + RootWindowOfScreen( XtScreen ( XgraGraphicWindow ) ), + XgraGraphicDx, + XgraGraphicDy, + DefaultDepthOfScreen ( XtScreen ( XgraGraphicWindow ) ) + ); + + XgraClearGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy ); + XgraInitializeUnitGrid(); + + XgraSetMouseCursor( XgraGraphicWindow, XGRA_NORMAL_CURSOR ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraClearGraphicWindow | +| | +\------------------------------------------------------------*/ + +void XgraClearGraphicWindow( GraphicX, GraphicY, GraphicDx, GraphicDy ) + + long GraphicX; + long GraphicY; + long GraphicDx; + long GraphicDy; +{ + XFillRectangle( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraBackgroundGC, + GraphicX, GraphicY, + GraphicDx, + GraphicDy ); +} + +/*------------------------------------------------------------\ +| | +| XgraRefreshGraphicWindow | +| | +\------------------------------------------------------------*/ + +void XgraRefreshGraphicWindow( GraphicX, GraphicY, GraphicDx, GraphicDy ) + + Dimension GraphicX; + Dimension GraphicY; + Dimension GraphicDx; + Dimension GraphicDy; +{ + autbegin(); + + XgraUndisplayCursor(); + + XCopyArea( XgraGraphicDisplay, + XgraGraphicPixmap, + XtWindow ( XgraGraphicWindow ), + XgraBackgroundGC, + GraphicX, GraphicY, + GraphicDx, GraphicDy, + GraphicX, GraphicY + ); + + XgraDisplayUnitGrid( GraphicX, GraphicY, + GraphicX + GraphicDx, + GraphicY + GraphicDy ); + XgraUndisplayCursor(); + + autend(); +} + + +/*------------------------------------------------------------\ +| | +| XgraResizeGraphicWindow | +| | +\------------------------------------------------------------*/ + +void XgraResizeGraphicWindow() + +{ + Pixmap OldPixmap; + Dimension SourceY; + Dimension TargetY; + Dimension TargetDx; + Dimension TargetDy; + + autbegin(); + + XgraOldGraphicDx = XgraGraphicDx; + XgraOldGraphicDy = XgraGraphicDy; + + XtVaGetValues( XgraGraphicWindow, + XmNwidth, &XgraGraphicDx, + XmNheight, &XgraGraphicDy, + NULL + ); + + if ( ( XgraOldGraphicDx != XgraGraphicDx ) || + ( XgraOldGraphicDy != XgraGraphicDy ) ) + { + OldPixmap = XgraGraphicPixmap; + + XgraGraphicPixmap = + + XCreatePixmap ( XgraGraphicDisplay, + RootWindowOfScreen( XtScreen ( XgraGraphicWindow ) ), + XgraGraphicDx, + XgraGraphicDy, + DefaultDepthOfScreen ( XtScreen ( XgraGraphicWindow ) ) + ); + + XgraClearGraphicWindow( 0, 0, XgraGraphicDx, XgraGraphicDy ); + + XgraResizeUnitGrid(); + + if ( XgraOldGraphicDx < XgraGraphicDx ) + { + TargetDx = XgraOldGraphicDx; + + XgraDisplayFigure( TargetDx, 0, + XgraGraphicDx, XgraGraphicDy ); + } + else + { + TargetDx = XgraGraphicDx; + } + + if ( XgraOldGraphicDy < XgraGraphicDy ) + { + SourceY = 0; + TargetDy = XgraOldGraphicDy; + TargetY = XgraGraphicDy - XgraOldGraphicDy; + + XgraDisplayFigure( 0, TargetDy, + TargetDx, XgraGraphicDy ); + } + else + { + TargetDy = XgraGraphicDy; + TargetY = 0; + SourceY = XgraOldGraphicDy - XgraGraphicDy; + } + + XCopyArea( XgraGraphicDisplay, + OldPixmap, + XgraGraphicPixmap, + XgraBackgroundGC, + 0, SourceY, + TargetDx, TargetDy, + 0, TargetY + ); + + XFreePixmap( XgraGraphicDisplay, OldPixmap ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraInitializeGraphic | +| | +\------------------------------------------------------------*/ + +void XgraInitializeGraphic() + +{ + autbegin(); + + XgraGraphicFrame = XtVaCreateManagedWidget( "XgraGraphicFrame", + xmFrameWidgetClass, + XgraMainForm, + 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 ); + + XgraGraphicWindow = XtVaCreateManagedWidget( + "XgraGraphicWindow", + xmDrawingAreaWidgetClass, + XgraGraphicFrame, + XmNtopAttachment, XmATTACH_FORM, + XmNrightAttachment, XmATTACH_FORM, + XmNbottomAttachment, XmATTACH_FORM, + XmNleftAttachment, XmATTACH_FORM, + XmNbackground, 1, + XmNforeground, 0, + NULL + ); + + XgraGraphicDisplay = XtDisplay( XgraGraphicWindow ); + + autend(); +} diff --git a/alliance/src/xgra/src/XMX_graphic.h b/alliance/src/xgra/src/XMX_graphic.h new file mode 100644 index 00000000..94aa8f8f --- /dev/null +++ b/alliance/src/xgra/src/XMX_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 : XGRA | +| | +| File : Graphic.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_GRAPHIC +# define XGRA_GRAPHIC + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraInitializeGraphic(); + +# endif diff --git a/alliance/src/xgra/src/XMX_grid.c b/alliance/src/xgra/src/XMX_grid.c new file mode 100644 index 00000000..65806290 --- /dev/null +++ b/alliance/src/xgra/src/XMX_grid.c @@ -0,0 +1,310 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Grid.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" + +# include "XMX_grid.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Unit Grid | +| | +\------------------------------------------------------------*/ + + float XgraUnitGridStep; + + long XgraUnitGridX; + long XgraUnitGridY; + long XgraUnitGridDx; + long XgraUnitGridDy; + + long XgraPixelGridX; + long XgraPixelGridY; + +/*------------------------------------------------------------\ +| | +| User Unit Grid | +| | +\------------------------------------------------------------*/ + + long XgraUnitUserGridDx; + long XgraUnitUserGridDy; + char XgraUnitUserGrid; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraInitializeUnitGrid | +| | +\------------------------------------------------------------*/ + +void XgraInitializeUnitGrid() + +{ + autbegin(); + + XgraUnitGridX = XGRA_DEFAULT_GRID_X; + XgraUnitGridY = XGRA_DEFAULT_GRID_Y; + XgraUnitGridDx = XGRA_DEFAULT_GRID_DX; + XgraUnitGridDy = XGRA_DEFAULT_GRID_DY; + XgraUnitUserGridDx = 4; + XgraUnitUserGridDy = 4; + XgraUnitUserGrid = XGRA_FALSE; + + XgraComputeUnitGrid(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraComputeUnitGrid | +| | +\------------------------------------------------------------*/ + +void XgraComputeUnitGrid() + +{ + float StepX; + float StepY; + + autbegin(); + + StepX = (float)(XgraGraphicDx) / (float)(XgraUnitGridDx); + StepY = (float)(XgraGraphicDy) / (float)(XgraUnitGridDy); + + if ( StepX < StepY ) + { + XgraUnitGridStep = StepX; + XgraUnitGridDy = 1 + ( XgraGraphicDy / StepX ); + } + else + { + XgraUnitGridStep = StepY; + XgraUnitGridDx = 1 + ( XgraGraphicDx / StepY ); + } + + XgraPixelGridX = (float)(XgraUnitGridX) * XgraUnitGridStep; + XgraPixelGridY = (float)(XgraUnitGridY) * XgraUnitGridStep; + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraResizeUnitGrid | +| | +\------------------------------------------------------------*/ + +void XgraResizeUnitGrid() + +{ + autbegin(); + + XgraUnitGridDx = 1 + ( XgraGraphicDx / XgraUnitGridStep ); + XgraUnitGridDy = 1 + ( XgraGraphicDy / XgraUnitGridStep ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDisplayUnitGrid | +| | +\------------------------------------------------------------*/ + +char XgraDisplayUnitGrid( 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 UnitGrid; + float Check; + + autbegin(); + + if ( XgraUnitGridStep < XGRA_LOWER_GRID_STEP ) + { + UnitGrid = 0; + } + else + { + UnitGrid = 1; + } + + if ( XgraUnitUserGrid == 1 ) + { + if ( XgraUnitUserGridDx > XgraUnitUserGridDy ) + { + Check = ( XGRA_LOWER_GRID_STEP * 2 / XgraUnitUserGridDy ); + } + else + { + Check = ( XGRA_LOWER_GRID_STEP * 2 / XgraUnitUserGridDy ); + } + + if ( XgraUnitGridStep < Check ) UserGrid = 0; + else UserGrid = 1; + } + else + { + UserGrid = 0; + } + + if ( ( UserGrid == 0 ) && + ( UnitGrid == 0 ) ) + { + autend(); + return( XGRA_FALSE ); + } + + MaxGridX = XgraUnitGridX + XgraUnitGridDx; + MaxGridY = XgraUnitGridY + XgraUnitGridDy; + + if ( UnitGrid ) + { + for ( X = XgraUnitGridX; X < MaxGridX; X = X + 1 ) + { + PixelX = ((float)(X) * XgraUnitGridStep); + PixelX = PixelX - XgraPixelGridX; + + if ( ( PixelX <= GraphicX2 ) && + ( PixelX >= GraphicX1 ) ) + + for ( Y = XgraUnitGridY; Y < MaxGridY; Y = Y + 1 ) + { + PixelY = ((float)(Y) * XgraUnitGridStep); + PixelY = PixelY - XgraPixelGridY; + PixelY = XgraGraphicDy - PixelY; + + if ( ( PixelY <= GraphicY2 ) && + ( PixelY >= GraphicY1 ) ) + { + XDrawPoint( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraGridGC, + PixelX, PixelY ); + } + } + } + } + + if ( UserGrid ) + { + Xmin = ( XgraUnitGridX / XgraUnitUserGridDx ) * XgraUnitUserGridDx; + Ymin = ( XgraUnitGridY / XgraUnitUserGridDy ) * XgraUnitUserGridDy; + + for ( X = Xmin; X < MaxGridX ; X = X + XgraUnitUserGridDx ) + { + PixelX = ((float)(X) * XgraUnitGridStep); + PixelX = PixelX - XgraPixelGridX; + + if ( ( PixelX <= GraphicX2 ) && + ( PixelX >= GraphicX1 ) ) + + for ( Y = Ymin; Y < MaxGridY; Y = Y + XgraUnitUserGridDy ) + { + PixelY = ((float)(Y) * XgraUnitGridStep); + PixelY = PixelY - XgraPixelGridY; + PixelY = XgraGraphicDy - PixelY; + + if ( ( PixelY <= GraphicY2 ) && + ( PixelY >= GraphicY1 ) ) + { + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraGridGC, + PixelX - 2, PixelY, + PixelX + 2, PixelY ); + + XDrawLine( XgraGraphicDisplay, + XtWindow( XgraGraphicWindow ), + XgraGridGC, + PixelX, PixelY + 2, + PixelX, PixelY - 2 ); + } + } + } + } + + autend(); + return( XGRA_TRUE ); +} diff --git a/alliance/src/xgra/src/XMX_grid.h b/alliance/src/xgra/src/XMX_grid.h new file mode 100644 index 00000000..c4017e1f --- /dev/null +++ b/alliance/src/xgra/src/XMX_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 : XGRA | +| | +| File : Grid.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_GRID +# define XGRA_GRID + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define XGRA_DEFAULT_GRID_X 0 +# define XGRA_DEFAULT_GRID_Y 0 +# define XGRA_DEFAULT_GRID_DX 40 +# define XGRA_DEFAULT_GRID_DY 40 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XMX_icon.c b/alliance/src/xgra/src/XMX_icon.c new file mode 100644 index 00000000..30a82f00 --- /dev/null +++ b/alliance/src/xgra/src/XMX_icon.c @@ -0,0 +1,131 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Icon.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" + +# include "XMX_icon.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static char IconBits[] = + + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x87, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x88, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x87, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x12, 0x40, 0x02, 0x00, 0x00, 0x00, 0x1f, 0x0e, 0x80, + 0xc3, 0x07, 0x00, 0xc0, 0x60, 0x0e, 0x80, 0x33, 0x18, 0x00, 0x20, 0x80, + 0x1e, 0xc0, 0x0b, 0x20, 0x00, 0x20, 0x80, 0x00, 0x00, 0x08, 0x20, 0x00, + 0x10, 0x00, 0x01, 0x00, 0x04, 0x40, 0x00, 0x10, 0x00, 0x01, 0x00, 0x04, + 0x40, 0x00, 0x10, 0x00, 0x01, 0x00, 0x04, 0x40, 0x00, 0x10, 0x00, 0x01, + 0x00, 0x04, 0x40, 0x00, 0x10, 0x00, 0x01, 0x00, 0x04, 0x40, 0x00, 0x20, + 0x80, 0x00, 0x00, 0x08, 0x20, 0x00, 0x20, 0x80, 0x00, 0x00, 0x08, 0x20, + 0x00, 0xc0, 0x60, 0x00, 0x00, 0x30, 0x18, 0x00, 0x00, 0x1f, 0x00, 0x00, + 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraInitializeIcon | +| | +\------------------------------------------------------------*/ + +void XgraInitializeIcon() + +{ + autbegin(); + + XgraSetIcon( XgraTopLevel, + IconBits, IconWidth, IconHeight ); + + autend(); +} diff --git a/alliance/src/xgra/src/XMX_icon.h b/alliance/src/xgra/src/XMX_icon.h new file mode 100644 index 00000000..419be95d --- /dev/null +++ b/alliance/src/xgra/src/XMX_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 : XGRA | +| | +| File : Icon.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_ICON +# define XGRA_ICON + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define IconWidth 50 +# define IconHeight 50 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraInitializeIcon(); + +# endif diff --git a/alliance/src/xgra/src/XMX_menu.c b/alliance/src/xgra/src/XMX_menu.c new file mode 100644 index 00000000..b69d3d7b --- /dev/null +++ b/alliance/src/xgra/src/XMX_menu.c @@ -0,0 +1,201 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMF.h" +# include "XME.h" +# include "XMV.h" +# include "XMT.h" +# include "XMS.h" +# include "XMH.h" +# include "XMX.h" + +# include "XMX_menu.h" + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + Widget XgraMenuBar; + + XgraMenuItem XgraMainMenu[] = + + { + { + "File", + 'F', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + XgraFileMenu + } + , + { + "Edit", + 'E', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + XgraEditMenu + } + , + { + "View", + 'V', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + XgraViewMenu + } + , + { + "Tools", + 'T', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + XgraToolsMenu + } + , + { + "Setup", + 'S', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + False, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + XgraSetupMenu + } + , + { + "Help", + 'H', + NULL, + NULL, + &xmCascadeButtonGadgetClass, + False, + False, + True, + NULL, + (XtPointer)NULL, + (Widget)NULL, + (Widget)NULL, + XgraHelpMenu + } + , + NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraInitializeMenu | +| | +\------------------------------------------------------------*/ + +void XgraInitializeMenu() + +{ + autbegin(); + + XgraMenuBar = XmCreateMenuBar( XgraMainWindow, + "XgraMenuBar", NULL, 0 ); + + XgraBuildMenus( XgraMenuBar, XgraMainMenu ); + + XtManageChild( XgraMenuBar ); + + autend(); +} + diff --git a/alliance/src/xgra/src/XMX_menu.h b/alliance/src/xgra/src/XMX_menu.h new file mode 100644 index 00000000..72732029 --- /dev/null +++ b/alliance/src/xgra/src/XMX_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 : XGRA | +| | +| File : Menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_MENU +# define XGRA_MENU + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern XgraMenuItem XgraMainMenu[]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraInitializeMenu(); + +# endif diff --git a/alliance/src/xgra/src/XMX_message.c b/alliance/src/xgra/src/XMX_message.c new file mode 100644 index 00000000..c01743d1 --- /dev/null +++ b/alliance/src/xgra/src/XMX_message.c @@ -0,0 +1,288 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Message.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" +# include "XMX_message.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + Widget XgraMessageMainForm; + Widget XgraMessageText [ XGRA_MAX_MESSAGE ]; + Widget XgraMessageLabel [ XGRA_MAX_MESSAGE ]; + Widget XgraMessageFrame [ XGRA_MAX_MESSAGE ]; + Widget XgraMessageForm [ XGRA_MAX_MESSAGE ]; + + static char *XgraMessageLabelName [ XGRA_MAX_MESSAGE ] = + + { + "X :", + "Y :", + "Dx :", + "Dy :", + NULL, + NULL, + NULL + }; + + static char *XgraMessageTextName [ XGRA_MAX_MESSAGE ] = + + { + "0", + "0", + "0", + "0", + "Measure", + "Select point", + "Enter base point" + }; + + static char *XgraMessageFormName [ XGRA_MAX_MESSAGE ] = + + { + "XgraMessageFormX", + "XgraMessageFormY", + "XgraMessageFormDx", + "XgraMessageFormDy", + "XgraMessageFormMode", + "XgraMessageFormInfo", + "XgraMessageFormPrompt" + }; + + static char *XgraMessageFrameName [ XGRA_MAX_MESSAGE ] = + + { + "XgraMessageFrameX", + "XgraMessageFrameY", + "XgraMessageFrameDx", + "XgraMessageFrameDy", + "XgraMessageFrameMode", + "XgraMessageFrameInfo", + "XgraMessageFramePrompt" + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraDisplayMessage | +| | +\------------------------------------------------------------*/ + +void XgraDisplayMessage( Where, Text ) + + char Where; + char *Text; +{ + XmString TextString; + + autbegin(); + + TextString = XmStringCreateSimple( Text ); + + XtVaSetValues( XgraMessageText[ Where ], XmNlabelString, TextString, NULL ); + + XmStringFree( TextString ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraPromptEditMeasure | +| | +\------------------------------------------------------------*/ + +void XgraPromptEditMeasure() + +{ + autbegin(); + + XgraDisplayMessage( XGRA_MESSAGE_MODE , "Measure" ); + XgraDisplayMessage( XGRA_MESSAGE_PROMPT, "Enter base point" ); + XgraDisplayMessage( XGRA_MESSAGE_INFO , "Select point" ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraInitializeMessage | +| | +\------------------------------------------------------------*/ + +void XgraInitializeMessage() + +{ + int Counter; + int Column; + int Left; + int Width; + + autbegin(); + + XgraMessageMainForm = + + XtVaCreateManagedWidget( "XgraMessageMainForm", + xmFormWidgetClass , + XgraMainForm , + 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 < XGRA_MAX_MESSAGE; Counter++ ) + { + if ( Counter == 4 ) Width = 22; + if ( Counter == 5 ) Width = 68; + if ( Counter == 6 ) Width = 40; + + XgraMessageFrame[ Counter ] = + + XtVaCreateManagedWidget( XgraMessageFrameName[ Counter ], + xmFrameWidgetClass, + XgraMessageMainForm, + XmNshadowType , XmSHADOW_ETCHED_IN, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , Column, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , Column + Width, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + NULL + ); + + XgraMessageForm[ Counter ] = + + XtVaCreateManagedWidget( XgraMessageFormName[ Counter ], + xmFormWidgetClass , + XgraMessageFrame[ Counter ], + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNfractionBase , 18, + NULL + ); + + if ( XgraMessageLabelName[ Counter ] != (char *)NULL ) + { + XgraMessageLabel [ Counter ] = + + XtVaCreateManagedWidget( XgraMessageLabelName[ Counter ], + xmLabelWidgetClass, + XgraMessageForm [ Counter ], + XmNleftAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_POSITION, + XmNrightPosition , 6, + XmNbottomAttachment , XmATTACH_FORM, + XmNtopAttachment , XmATTACH_FORM, + XmNrecomputeSize , False, + NULL + ); + Left = 6; + } + else + { + Left = 0; + } + + XgraMessageText [ Counter ] = + + XtVaCreateManagedWidget( XgraMessageTextName[ Counter ], + xmLabelWidgetClass, + XgraMessageForm [ Counter ], + XmNtopAttachment , XmATTACH_FORM, + XmNbottomAttachment , XmATTACH_FORM, + XmNrightAttachment , XmATTACH_FORM, + XmNleftAttachment , XmATTACH_POSITION, + XmNleftPosition , Left, + XmNrecomputeSize , False, + NULL + ); + + Column = Column + Width; + } + + autend(); +} diff --git a/alliance/src/xgra/src/XMX_message.h b/alliance/src/xgra/src/XMX_message.h new file mode 100644 index 00000000..75a9e141 --- /dev/null +++ b/alliance/src/xgra/src/XMX_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 : XGRA | +| | +| File : Message.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_MESSAGE +# define XGRA_MESSAGE + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraInitializeMessage(); + extern void XgraPromptEditMeasure(); + +# endif diff --git a/alliance/src/xgra/src/XMX_motif.c b/alliance/src/xgra/src/XMX_motif.c new file mode 100644 index 00000000..4c4b90d3 --- /dev/null +++ b/alliance/src/xgra/src/XMX_motif.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 : XGRA | +| | +| File : Motif.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMX.h" +# include "XMS.h" +# include "XMV.h" + +# include "XMX_motif.h" +# include "XMX_graphic.h" +# include "XMX_event.h" +# include "XMX_message.h" +# include "XMX_menu.h" +# include "XMX_color.h" +# include "XMX_panel.h" +# include "XMX_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + XtAppContext XgraApplication; + Widget XgraTopLevel; + Widget XgraMainWindow; + Widget XgraMainForm; + + static String XgraFallBacks [] = + + { + "*.XgraMainWindow.iconName : Xgra", + "*XgraMenuBar*fontList : -*-helvetica-bold-r-*--14-*", + "*foreground : black", + "*background : gray", + "*fontList : -*-helvetica-medium-r-*--12-*", + NULL + }; + + static char XgraTopLevelTitle[ 128 ] = "Xgra : "; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraChangeTopLevelTitle | +| | +\------------------------------------------------------------*/ + +void XgraChangeTopLevelTitle( Title ) + + char *Title; +{ + autbegin(); + + if ( Title != (char *)NULL ) + { + strcpy( XgraTopLevelTitle + 7, Title ); + } + else + { + XgraTopLevelTitle[ 7 ] = '\0'; + } + + XtVaSetValues( XgraTopLevel, XmNtitle, XgraTopLevelTitle, NULL ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraInitializeRessources | +| | +\------------------------------------------------------------*/ + +void XgraInitializeRessources( argc, argv ) + + int *argc; + char *argv[]; +{ + Arg Args[ 1 ]; + + autbegin(); + + XgraTopLevel = XtVaAppInitialize( + &XgraApplication, + "xgra.xrdb", + NULL, + 0, + argc, + argv, + XgraFallBacks, + NULL + ); + + XgraLoadTopLevelConfig(); + + XgraMainWindow = XtVaCreateManagedWidget( "XgraMainWindow", + xmMainWindowWidgetClass, + XgraTopLevel, + NULL); + + XgraMainForm = XtVaCreateManagedWidget( "XgraMainForm", + xmFormWidgetClass, + XgraMainWindow, + XmNfractionBase, + 200, + NULL ); + + XgraInitializeIcon(); + XgraInitializeMenu(); + XgraInitializeMessage(); + XgraInitializePanel(); + XgraInitializeGraphic(); + XgraInitializeEvent(); + XgraBuildPanelMap(); + XgraInitializeMapEvent(); + XgraInitializeColors(); + XgraInitializeGraphicContext(); + XgraInitializeDialog(); + XgraBuildPanelLibrary(); + + XtSetArg( Args[0], XmNallowShellResize, True ); + XtSetValues( XgraTopLevel, Args, 1 ); + + XtRealizeWidget( XgraTopLevel ); + + autend(); +} diff --git a/alliance/src/xgra/src/XMX_motif.h b/alliance/src/xgra/src/XMX_motif.h new file mode 100644 index 00000000..0080c87f --- /dev/null +++ b/alliance/src/xgra/src/XMX_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 : XGRA | +| | +| File : Motif.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_MOTIF +# define XGRA_MOTIF + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XMX_panel.c b/alliance/src/xgra/src/XMX_panel.c new file mode 100644 index 00000000..ed2117bc --- /dev/null +++ b/alliance/src/xgra/src/XMX_panel.c @@ -0,0 +1,110 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XTB.h" +# include "XMF.h" +# include "XME.h" +# include "XMV.h" +# include "XMT.h" +# include "XMS.h" +# include "XMH.h" +# include "XMX.h" + +# include "XMX_panel.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraInitializePanel | +| | +\------------------------------------------------------------*/ + +void XgraInitializePanel() + +{ + autbegin(); + + XgraBuildPanel( XgraMainWindow, &XgraViewArrowsPanel ); + XgraBuildPanel( XgraMainWindow, &XgraViewZoomPanel ); + XgraBuildPanel( XgraMainWindow, &XgraViewGridPanel ); + XgraBuildPanel( XgraMainWindow, &XgraViewLayerPanel ); + XgraBuildPanel( XgraMainWindow, &XgraEditSearchViewPanel ); + XgraBuildPanel( XgraMainWindow, &XgraEditSelectPanel ); + XgraBuildPanel( XgraMainWindow, &XgraEditIdentifyPanel ); + XgraBuildPanel( XgraMainWindow, &XgraToolsMessagePanel ); + XgraBuildPanel( XgraMainWindow, &XgraSetupInformationsPanel ); + + XgraBuildPresentPanel(); + + autend(); +} diff --git a/alliance/src/xgra/src/XMX_panel.h b/alliance/src/xgra/src/XMX_panel.h new file mode 100644 index 00000000..2f4bd68a --- /dev/null +++ b/alliance/src/xgra/src/XMX_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 : XGRA | +| | +| File : Panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_PANEL +# define XGRA_PANEL + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraInitializePanel(); + +# endif diff --git a/alliance/src/xgra/src/XMX_view.c b/alliance/src/xgra/src/XMX_view.c new file mode 100644 index 00000000..22a93395 --- /dev/null +++ b/alliance/src/xgra/src/XMX_view.c @@ -0,0 +1,667 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : View.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XGR.h" +# include "XMX.h" + +# include "XMX_view.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static long XgraGraphicX1; + static long XgraGraphicX2; + static long XgraGraphicY1; + static long XgraGraphicY2; + static XFontStruct *XgraTextFont; + static GC XgraTextGC; + static GC XgraDrawGC; + static char XgraInterrupt = 0; + + static xgraview_list *XgraHeadView = (xgraview_list *)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Alloc Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraAllocView | +| | +\------------------------------------------------------------*/ + +xgraview_list *XgraAllocView() +{ + return( (xgraview_list *)autallocheap( sizeof( xgraview_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Free Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraFreeView | +| | +\------------------------------------------------------------*/ + +void XgraFreeView( FreeView ) + + xgraview_list *FreeView; +{ + autfreeheap( (char *)FreeView, sizeof( xgraview_list ) ); +} + +/*------------------------------------------------------------\ +| | +| XgraAddViewLater | +| | +\------------------------------------------------------------*/ + +void XgraAddViewLater( Obj ) + + xgraobj_list *Obj; +{ + xgraview_list *View; + + autbegin(); + + View = XgraAllocView(); + + View->OBJECT = Obj; + View->NEXT = XgraHeadView; + XgraHeadView = View; + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDelView | +| | +\------------------------------------------------------------*/ + +void XgraDelView() +{ + xgraview_list *DelView; + xgraview_list *View; + + autbegin(); + + View = XgraHeadView; + XgraHeadView = (xgraview_list *)NULL; + + while( View != (xgraview_list *)NULL ) + { + DelView = View; + View = View->NEXT; + + XgraFreeView( DelView ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraInterruptDisplay | +| | +\------------------------------------------------------------*/ + +void XgraInterruptDisplay() +{ + XEvent Event; + KeySym Key; + char Text; + + autbegin(); + +# ifdef XGRA_CTRL_C + if ( XCheckTypedEvent( XgraGraphicDisplay, KeyPress, &Event ) ) + { + XLookupString( &Event.xkey, &Text, 1, &Key, 0 ); + + if ( Text == '\003' ) + { + XgraInterrupt = 1; + + XBell( XgraGraphicDisplay, 0 ); + } + } +# endif + + signal( SIGALRM, XgraInterruptDisplay ); + alarm( 1 ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraFlushEventDisplay | +| | +\------------------------------------------------------------*/ + +void XgraFlushEventDisplay() +{ + XEvent Event; + + autbegin(); + +# ifdef XGRA_CTRL_C + while ( XCheckTypedEvent( XgraGraphicDisplay, KeyPress, &Event ) ); +# endif + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDisplayArrow | +| | +\------------------------------------------------------------*/ + +char XgraComputeArrow( X1, Y1, X2, Y2, Points ) + + long X1; + long Y1; + long X2; + long Y2; + XPoint *Points; +{ + float LineX; + float LineY; + float HalfX; + float HalfY; + float CrossX; + float CrossY; + float Norm; + + LineX = (float)( X2 - X1 ); + LineY = (float)( Y2 - Y1 ); + + if ( ( LineX != 0.0 ) || + ( LineY != 0.0 ) ) + { + Norm = sqrt( ( LineX * LineX ) + ( LineY * LineY ) ); + Norm = Norm / XgraUnitGridStep; + LineX = LineX / Norm; + LineY = LineY / Norm; + HalfX = LineX / 2; + HalfY = LineY / 2; + CrossX = - HalfY; + CrossY = HalfX; + + Points[ 0 ].x = X1 + LineX; + Points[ 0 ].y = Y1 + LineY; + Points[ 1 ].x = Points[ 0 ].x + LineX + HalfX + CrossX; + Points[ 1 ].y = Points[ 0 ].y + LineY + HalfY + CrossY; + Points[ 2 ].x = Points[ 0 ].x + LineX + HalfX - CrossX; + Points[ 2 ].y = Points[ 0 ].y + LineY + HalfY - CrossY; + + return( XGRA_TRUE ); + } + + return( XGRA_FALSE ); +} + +/*------------------------------------------------------------\ +| | +| XgraDisplayOneObject | +| | +\------------------------------------------------------------*/ + +void XgraDisplayOneObject( Obj ) + + xgraobj_list *Obj; +{ + XPoint Arrow[ 3 ]; + long X1r; + long X2r; + long Y1r; + long Y2r; + long WidthText; + long HeightText; + int Length; + + if ( IsXgraLineLeft( Obj ) ) + { + X1r = Obj->X + Obj->DX; + X2r = Obj->X; + } + else + { + X1r = Obj->X; + X2r = Obj->X + Obj->DX; + } + + if ( IsXgraLineDown( Obj ) ) + { + Y1r = Obj->Y + Obj->DY; + Y2r = Obj->Y; + } + else + { + Y1r = Obj->Y; + Y2r = Obj->Y + Obj->DY; + } + + X1r = (float)( X1r ) * XgraUnitGridStep; + Y1r = (float)( Y1r ) * XgraUnitGridStep; + X2r = (float)( X2r ) * XgraUnitGridStep; + Y2r = (float)( Y2r ) * XgraUnitGridStep; + + X1r = ( X1r / XGRA_UNIT ) - XgraPixelGridX; + X2r = ( X2r / XGRA_UNIT ) - XgraPixelGridX; + Y1r = ( Y1r / XGRA_UNIT ) - XgraPixelGridY; + Y2r = ( Y2r / XGRA_UNIT ) - XgraPixelGridY; + + switch ( GetXgraObjectType( Obj ) ) + { + case XGRA_OBJECT_LINE : + + XDrawLine( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraDrawGC, + X1r, XgraGraphicDy - Y1r, + X2r, XgraGraphicDy - Y2r ); + break; + + case XGRA_OBJECT_ARROW : + + XDrawLine( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraDrawGC, + X1r, XgraGraphicDy - Y1r, + X2r, XgraGraphicDy - Y2r ); + + if ( XgraComputeArrow( X1r, Y1r, X2r, Y2r, Arrow ) ) + { + Arrow[ 0 ].y = XgraGraphicDy - Arrow[ 0 ].y; + Arrow[ 1 ].y = XgraGraphicDy - Arrow[ 1 ].y; + Arrow[ 2 ].y = XgraGraphicDy - Arrow[ 2 ].y; + + XFillPolygon( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraDrawGC, Arrow, 3, + Convex, + CoordModeOrigin ); + } + + break; + + case XGRA_OBJECT_CIRCLE : + + XFillArc( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraDrawGC, + X1r, XgraGraphicDy - Y2r, + X2r - X1r, + Y2r - Y1r, 0, 23040 ); + break; + + case XGRA_OBJECT_RECTANGLE : + + XFillRectangle( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraDrawGC, + X1r, XgraGraphicDy - Y2r, + X2r - X1r, + Y2r - Y1r ); + + break; + + case XGRA_OBJECT_TEXT : + + Length = strlen( Obj->NAME ); + HeightText = XgraTextFont->ascent; + + if ( IsXgraArc( Obj ) ) + { + XDrawString( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraTextGC, + X1r, + XgraGraphicDy - (( Y1r + Y2r - HeightText ) >> 1), + Obj->NAME, Length ); + } + else + { + WidthText = XTextWidth( XgraTextFont, Obj->NAME, Length ); + + XDrawString( XgraGraphicDisplay, + XgraGraphicPixmap, + XgraTextGC, + (( X1r + X2r - WidthText ) >> 1), + XgraGraphicDy - (( Y1r + Y2r - HeightText ) >> 1), + Obj->NAME, Length ); + } + + break; + } +} + +/*------------------------------------------------------------\ +| | +| XgraDisplayFigure | +| | +\------------------------------------------------------------*/ + +void XgraDisplayFigure( GraphicX1, GraphicY1, GraphicX2, GraphicY2 ) + + long GraphicX1; + long GraphicY1; + long GraphicX2; + long GraphicY2; +{ + xgraview_list *View; + xgraobj_list *Obj; + long X1; + long Y1; + long X2; + long Y2; + int Layer; + char DisplayTextArc; + char DisplayTextNode; + + autbegin(); + + DisplayTextArc = XGRA_ACTIVE_NAME_TABLE[ XGRA_ACTIVE_NAME_ARC ]; + DisplayTextNode = XGRA_ACTIVE_NAME_TABLE[ XGRA_ACTIVE_NAME_NODE ]; + + XgraGraphicX1 = GraphicX1; + XgraGraphicX2 = GraphicX2; + XgraGraphicY1 = GraphicY1; + XgraGraphicY2 = GraphicY2; + + if ( XgraUnitGridStep > 10.0 ) + { + XgraTextGC = XgraLargeTextGC; + XgraTextFont = XgraLargeTextFont; + } + else + if ( XgraUnitGridStep > 8.0 ) + { + XgraTextGC = XgraMediumTextGC; + XgraTextFont = XgraMediumTextFont; + } + else + if ( XgraUnitGridStep > 4.0 ) + { + XgraTextGC = XgraSmallTextGC; + XgraTextFont = XgraSmallTextFont; + } + else + { + DisplayTextArc = 0; + DisplayTextNode = 0; + } + + XgraClearGraphicWindow( GraphicX1, + XgraGraphicDy - GraphicY2, + GraphicX2 - GraphicX1, + GraphicY2 - GraphicY1 ); + + if ( XgraFigure == (xautgraph *)NULL ) return; + + X1 = GraphicX1 + XgraPixelGridX; + X2 = GraphicX2 + XgraPixelGridX; + Y1 = GraphicY1 + XgraPixelGridY; + Y2 = GraphicY2 + XgraPixelGridY; + + X1 = ( X1 / XgraUnitGridStep ); + Y1 = ( Y1 / XgraUnitGridStep ); + X2 = ( X2 / XgraUnitGridStep ); + Y2 = ( Y2 / XgraUnitGridStep ); + + 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 * XGRA_UNIT; + X2 = X2 * XGRA_UNIT; + Y1 = Y1 * XGRA_UNIT; + Y2 = Y2 * XGRA_UNIT; + + XgraInterrupt = 0; + + signal( SIGALRM, XgraInterruptDisplay ); + alarm( 1 ); + + for ( Layer = 0; Layer < XGRA_MAX_LAYER; Layer++ ) + { + if ( XgraInterrupt ) break; + + if ( XGRA_ACTIVE_LAYER_TABLE[ Layer ] == 0 ) continue; + + XgraDrawGC = XgraLayerDrawGC[ Layer ]; + + for ( Obj = XgraFigure->OBJECT[ Layer ]; + Obj != (xgraobj_list *)NULL; + Obj = Obj->NEXT ) + { + if ( XgraInterrupt ) break; + + if ( XGRA_ACTIVE_LAYER_TABLE[ Obj->LAYER ] == 0 ) continue; + + if ( ( Obj->X <= X2 ) && + ( Obj->Y <= Y2 ) && + ( Obj->X + Obj->DX >= X1 ) && + ( Obj->Y + Obj->DY >= Y1 ) ) + { + if ( ( IsXgraAccept( Obj ) ) || + ( IsXgraConnect( Obj ) ) ) + { + XgraAddViewLater( Obj ); + } + else + { + XgraDisplayOneObject( Obj ); + } + } + } + } + + for ( View = XgraHeadView; + View != (xgraview_list *)NULL; + View = View->NEXT ) + { + Obj = View->OBJECT; + + if ( IsXgraAccept( Obj ) ) + { + XgraDrawGC = XgraAcceptDrawGC; + } + else + { + XgraDrawGC = XgraConnectDrawGC; + } + + XgraDisplayOneObject( Obj ); + } + + XgraDelView(); + + for ( Layer = 0; Layer < XGRA_MAX_LAYER; Layer++ ) + { + if ( XgraInterrupt ) break; + + if ( XGRA_ACTIVE_LAYER_TABLE[ Layer ] == 0 ) continue; + + for ( Obj = XgraFigure->TEXT[ Layer ]; + Obj != (xgraobj_list *)NULL; + Obj = Obj->NEXT ) + { + if ( XgraInterrupt ) break; + + if ( XGRA_ACTIVE_LAYER_TABLE[ Obj->LAYER ] == 0 ) continue; + + if ( ( Obj->X <= X2 ) && + ( Obj->Y <= Y2 ) && + ( Obj->X + Obj->DX >= X1 ) && + ( Obj->Y + Obj->DY >= Y1 ) ) + { + if ( ( IsXgraArc( Obj ) && DisplayTextArc ) || + ( IsXgraNode( Obj ) && DisplayTextNode ) ) + { + XgraDisplayOneObject( Obj ); + } + } + } + } + + alarm( 0 ); + XgraFlushEventDisplay(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraDisplayObject | +| | +\------------------------------------------------------------*/ + +void XgraDisplayObject( Obj ) + + xgraobj_list *Obj; +{ + xgraobj_list *ScanObj; + long Xmin; + long Ymin; + long Xmax; + long Ymax; + + autbegin(); + + Xmin = Obj->X; + Ymin = Obj->Y; + Xmax = Xmin + Obj->DX; + Ymax = Ymin + Obj->DY; + + ScanObj = Obj->LINK; + + while ( ScanObj != Obj ) + { + if ( Xmin > ScanObj->X ) + { + Xmin = ScanObj->X; + } + + if ( Xmax < ( ScanObj->X + ScanObj->DX ) ) + { + Xmax = ScanObj->X + ScanObj->DX; + } + + if ( Ymin > ScanObj->Y ) + { + Ymin = ScanObj->Y; + } + + if ( Ymax < ( ScanObj->Y + ScanObj->DY ) ) + { + Ymax = ScanObj->Y + ScanObj->DY; + } + + ScanObj = ScanObj->LINK; + } + + Xmin = (float)( Xmin - XGRA_UNIT ) * XgraUnitGridStep; + Ymin = (float)( Ymin - XGRA_UNIT ) * XgraUnitGridStep; + Xmax = (float)( Xmax + XGRA_UNIT ) * XgraUnitGridStep; + Ymax = (float)( Ymax + XGRA_UNIT ) * XgraUnitGridStep; + + Xmin = ( Xmin / XGRA_UNIT ) - XgraPixelGridX - 1; + Xmax = ( Xmax / XGRA_UNIT ) - XgraPixelGridX + 1; + Ymin = ( Ymin / XGRA_UNIT ) - XgraPixelGridY - 1; + Ymax = ( Ymax / XGRA_UNIT ) - XgraPixelGridY + 1; + + if ( Xmin < 0 ) Xmin = 0; + if ( Ymin < 0 ) Ymin = 0; + + if ( Xmax > XgraGraphicDx ) Xmax = XgraGraphicDx; + if ( Ymax > XgraGraphicDy ) Ymax = XgraGraphicDy; + + if ( ( Xmax > 0 ) && + ( Ymax > 0 ) && + ( Xmin < XgraGraphicDx ) && + ( Ymin < XgraGraphicDy ) ) + { + XgraDisplayFigure( Xmin, Ymin , Xmax, Ymax ); + + XgraRefreshGraphicWindow( Xmin, XgraGraphicDy - Ymax, + Xmax - Xmin, Ymax - Ymin ); + } + + autend(); +} diff --git a/alliance/src/xgra/src/XMX_view.h b/alliance/src/xgra/src/XMX_view.h new file mode 100644 index 00000000..b6e83f4e --- /dev/null +++ b/alliance/src/xgra/src/XMX_view.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 : XGRA | +| | +| File : View.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_VIEW +# define XGRA_VIEW + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ + + typedef struct xgraview_list + { + struct xgraview_list *NEXT; + xgraobj_list *OBJECT; + + } xgraview_list; + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XSB.h b/alliance/src/xgra/src/XSB.h new file mode 100644 index 00000000..6e639881 --- /dev/null +++ b/alliance/src/xgra/src/XSB.h @@ -0,0 +1,160 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : XSB.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XSB +# define XGRA_XSB + +/*------------------------------------------------------\ +| | +| Others | +| | +\------------------------------------------------------*/ + +# define XGRA_TRUE 1 +# define XGRA_FALSE 0 + +# define XGRA_ERROR 1 +# define XGRA_OK 0 + +# define XGRA_NORTH 0 +# define XGRA_SOUTH 1 +# define XGRA_EAST 2 +# define XGRA_WEST 3 + +# define XGRA_NORTH_MASK 1 +# define XGRA_SOUTH_MASK 2 +# define XGRA_WEST_MASK 4 +# define XGRA_EAST_MASK 8 + +# define XGRA_DEFAULT_FIGURE_NAME "NONAME" + +/*------------------------------------------------------\ +| | +| Layer | +| | +\------------------------------------------------------*/ + +# define XGRA_MAX_LAYER 10 + +/*------------------------------------------------------\ +| | +| Active Name | +| | +\------------------------------------------------------*/ + +# define XGRA_ACTIVE_NAME_NODE 0 +# define XGRA_ACTIVE_NAME_ARC 1 +# define XGRA_MAX_ACTIVE_NAME 2 + +/*------------------------------------------------------------\ +| | +| Edit Mode | +| | +\------------------------------------------------------------*/ + +# define XGRA_EDIT_MEASURE (char)0x00 +# define XGRA_EDIT_IDENTIFY (char)0x01 +# define XGRA_EDIT_CONNECTED (char)0x02 + +# define XGRA_ZOOM_CENTER (char)0x80 +# define XGRA_ZOOM_IN (char)0x81 +# define XGRA_ZOOM_PAN (char)0x82 + +# define XGRA_ZOOM_MARK (char)0x80 + +/*------------------------------------------------------------\ +| | +| Input Mode | +| | +\------------------------------------------------------------*/ + +# define XGRA_INPUT_POINT 0 +# define XGRA_INPUT_ORTHO 1 +# define XGRA_INPUT_LINE 2 +# define XGRA_INPUT_LSTRING 3 +# define XGRA_INPUT_BOX 4 +# define XGRA_INPUT_SORTHO 5 +# define XGRA_INPUT_HALF_BOX 6 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char XGRA_ACTIVE_LAYER_TABLE[ XGRA_MAX_LAYER ]; + extern char XGRA_ACTIVE_NAME_TABLE[ XGRA_MAX_ACTIVE_NAME ]; + + extern char *XGRA_CURSOR_COLOR_NAME; + extern char *XGRA_BACKGROUND_COLOR_NAME; + extern char *XGRA_FOREGROUND_COLOR_NAME; + extern char *XGRA_ACCEPT_COLOR_NAME; + extern char *XGRA_CONNECT_COLOR_NAME; + + extern long XGRA_CURSOR_SIZE; + extern float XGRA_LOWER_GRID_STEP; + extern long XGRA_UNIT; + extern char *XGRA_LAYER_NAME_TABLE[ XGRA_MAX_LAYER ][ 3 ]; + extern char *XGRA_PARAM_NAME; + + extern char *XGRA_XMS_FILE_NAME; + extern char *XgraFirstFileName; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern char *XgraPostTreatString(); + extern void XgraLoadParameters(); + extern void Xgragetenv(); + +# endif diff --git a/alliance/src/xgra/src/XSB_error.c b/alliance/src/xgra/src/XSB_error.c new file mode 100644 index 00000000..8b53891f --- /dev/null +++ b/alliance/src/xgra/src/XSB_error.c @@ -0,0 +1,178 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Xsb Errors | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XSB_error.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +void XsbError( ErrorType, Message, Data ) + + char ErrorType; + char *Message; + long Data; +{ + fflush(stdout); + + switch ( ErrorType ) + { + case DEFINE_MISSING : + + fprintf( stderr, "Xsb: Some defines missing\n"); + break; + + case TABLE_MISSING : + + fprintf( stderr, "Xsb: Some tables missing\n"); + break; + + case LINE_EXPECTED : + + fprintf( stderr, "Xsb: %s expected line %lu\n", + Message, Data ); + break; + + case UNKNOWN_DEFINE : + + fprintf( stderr, "Xsb: Unknown define %s line %lu\n", + Message, Data ); + break; + + case NOT_DEFINED : + + fprintf( stderr, "Xsb: %s not defined line %lu\n", + Message, Data ); + break; + + case TOO_SMAL : + + fprintf( stderr, "Xsb: %s too smal line %lu\n", + Message, Data ); + break; + + case MISSING_VALUE : + + fprintf( stderr, "Xsb: Missing value at line %lu\n", + Data ); + break; + + case MISSING_NAME : + + fprintf( stderr, "Xsb: Missing name of %s line %lu\n", + Message, Data ); + break; + + case UNEXPECTED_LINE : + + fprintf( stderr, "Xsb: %s unexpected line %lu\n", + Message, Data ); + break; + + case UNEXPECTED_EOF : + + fprintf( stderr, "Xsb: Unexpected end of file, missing definitions\n"); + break; + + case TOO_MANY_WORDS : + + fprintf( stderr, "Xsb: Too many words %s unexpected line %lu\n", + Message, Data ); + break; + + case MISSING_TABLE : + + fprintf( stderr, "Xsb: Missing value in %s table line %lu\n", + Message, Data ); + break; + + case OPEN_FILE : + + fprintf( stderr, "Xsb: Parameters file %s can't be opened\n", + Message ); + break; + + case UNKNOWN_TABLE : + + fprintf( stderr, "Xsb: Unknown table %s line %lu\n", + Message , Data ); + break; + + case SYNTAX_ERROR : + + fprintf( stderr, "Xsb: Syntax Error %s at line %lu\n", + Message , Data ); + break; + + case ILLEGAL_FLOAT : + + fprintf( stderr, "Xsb: Illegal floating point number %s line %lu\n", + Message , Data ); + break; + } + + exit( 1 ); +} diff --git a/alliance/src/xgra/src/XSB_error.h b/alliance/src/xgra/src/XSB_error.h new file mode 100644 index 00000000..c002b72f --- /dev/null +++ b/alliance/src/xgra/src/XSB_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 : XGRA | +| | +| File : Xsb Errors | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XSB_ERROR +# define XSB_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/xgra/src/XSB_parse.c b/alliance/src/xgra/src/XSB_parse.c new file mode 100644 index 00000000..6fe281d0 --- /dev/null +++ b/alliance/src/xgra/src/XSB_parse.c @@ -0,0 +1,711 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : XsbParse.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XSB_error.h" +# include "XSB_parse.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Global Variables | +| | +\------------------------------------------------------------*/ + + char *XGRA_PARAM_NAME = (char *)NULL; + char *XGRA_LAYER_NAME_TABLE[ XGRA_MAX_LAYER ][ 3 ]; + +/*------------------------------------------------------------\ +| | +| Private Variables | +| | +\------------------------------------------------------------*/ + + static char *XgraDefaultTechnoName = XGRA_DEFAULT_PARAM_NAME; + +/*------------------------------------------------------------\ +| | +| Table variables | +| | +\------------------------------------------------------------*/ + + char *XGRA_CURSOR_COLOR_NAME; + char *XGRA_BACKGROUND_COLOR_NAME; + char *XGRA_FOREGROUND_COLOR_NAME; + char *XGRA_ACCEPT_COLOR_NAME; + char *XGRA_CONNECT_COLOR_NAME; + + long XGRA_CURSOR_SIZE; + float XGRA_LOWER_GRID_STEP; + long XGRA_UNIT; + + char *XGRA_NOT_DEFINE = ""; + +/*------------------------------------------------------------\ +| | +| Keywords variables | +| | +\------------------------------------------------------------*/ + + static char KeywordDefined = 0; + + static char *DefineKeyword; + static char *TableKeyword; + static char *EndTableKeyword; + static char *EndRecordKeyword; + static char *LowerGridStepKeyword; + static char *CursorColorNameKeyword; + static char *BackgroundColorNameKeyword; + static char *ForegroundColorNameKeyword; + static char *AcceptColorNameKeyword; + static char *ConnectColorNameKeyword; + static char *CursorSizeKeyword; + static char *UnitKeyword; + static char *LayerNameKeyword; + + static keyword KeywordDefine[ XSB_MAX_KEYWORD ] = + + { + "None", 0 + }; + +/*------------------------------------------------------------\ +| | +| File variables | +| | +\------------------------------------------------------------*/ + + static FILE *XsbFile; + static char XsbBuffer[ XSB_MAX_BUFFER ]; + static long XsbCurrentLine; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Xsb File Get String | +| | +\------------------------------------------------------------*/ + +char *XsbFileGetString( String, Size ) + + char *String; + int Size; +{ + register char *RegisterString; + register Register; + + autbegin(); + + RegisterString = String; + + while (--Size > 0 && (Register = getc( XsbFile )) != EOF ) + { + if ((*RegisterString++ = Register) == '\\') + { + if ((Register = getc( XsbFile )) == '\n') + { + *(RegisterString - 1) = ' '; + } + else + { + ungetc( Register, XsbFile ); + } + } + else + { + if ( Register == '\n') break; + } + } + + *RegisterString = '\0'; + + autend(); + return ( ( Register == EOF ) && + ( RegisterString == String ) ) ? (char *)NULL : String; +} + +/*------------------------------------------------------------\ +| | +| Xsb File Get Line | +| | +\------------------------------------------------------------*/ + +void XsbGetLine( Buffer ) + + char *Buffer; +{ + char *Check; + char *String; + char OneComment; + + autbegin(); + + do + { + OneComment = 0; + + Check = XsbFileGetString( Buffer, XSB_MAX_BUFFER ); + + if ( Check != (char *)NULL ) + { + XsbCurrentLine++; + } + else + { + XsbError( UNEXPECTED_EOF, (char *)NULL, XsbCurrentLine ); + } + + if ( String = strchr( Buffer, XSB_COMMENT_CHAR )) + { + if ( String == Buffer ) + { + OneComment = 1; + } + else + { + *(String - 1) = '\0'; + } + } + + while (*Buffer != '\0' && strchr( XSB_SEPARATORS_STRING, *Buffer)) + { + Buffer = Buffer + 1;; + } + + if (*Buffer == '\0') OneComment = 1; + + } + while ( OneComment == 1); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Xsb Check Keyword | +| | +\------------------------------------------------------------*/ + +char XsbCheckKeyword( Word ) + + char *Word; +{ + if ( ( Word == DefineKeyword ) || + ( Word == TableKeyword ) ) + { + return 1; + } + else + { + return 0; + } +} + +/*------------------------------------------------------------\ +| | +| Xsb Get First word | +| | +\------------------------------------------------------------*/ + +char *XsbGetFirstWord( Buffer, IsKeyword, Hash ) + + char *Buffer; + char IsKeyword; + char Hash; +{ + char *String; + char *Text; + int Index; + + autbegin(); + + if ( String = (char *)strtok( Buffer, XSB_SEPARATORS_STRING )) + { + if ( Hash ) + { + String = namealloc( String ); + } + else + { + Text = autallocblock( strlen( String ) + 1 ); + strcpy( Text, String ); + String = Text; + + for ( Index = 0; Text[ Index ]; Index++ ) + { + if ( Text[ Index ] == '_' ) Text[ Index ] = ' '; + } + } + + if ( ( IsKeyword ) && XsbCheckKeyword( String ) ) + { + XsbError( UNEXPECTED_LINE, String, XsbCurrentLine ); + } + } + + autend(); + return( String ); +} + +/*------------------------------------------------------------\ +| | +| Xsb Get Next word | +| | +\------------------------------------------------------------*/ + +char *XsbGetNextWord( IsKeyword, Hash ) + + char IsKeyword; + char Hash; +{ + char *String; + char *Text; + int Index; + + autbegin(); + + if ( String = (char *)strtok( (char *)NULL, XSB_SEPARATORS_STRING )) + { + if ( Hash ) + { + String = namealloc( String ); + } + else + { + Text = autallocblock( strlen( String ) + 1 ); + strcpy( Text, String ); + String = Text; + + for ( Index = 0; Text[ Index ]; Index++ ) + { + if ( Text[ Index ] == '_' ) Text[ Index ] = ' '; + } + } + + if ( ( IsKeyword ) && XsbCheckKeyword( String ) ) + { + XsbError( UNEXPECTED_LINE, String, XsbCurrentLine ); + } + } + + autend(); + return( String ); +} + +/*------------------------------------------------------------\ +| | +| Xsb Keyword Compare | +| | +\------------------------------------------------------------*/ + +int XsbKeywordCompare( FirstKey, SecondKey ) + + keyword *FirstKey; + keyword *SecondKey; +{ + return strcmp( FirstKey->NAME, SecondKey->NAME ); +} + +/*------------------------------------------------------------\ +| | +| Xsb Get String Value | +| | +\------------------------------------------------------------*/ + +long XsbGetStringValue( String ) + + char *String; +{ + long Value; + keyword *Keyword; + keyword Entry; + + autbegin(); + + if ( sscanf( String, "%d", &Value) ) + { + autend(); + return ( Value ); + } + + Entry.NAME = String; + + Keyword = (keyword *)bsearch( (char *)(&Entry), + (char *)KeywordDefine, + XSB_MAX_KEYWORD, sizeof( keyword ), + XsbKeywordCompare ); + + if ( Keyword == (keyword *)NULL ) + { + XsbError( UNEXPECTED_LINE, String, XsbCurrentLine ); + } + + autend(); + return( Keyword->VALUE ); +} + +/*------------------------------------------------------------\ +| | +| Xsb Get String Float | +| | +\------------------------------------------------------------*/ + +float XsbGetStringFloat( String ) + + char *String; +{ + float Value; + + autbegin(); + + if ( ! sscanf( String, "%g", &Value) ) + { + XsbError( ILLEGAL_FLOAT, String, XsbCurrentLine ); + } + + autend(); + return ( Value ); +} + +/*------------------------------------------------------------\ +| | +| Xsb Get Number | +| | +\------------------------------------------------------------*/ + +long XsbGetNumber( String ) + + char *String; +{ + long Value; + + autbegin(); + + if ( ! sscanf( String, "%d", &Value )) + { + XsbError( UNEXPECTED_LINE, "number", XsbCurrentLine ); + } + + autend(); + return Value; +} + + +/*------------------------------------------------------------\ +| | +| Xsb Read Layer Name | +| | +\------------------------------------------------------------*/ + +void XsbReadLayerName() + +{ + char Layer; + char LayerCount; + char EndTable; + char Field; + char *FirstWord; + + autbegin(); + + EndTable = 0; + LayerCount = 0; + + while ( ( EndTable != 1 ) && + ( LayerCount <= XGRA_MAX_LAYER ) ) + { + XsbGetLine( XsbBuffer ); + + FirstWord = XsbGetFirstWord( XsbBuffer, 1, 1 ); + + if ( FirstWord == EndTableKeyword ) + { + EndTable = 1; + } + else + if ( LayerCount < XGRA_MAX_LAYER ) + { + Layer = XsbGetStringValue( FirstWord ); + + for ( Field = 0; Field < 3; Field++ ) + { + FirstWord = XsbGetNextWord( 1, 0 ); + + if ( FirstWord == EndRecordKeyword ) + { + XsbError( MISSING_VALUE, (char *)NULL, XsbCurrentLine ); + } + else + { + XGRA_LAYER_NAME_TABLE [ Layer ][ Field ] = FirstWord; + } + } + + FirstWord = XsbGetNextWord( 0, 1 ); + + if ( FirstWord != EndRecordKeyword ) + { + XsbError( TOO_MANY_WORDS, FirstWord, XsbCurrentLine ); + } + } + + LayerCount = LayerCount + 1; + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Xsb Read Parameters | +| | +\------------------------------------------------------------*/ + +void XsbReadParam() + +{ + char *FirstWord; + char *SecondWord; + long Continue; + + autbegin(); + + Continue = 0; + + while ( Continue != XSB_ALL_DEFINED_MASK ) + { + XsbGetLine( XsbBuffer ); + + FirstWord = XsbGetFirstWord( XsbBuffer, 0, 1); + + if ( FirstWord == DefineKeyword ) + { + FirstWord = XsbGetNextWord( 1, 1 ); + + if (! FirstWord ) + { + XsbError( MISSING_NAME, DefineKeyword, XsbCurrentLine ); + } + + SecondWord = XsbGetNextWord( 1, 0 ); + + if (! SecondWord ) + { + XsbError( MISSING_VALUE, SecondWord, XsbCurrentLine ); + } + + if ( FirstWord == LowerGridStepKeyword ) + { + XGRA_LOWER_GRID_STEP = XsbGetStringFloat( SecondWord ); + + Continue |= XSB_LOWER_GRID_STEP_MASK; + } + else + if ( FirstWord == CursorColorNameKeyword ) + { + XGRA_CURSOR_COLOR_NAME = SecondWord; + + Continue |= XSB_CURSOR_COLOR_NAME_MASK; + } + else + if ( FirstWord == BackgroundColorNameKeyword ) + { + XGRA_BACKGROUND_COLOR_NAME = SecondWord; + + Continue |= XSB_BACKGROUND_COLOR_NAME_MASK; + } + else + if ( FirstWord == ForegroundColorNameKeyword ) + { + XGRA_FOREGROUND_COLOR_NAME = SecondWord; + + Continue |= XSB_FOREGROUND_COLOR_NAME_MASK; + } + else + if ( FirstWord == AcceptColorNameKeyword ) + { + XGRA_ACCEPT_COLOR_NAME = SecondWord; + + Continue |= XSB_ACCEPT_COLOR_NAME_MASK; + } + else + if ( FirstWord == ConnectColorNameKeyword ) + { + XGRA_CONNECT_COLOR_NAME = SecondWord; + + Continue |= XSB_CONNECT_COLOR_NAME_MASK; + } + else + if ( FirstWord == CursorSizeKeyword ) + { + XGRA_CURSOR_SIZE = XsbGetStringValue( SecondWord ); + + Continue |= XSB_CURSOR_SIZE_MASK; + } + else + if ( FirstWord == UnitKeyword ) + { + XGRA_UNIT = XsbGetStringValue( SecondWord ); + + Continue |= XSB_UNIT_MASK; + } + else + { + XsbError( UNKNOWN_DEFINE, FirstWord, XsbCurrentLine ); + } + } + else + if ( FirstWord == TableKeyword ) + { + if (!( FirstWord = XsbGetNextWord(1, 1))) + { + XsbError( MISSING_NAME, TableKeyword ); + } + + if ( FirstWord == LayerNameKeyword ) + { + XsbReadLayerName(); + + Continue |= XSB_LAYER_NAME_MASK; + } + else + { + XsbError( UNKNOWN_TABLE, FirstWord, XsbCurrentLine ); + } + } + else + { + XsbError( SYNTAX_ERROR, FirstWord, XsbCurrentLine ); + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| Xsb Load Parameters | +| | +\------------------------------------------------------------*/ + +void XgraLoadParameters() + +{ + short Layer; + + autbegin(); + + XGRA_PARAM_NAME = getenv( "XGRA_PARAM_NAME" ); + + if ( XGRA_PARAM_NAME == (char *)NULL ) + { + XGRA_PARAM_NAME = XgraDefaultTechnoName; + } + + if ( ! KeywordDefined ) + { + DefineKeyword = namealloc( DEFINE_KEYWORD ); + TableKeyword = namealloc( TABLE_KEYWORD ); + EndTableKeyword = namealloc( END_TABLE_KEYWORD ); + EndRecordKeyword = namealloc( END_RECORD_KEYWORD ); + LowerGridStepKeyword = namealloc( LOWER_GRID_STEP_KEYWORD ); + CursorColorNameKeyword = namealloc( CURSOR_COLOR_NAME_KEYWORD ); + BackgroundColorNameKeyword = namealloc( BACKGROUND_COLOR_NAME_KEYWORD ); + ForegroundColorNameKeyword = namealloc( FOREGROUND_COLOR_NAME_KEYWORD ); + AcceptColorNameKeyword = namealloc( ACCEPT_COLOR_NAME_KEYWORD ); + ConnectColorNameKeyword = namealloc( CONNECT_COLOR_NAME_KEYWORD ); + CursorSizeKeyword = namealloc( CURSOR_SIZE_KEYWORD ); + UnitKeyword = namealloc( UNIT_KEYWORD ); + LayerNameKeyword = namealloc( LAYER_NAME_KEYWORD ); + + KeywordDefined = 1; + } + + XGRA_LOWER_GRID_STEP = 0.0; + + XGRA_CURSOR_COLOR_NAME = (char *)NULL; + XGRA_BACKGROUND_COLOR_NAME = (char *)NULL; + XGRA_FOREGROUND_COLOR_NAME = (char *)NULL; + XGRA_ACCEPT_COLOR_NAME = (char *)NULL; + XGRA_CONNECT_COLOR_NAME = (char *)NULL; + + XGRA_CURSOR_SIZE = 5; + XGRA_UNIT = 4; + + for ( Layer = 0; Layer < XGRA_MAX_LAYER; Layer++ ) + { + XGRA_LAYER_NAME_TABLE[ Layer ][0] = XGRA_NOT_DEFINE; + XGRA_LAYER_NAME_TABLE[ Layer ][1] = (char *)NULL; + XGRA_LAYER_NAME_TABLE[ Layer ][2] = (char *)NULL; + } + + if ( !( XsbFile = fopen( XGRA_PARAM_NAME, "r"))) + + XsbError( OPEN_FILE, XGRA_PARAM_NAME, 0); + + XsbReadParam(); + + fclose( XsbFile ); + + autend(); +} diff --git a/alliance/src/xgra/src/XSB_parse.h b/alliance/src/xgra/src/XSB_parse.h new file mode 100644 index 00000000..1189b467 --- /dev/null +++ b/alliance/src/xgra/src/XSB_parse.h @@ -0,0 +1,112 @@ +/*------------------------------------------------------------\ +| | +| 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 : XSB | +| | +| File : Xsbparse.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XSB_PARSE +# define XSB_PARSE + +# define XSB_MAX_BUFFER 255 +# define XSB_MAX_KEYWORD 1 + +# define XSB_SEPARATORS_STRING " \t\n" +# define XSB_COMMENT_CHAR '#' + +/*------------------------------------------------------------\ +| | +| Keyword Constants | +| | +\------------------------------------------------------------*/ + +# define DEFINE_KEYWORD "DEFINE" +# define TABLE_KEYWORD "TABLE" +# define END_TABLE_KEYWORD "END" +# define END_RECORD_KEYWORD NULL + +# define LOWER_GRID_STEP_KEYWORD "XGRA_LOWER_GRID_STEP" +# define CURSOR_COLOR_NAME_KEYWORD "XGRA_CURSOR_COLOR_NAME" +# define BACKGROUND_COLOR_NAME_KEYWORD "XGRA_BACKGROUND_COLOR_NAME" +# define FOREGROUND_COLOR_NAME_KEYWORD "XGRA_FOREGROUND_COLOR_NAME" +# define ACCEPT_COLOR_NAME_KEYWORD "XGRA_ACCEPT_COLOR_NAME" +# define CONNECT_COLOR_NAME_KEYWORD "XGRA_CONNECT_COLOR_NAME" +# define CURSOR_SIZE_KEYWORD "XGRA_CURSOR_SIZE" +# define UNIT_KEYWORD "XGRA_UNIT" +# define LAYER_NAME_KEYWORD "XGRA_LAYER_NAME" + +# define XSB_LOWER_GRID_STEP_MASK 0x00001 +# define XSB_CURSOR_COLOR_NAME_MASK 0x00002 +# define XSB_BACKGROUND_COLOR_NAME_MASK 0x00004 +# define XSB_FOREGROUND_COLOR_NAME_MASK 0x00008 +# define XSB_ACCEPT_COLOR_NAME_MASK 0x00010 +# define XSB_CONNECT_COLOR_NAME_MASK 0x00020 +# define XSB_CURSOR_SIZE_MASK 0x00040 +# define XSB_UNIT_MASK 0x00080 +# define XSB_LAYER_NAME_MASK 0x00100 + +# define XSB_ALL_DEFINED_MASK 0x001FF + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ + + typedef struct keyword + { + char *NAME; + char VALUE; + + } keyword; + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XSB_share.c b/alliance/src/xgra/src/XSB_share.c new file mode 100644 index 00000000..789cff07 --- /dev/null +++ b/alliance/src/xgra/src/XSB_share.c @@ -0,0 +1,146 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : Share.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XSB_share.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + char XGRA_ACTIVE_NAME_TABLE [ XGRA_MAX_ACTIVE_NAME ] = + { + 1, /* PLACE TEXT */ + 1 /* PLACE ARC */ + }; + + char XGRA_ACTIVE_LAYER_TABLE [ XGRA_MAX_LAYER ] = + { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + }; + + char *XgraFirstFileName = (char *)NULL; + char *XGRA_XMS_FILE_NAME = (char *)NULL; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraPostTreatString | +| | +\------------------------------------------------------------*/ + +char *XgraPostTreatString( Text ) + + char *Text; +{ + char OnlySpace; + int Counter; + + autbegin(); + + if ( Text != (char *)NULL ) + { + OnlySpace = 1; + + for ( Counter = 0; Text[ Counter ]; Counter++ ) + { + if ( Text[ Counter ] != ' ' ) OnlySpace = 0; + } + + if ( OnlySpace ) Text = (char *)NULL; + } + + autend(); + return( Text ); +} + +/*------------------------------------------------------------\ +| | +| Xgragetenv | +| | +\------------------------------------------------------------*/ + +void Xgragetenv() +{ + char *Env; + + Env = getenv( "HOME" ); + + if ( Env == (char *)NULL ) + { + XGRA_XMS_FILE_NAME = XMS_FILE_NAME; + } + else + { + XGRA_XMS_FILE_NAME = + + (char *)autallocblock( strlen( Env ) + strlen( XMS_FILE_NAME ) + 2 ); + + strcpy( XGRA_XMS_FILE_NAME, Env ); + strcat( XGRA_XMS_FILE_NAME, "/" ); + strcat( XGRA_XMS_FILE_NAME, XMS_FILE_NAME ); + } +} diff --git a/alliance/src/xgra/src/XSB_share.h b/alliance/src/xgra/src/XSB_share.h new file mode 100644 index 00000000..da37c271 --- /dev/null +++ b/alliance/src/xgra/src/XSB_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 : XGRA | +| | +| File : Share.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XSB_SHARE +# define XSB_SHARE + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XTB.h b/alliance/src/xgra/src/XTB.h new file mode 100644 index 00000000..f1ade4db --- /dev/null +++ b/alliance/src/xgra/src/XTB.h @@ -0,0 +1,215 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : XTB.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XTB +# define XGRA_XTB + +/*------------------------------------------------------------\ +| | +| MouseCursors | +| | +\------------------------------------------------------------*/ + +# define XGRA_NORMAL_CURSOR 0 +# define XGRA_WATCH_CURSOR 1 +# define XGRA_PIRATE_CURSOR 2 +# define XGRA_CROSS_CURSOR 3 +# define XGRA_NO_CURSOR 4 + +# define XGRA_MAX_CURSOR 5 + +/*------------------------------------------------------------\ +| | +| DialogBoxType | +| | +\------------------------------------------------------------*/ + +# define XGRA_DIALOG_MESSAGE 0 +# define XGRA_DIALOG_ERROR 1 +# define XGRA_DIALOG_INFO 2 +# define XGRA_DIALOG_QUESTION 3 +# define XGRA_DIALOG_WARNING 4 +# define XGRA_DIALOG_WORKING 5 +# define XGRA_DIALOG_FILE 6 +# define XGRA_DIALOG_PROMPT 7 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraDialogBox | +| | +\------------------------------------------------------------*/ + + typedef struct XgraDialogItem + + { + char *LABEL; + char TYPE; + Widget WIDGET; + void (*CALLBACK_OK)(); + XtPointer CALLDATA_OK; + void (*CALLBACK_CANCEL)(); + XtPointer CALLDATA_CANCEL; + + } XgraDialogItem; + + +/*------------------------------------------------------------\ +| | +| XgraMenuItem | +| | +\------------------------------------------------------------*/ + + typedef struct XgraMenuItem + + { + 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 XgraMenuItem *NEXT; + + } XgraMenuItem; + +/*------------------------------------------------------------\ +| | +| XgraPanelButtonItem | +| | +\------------------------------------------------------------*/ + + typedef struct XgraPanelButtonItem + + { + 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; + + } XgraPanelButtonItem; + +/*------------------------------------------------------------\ +| | +| XgraPanelItem | +| | +\------------------------------------------------------------*/ + + typedef struct XgraPanelItem + + { + 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; + XgraPanelButtonItem *LIST; + + } XgraPanelItem; + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern char *XgraPanelButtonDisable; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void XgraDestroyDialogCallback(); + extern void XgraExitDialogCallback(); + + extern void XgraSetMouseCursor(); + extern Pixmap XgraCreatePixmap(); + extern void XgraSetIcon(); + extern void XgraBuildMenus(); + extern void XgraBuildPanel(); + extern void XgraEnterPanel(); + extern void XgraExitPanel(); + extern void XgraBuildDialog(); + extern void XgraEnterDialog(); + extern void XgraReEnterDialog(); + extern void XgraExitDialog(); + extern void XgraWarningMessage(); + extern void XgraErrorMessage(); + +# endif diff --git a/alliance/src/xgra/src/XTB_cursor.c b/alliance/src/xgra/src/XTB_cursor.c new file mode 100644 index 00000000..7f6aedb2 --- /dev/null +++ b/alliance/src/xgra/src/XTB_cursor.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 : XGRA | +| | +| File : cursor.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include "mut.h" +# include "aut.h" +# include "XTB.h" +# include "XSB.h" +# include "XTB_cursor.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static XgraMouseCursor XgraMouseCursorArray [ XGRA_MAX_CURSOR ] = + + { + { XC_left_ptr , True }, + { XC_watch , True }, + { XC_pirate , True }, + { XC_cross_reverse , True }, + { 0 , True } + }; + + static char XgraCursorMaskOr [ 8 ] = + + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + static char XgraCursorMaskAnd [ 8 ] = + + { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraSetMouseCursor | +| | +\------------------------------------------------------------*/ + +void XgraSetMouseCursor( MainWidget, CursorType ) + + Widget MainWidget; + char CursorType; +{ + Display *DisplayId; + Window MainWindow; + XColor White; + XColor Black; + XColor ForgetIt; + Colormap ColorMap; + Pixmap MaskOr; + Pixmap MaskAnd; + Cursor Type; + Cursor NewCursor; + + autbegin(); + + DisplayId = XtDisplay( MainWidget ); + MainWindow = XtWindow( MainWidget ); + + Type = XgraMouseCursorArray[ CursorType ].CURSOR; + + if ( XgraMouseCursorArray[ CursorType ].MAKE == True ) + { + if ( Type != 0 ) + { + NewCursor = XCreateFontCursor( DisplayId, Type ); + } + else + { + ColorMap = DefaultColormapOfScreen ( XtScreen( MainWidget ) ); + + XAllocNamedColor( DisplayId, ColorMap, "black", &Black, &ForgetIt ); + XAllocNamedColor( DisplayId, ColorMap, "white", &White, &ForgetIt ); + + MaskOr = + + XCreatePixmapFromBitmapData( DisplayId, + MainWindow, + XgraCursorMaskOr, + 8, 8, + Black.pixel, + White.pixel, 1 ); + + MaskAnd = + + XCreatePixmapFromBitmapData( DisplayId, + MainWindow, + XgraCursorMaskAnd, + 8, 8, + Black.pixel, + White.pixel, 1 ); + + NewCursor = XCreatePixmapCursor( DisplayId, + MaskAnd, MaskOr, + &Black, &White, 0, 0 ); + } + + XgraMouseCursorArray[ CursorType ].CURSOR = NewCursor; + XgraMouseCursorArray[ CursorType ].MAKE = False; + + Type = NewCursor; + } + + XDefineCursor( DisplayId, MainWindow, Type ); + + XmUpdateDisplay( MainWidget ); + + autend(); +} diff --git a/alliance/src/xgra/src/XTB_cursor.h b/alliance/src/xgra/src/XTB_cursor.h new file mode 100644 index 00000000..bdf727c6 --- /dev/null +++ b/alliance/src/xgra/src/XTB_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 : XGRA | +| | +| File : cursor.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XTB_CURSOR +# define XGRA_XTB_CURSOR + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ + + typedef struct XgraMouseCursor + { + Cursor CURSOR; + Boolean MAKE; + + } XgraMouseCursor; + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XTB_dialog.c b/alliance/src/xgra/src/XTB_dialog.c new file mode 100644 index 00000000..0a62545d --- /dev/null +++ b/alliance/src/xgra/src/XTB_dialog.c @@ -0,0 +1,467 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : dialog.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XTB.h" +# include "XSB.h" +# include "XTB_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static XgraLockLoop = 0; + + static XgraDialogItem XgraWarningDialog = + + { + "Warning", + XGRA_DIALOG_WARNING, + (Widget)NULL, + (void *)NULL, + (XtPointer)NULL, + (void *)NULL, + (XtPointer)NULL + }; + + static XgraDialogItem XgraErrorDialog = + + { + "Error", + XGRA_DIALOG_ERROR, + (Widget)NULL, + (void *)NULL, + (XtPointer)NULL, + (void *)NULL, + (XtPointer)NULL + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraDestroyDialogCallback | +| | +\------------------------------------------------------------*/ + +void XgraDestroyDialogCallback( MyWidget, ClientData, CallData ) + + Widget MyWidget; + caddr_t ClientData; + caddr_t CallData; +{ + XgraLockLoop = 0; + + exit(1); +} + +/*------------------------------------------------------------\ +| | +| XgraExitDialogCallback | +| | +\------------------------------------------------------------*/ + +void XgraExitDialogCallback() + +{ + autbegin(); + + XgraExitDialog(); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraBuildDialog | +| | +\------------------------------------------------------------*/ + +void XgraBuildDialog( Father, Dialog ) + + Widget Father; + XgraDialogItem *Dialog; +{ + Arg Args[3]; + XmString Label; + + autbegin(); + + Label = XmStringCreateLtoR( Dialog->LABEL, + XmSTRING_DEFAULT_CHARSET ); + + if ( Dialog->TYPE < XGRA_DIALOG_FILE ) + { + XtSetArg( Args[0], XmNmessageString , Label); + } + else + { + XtSetArg( Args[0], XmNselectionLabelString, Label); + } + + XtSetArg( Args[1], XmNdeleteResponse, XmDESTROY ); + XtSetArg( Args[2], XmNtitle, " " ); + + switch ( Dialog->TYPE ) + { + case XGRA_DIALOG_MESSAGE : + + Dialog->WIDGET = + + XmCreateMessageDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case XGRA_DIALOG_ERROR : + + Dialog->WIDGET = + + XmCreateErrorDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case XGRA_DIALOG_INFO : + + Dialog->WIDGET = + + XmCreateInformationDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case XGRA_DIALOG_QUESTION : + + Dialog->WIDGET = + + XmCreateQuestionDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case XGRA_DIALOG_WARNING : + + Dialog->WIDGET = + + XmCreateWarningDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case XGRA_DIALOG_WORKING : + + Dialog->WIDGET = + + XmCreateWorkingDialog( Father, Dialog->LABEL, Args, 3); + + break; + + case XGRA_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 XGRA_DIALOG_PROMPT : + + Dialog->WIDGET = + + XmCreatePromptDialog( Father, Dialog->LABEL, Args, 3); + + XtUnmanageChild( XmSelectionBoxGetChild( Dialog->WIDGET, + XmDIALOG_HELP_BUTTON ) ); + } + + XmStringFree( Label ); + + XtAddCallback (Dialog->WIDGET, XmNdestroyCallback, + XgraDestroyDialogCallback, NULL ); + + if ( Dialog->TYPE < XGRA_DIALOG_FILE ) + { + XtUnmanageChild( XmMessageBoxGetChild( Dialog->WIDGET, + XmDIALOG_HELP_BUTTON ) ); + } + + if ( ( Dialog->CALLBACK_OK == NULL ) && + ( Dialog->CALLBACK_CANCEL == NULL ) ) + { + XtAddCallback( Dialog->WIDGET, XmNokCallback, + XgraExitDialogCallback, 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 ); + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraLimitedLoop | +| | +\------------------------------------------------------------*/ + +void XgraLimitedLoop( MyWidget ) + + Widget MyWidget; +{ + Widget DialogShell, WShell; + XEvent Event; + XAnyEvent *AnyEvent; + XtAppContext Context; + + autbegin(); + + Context = XtWidgetToApplicationContext( MyWidget ); + + XgraLockLoop = 1; + + for ( WShell = MyWidget; + ! XtIsShell( WShell ); + WShell = XtParent( WShell ) ); + + while( XgraLockLoop == 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 KeyRelease : + case ButtonRelease : + + if (WShell == DialogShell) XtDispatchEvent(&Event); + + break; + + case KeyPress : + case ButtonPress : + + if (WShell != DialogShell) + { + XBell( AnyEvent->display, 0 ); + XtPopup( WShell, XtGrabNone ); + } + else + { + XtDispatchEvent( &Event ); + } + break; + + default : + + XtDispatchEvent( &Event ); + } + } + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraEnterDialog | +| | +\------------------------------------------------------------*/ + +void XgraEnterDialog( Dialog ) + + XgraDialogItem *Dialog; +{ + autbegin(); + + XtManageChild ( Dialog->WIDGET ); + + XgraLimitedLoop( Dialog->WIDGET ); + + XtUnmanageChild( Dialog->WIDGET ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraReEnterDialog | +| | +\------------------------------------------------------------*/ + +void XgraReEnterDialog() +{ + XgraLockLoop = 1; +} + +/*------------------------------------------------------------\ +| | +| XgraExitDialog | +| | +\------------------------------------------------------------*/ + +void XgraExitDialog() + +{ + XgraLockLoop = 0; +} + +/*------------------------------------------------------------\ +| | +| XgraWarningMessage | +| | +\------------------------------------------------------------*/ + +void XgraWarningMessage( Father, Subject ) + + Widget Father; + char *Subject; +{ + XmString Label; + + autbegin(); + + if ( XgraWarningDialog.WIDGET == (Widget)NULL ) + { + XgraBuildDialog( Father, &XgraWarningDialog ); + } + + Label = XmStringCreateLtoR( Subject, + XmSTRING_DEFAULT_CHARSET ); + + XtVaSetValues( XgraWarningDialog.WIDGET, + XmNmessageString, + Label, NULL ); + + XmStringFree( Label ); + + XgraEnterDialog( &XgraWarningDialog ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraErrorMessage | +| | +\------------------------------------------------------------*/ + +void XgraErrorMessage( Father, Subject ) + + Widget Father; + char *Subject; +{ + XmString Label; + + autbegin(); + + if ( XgraErrorDialog.WIDGET == (Widget)NULL ) + { + XgraBuildDialog( Father, &XgraErrorDialog ); + } + + Label = XmStringCreateLtoR( Subject, + XmSTRING_DEFAULT_CHARSET ); + + XtVaSetValues( XgraErrorDialog.WIDGET, + XmNmessageString, + Label, NULL ); + + XmStringFree( Label ); + + XgraEnterDialog( &XgraErrorDialog ); + + autend(); +} diff --git a/alliance/src/xgra/src/XTB_dialog.h b/alliance/src/xgra/src/XTB_dialog.h new file mode 100644 index 00000000..d4086ab4 --- /dev/null +++ b/alliance/src/xgra/src/XTB_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 : XGRA | +| | +| File : dialog.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XTB_DIALOG +# define XGRA_XTB_DIALOG + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XTB_icon.c b/alliance/src/xgra/src/XTB_icon.c new file mode 100644 index 00000000..31464ce2 --- /dev/null +++ b/alliance/src/xgra/src/XTB_icon.c @@ -0,0 +1,103 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : icon.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include "mut.h" +# include "aut.h" +# include "XTB.h" +# include "XSB.h" +# include "XTB_icon.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraSetIcon | +| | +\------------------------------------------------------------*/ + +void XgraSetIcon( ShellWidget, IconBits, IconWidth, IconHeight ) + + Widget ShellWidget; + char *IconBits; + int IconWidth; + int IconHeight; +{ + Pixmap IconPixmap; + + autbegin(); + + IconPixmap = XCreatePixmapFromBitmapData( XtDisplay( ShellWidget ), + RootWindowOfScreen( XtScreen( ShellWidget ) ), + IconBits, IconWidth, IconHeight, + 0, 1, + DefaultDepthOfScreen( XtScreen( ShellWidget ) ) ); + XtVaSetValues( ShellWidget, + XmNiconPixmap, IconPixmap, + XmNiconic, False, + NULL ); + + autend(); +} + diff --git a/alliance/src/xgra/src/XTB_icon.h b/alliance/src/xgra/src/XTB_icon.h new file mode 100644 index 00000000..09fe7806 --- /dev/null +++ b/alliance/src/xgra/src/XTB_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 : XGRA | +| | +| File : icon.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XTB_ICON +# define XGRA_XTB_ICON + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XTB_menu.c b/alliance/src/xgra/src/XTB_menu.c new file mode 100644 index 00000000..4346def1 --- /dev/null +++ b/alliance/src/xgra/src/XTB_menu.c @@ -0,0 +1,195 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : menu.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XTB.h" +# include "XSB.h" +# include "XTB_menu.h" + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + static char MenuBuffer [ MENU_BUFFER_SIZE ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraBuildMenus | +| | +\------------------------------------------------------------*/ + +void XgraBuildMenus( Father, Menu ) + + Widget Father; + XgraMenuItem *Menu; +{ + + Widget Button; + Widget SubMenu; + XmString Text; + Arg Args[ 2 ]; + int Counter; + + autbegin(); + + 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 ); + + XgraBuildMenus( SubMenu, Menu[ Counter ].NEXT ); + } + else Menu[ Counter ].MENU = (Widget)NULL; + } + + autend(); +} + diff --git a/alliance/src/xgra/src/XTB_menu.h b/alliance/src/xgra/src/XTB_menu.h new file mode 100644 index 00000000..bdc0cb41 --- /dev/null +++ b/alliance/src/xgra/src/XTB_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 : XGRA | +| | +| File : menu.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XTB_MENU +# define XGRA_XTB_MENU + +# define MENU_BUFFER_SIZE 80 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XTB_panel.c b/alliance/src/xgra/src/XTB_panel.c new file mode 100644 index 00000000..3793d1c8 --- /dev/null +++ b/alliance/src/xgra/src/XTB_panel.c @@ -0,0 +1,376 @@ +/*------------------------------------------------------------\ +| | +| 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 : XGRA | +| | +| File : panel.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XTB.h" +# include "XTB_panel.h" +# include "XTB_dialog.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + char *XgraPanelButtonDisable = "xxxx"; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraBuildPanel | +| | +\------------------------------------------------------------*/ + +void XgraBuildPanel( Father, Panel ) + + Widget Father; + XgraPanelItem *Panel; +{ + Arg Args[13]; + XgraPanelButtonItem *Button; + char *Label; + int Counter; + int Fraction; + int X1; + int Y1; + int X2; + int Y2; + Pixmap ButtonPixmap; + + autbegin(); + + Fraction = Panel->ROW * Panel->COLUMN; + + XtSetArg( Args[0], XmNshadowType, XmSHADOW_ETCHED_IN ); + XtSetArg( Args[1], XmNdeleteResponse, XmDESTROY); + XtSetArg( Args[2], XmNtitle , Panel->TITLE ); + + Panel->PANEL = XmCreateFormDialog( Father, Panel->TITLE, Args, 3); + + XtAddCallback( Panel->PANEL, XmNdestroyCallback, + XgraDestroyDialogCallback, 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; + Button[ Counter ].LABEL != NULL; + Counter++ ) + { + 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; + + if ( *Button[ Counter ].LABEL[0] != '\0' ) + { + Label = *Button[ Counter ].LABEL; + } + else + { + Label = XgraPanelButtonDisable; + } + + 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 = XgraCreatePixmap( 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 ( Label != XgraPanelButtonDisable ) + { + 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 ); + } + } + } + else + { + Button[ Counter ].BUTTON = NULL; + } + } + + XtVaSetValues( Panel->PANEL , + XmNresizable , False, + XmNx , Panel->X, + XmNy , Panel->Y, + XmNheight , Panel->HEIGHT, + XmNwidth , Panel->WIDTH, + NULL ); + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraEnterPanel | +| | +\------------------------------------------------------------*/ + +void XgraEnterPanel( Panel ) + + XgraPanelItem *Panel; +{ + autbegin(); + + 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; + + autend(); +} + +/*------------------------------------------------------------\ +| | +| XgraExitPanel | +| | +\------------------------------------------------------------*/ + +void XgraExitPanel( Panel ) + + XgraPanelItem *Panel; +{ + autbegin(); + + XtUnmanageChild( Panel->PANEL ); + + Panel->MANAGED = 0; + + autend(); +} diff --git a/alliance/src/xgra/src/XTB_panel.h b/alliance/src/xgra/src/XTB_panel.h new file mode 100644 index 00000000..b58ae9bd --- /dev/null +++ b/alliance/src/xgra/src/XTB_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 : XGRA | +| | +| File : panel.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XTB_PANEL +# define XGRA_XTB_PANEL + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/XTB_pixmap.c b/alliance/src/xgra/src/XTB_pixmap.c new file mode 100644 index 00000000..84e58c8e --- /dev/null +++ b/alliance/src/xgra/src/XTB_pixmap.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 : XGRA | +| | +| File : Pixmap.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +# include +# include +# include "mut.h" +# include "aut.h" +# include "XTB.h" +# include "XSB.h" + +# include "XTB_pixmap.h" + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraCreatePixmap | +| | +\------------------------------------------------------------*/ + +Pixmap XgraCreatePixmap( MainWidget, IconBits, IconWidth, IconHeight ) + + Widget MainWidget; + char *IconBits; + int IconWidth; + int IconHeight; +{ + Pixel Foreground; + Pixel Background; + Pixmap IconPixmap; + + autbegin(); + + XtVaGetValues( MainWidget, XmNforeground, &Foreground, + XmNbackground, &Background, NULL ); + + IconPixmap = XCreatePixmapFromBitmapData( XtDisplay( MainWidget ), + RootWindowOfScreen( XtScreen( MainWidget ) ), + IconBits, IconWidth, IconHeight, + Foreground, Background, + DefaultDepthOfScreen( XtScreen( MainWidget ) ) ); + + autend(); + return( IconPixmap ); +} + diff --git a/alliance/src/xgra/src/XTB_pixmap.h b/alliance/src/xgra/src/XTB_pixmap.h new file mode 100644 index 00000000..5c0dde0f --- /dev/null +++ b/alliance/src/xgra/src/XTB_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 : XGRA | +| | +| File : pixmap.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XTB_PIXMAP +# define XGRA_XTB_PIXMAP + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/xgra/src/xgra.c b/alliance/src/xgra/src/xgra.c new file mode 100644 index 00000000..c912078d --- /dev/null +++ b/alliance/src/xgra/src/xgra.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. | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Tool : XGRA | +| | +| File : xgra.c | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +# ident "@(#)XGRA ver 1.00 January 1995" + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include + +# include "mut.h" +# include "aut.h" +# include "XSB.h" +# include "XMX.h" + +# include "xgra.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| present | +| | +\------------------------------------------------------------*/ + +void XgraPresent() +{ + alliancebanner( "Xgra", ALLIANCE_VERSION, + "Graphic Graph Viewer", "1996", + ALLIANCE_VERSION ); +} + +/*------------------------------------------------------------\ +| | +| main | +| | +\------------------------------------------------------------*/ + +int main( argc, argv ) + + int argc; + char *argv[]; +{ + char Debug = 0; + int Index; + + XgraPresent(); + + mbkenv(); + autenv(); + + for ( Index = 1; + Index < argc; + Index++ ) + { + if ( ! strcmp( argv[ Index ], "-l" ) ) + { + if ( ( Index + 1 ) < argc ) + { + Index = Index + 1; + XgraFirstFileName = argv[ Index ]; + } + } + else + if ( ! strcmp( argv[ Index ], "-debug" ) ) + { + Debug = 1; + } + } + + if ( Debug ) autdebug(); + + autbegin(); + + Xgragetenv(); + XgraLoadParameters(); + + XgraInitializeRessources( &argc, argv ); + XgraInitializeErrorMessage( Debug ); + + XtAppMainLoop( XgraApplication ); + + autend(); + + return( 0 ); +} diff --git a/alliance/src/xgra/src/xgra.h b/alliance/src/xgra/src/xgra.h new file mode 100644 index 00000000..b89ee275 --- /dev/null +++ b/alliance/src/xgra/src/xgra.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 : XGRA | +| | +| File : xgra.h | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.12.96 | +| | +\------------------------------------------------------------*/ + +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# ifndef XGRA_XGRA +# define XGRA_XGRA + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| XgraInitializeRessources | +| | +\------------------------------------------------------------*/ + +# endif