*** arc.c.orig	Fri Nov 10 13:07:26 2000
--- arc.c	Fri Nov 10 13:07:27 2000
***************
*** 326,330 ****
     if (int_dx==0 && int_dy==0) {
        if ((style & LS_RIGHT) && vs2 != NULL) {
!          if (obj_ptr->ctm != NULL) {
              vs2[0].x = vs2[1].x = vs2[2].x = vs2[3].x = x2;
              vs2[0].y = vs2[1].y = vs2[2].y = vs2[3].y = y2;
--- 326,330 ----
     if (int_dx==0 && int_dy==0) {
        if ((style & LS_RIGHT) && vs2 != NULL) {
!          if (obj_ptr->ctm == NULL) {
              vs2[0].x = vs2[1].x = vs2[2].x = vs2[3].x = x2;
              vs2[0].y = vs2[1].y = vs2[2].y = vs2[3].y = y2;
***************
*** 2270,2273 ****
--- 2270,2279 ----
        MsgBox(gszMsgBox, TOOL_NAME, INFO_MB);
        return;
+    }
+    if (r < 1) {
+       sprintf(gszMsgBox, TgLoadString(STID_CANNOT_CREATE_ARC_WITH_RAD1),
+             TOOL_NAME, r);
+       MsgBox(gszMsgBox, TOOL_NAME, INFO_MB);
+       return;
     }
     switch (dir) {
*** attr.c.orig	Fri Nov 10 13:07:27 2000
--- attr.c	Fri Nov 10 13:07:28 2000
***************
*** 201,209 ****
     /*   and its ObjRec after an attribute was edited.        */
  {
-    char value[MAXSTRING+1], name[MAXSTRING+1];
- 
     if (AttrPtr->nameshown) {
        ParseAttrStr(GetTextPtrFirstStrSeg(TextPtr)->dyn_str.s,
!             name, sizeof(name), value, sizeof(value));
        DynStrSet(&AttrPtr->attr_value, value);
        DynStrSet(&AttrPtr->attr_name, name);
--- 201,213 ----
     /*   and its ObjRec after an attribute was edited.        */
  {
     if (AttrPtr->nameshown) {
+       char *s=GetTextPtrFirstStrSeg(TextPtr)->dyn_str.s;
+       int buf_sz=(strlen(s)<<1)+5;
+       char *name=(char*)malloc(buf_sz), *value=(char*)malloc(buf_sz);
+ 
+       if (name == NULL || value == NULL) FailAllocMessage();
+       *name = *value = '\0';
        ParseAttrStr(GetTextPtrFirstStrSeg(TextPtr)->dyn_str.s,
!             name, buf_sz, value, buf_sz);
        DynStrSet(&AttrPtr->attr_value, value);
        DynStrSet(&AttrPtr->attr_name, name);
***************
*** 210,215 ****
        strcat(name, value);
        DynStrSet(&GetTextPtrFirstStrSeg(TextPtr)->dyn_str, name);
     } else {
!       strcpy(value, GetTextPtrFirstStrSeg(TextPtr)->dyn_str.s);
        DynStrSet(&AttrPtr->attr_value, value);
        DynStrSet(&GetTextPtrFirstStrSeg(TextPtr)->dyn_str, value);
--- 214,222 ----
        strcat(name, value);
        DynStrSet(&GetTextPtrFirstStrSeg(TextPtr)->dyn_str, name);
+       free(name);
+       free(value);
     } else {
!       char *value=GetTextPtrFirstStrSeg(TextPtr)->dyn_str.s;
! 
        DynStrSet(&AttrPtr->attr_value, value);
        DynStrSet(&GetTextPtrFirstStrSeg(TextPtr)->dyn_str, value);
***************
*** 268,274 ****
     StrSegInfo *pStrSeg=NULL;
     MiniLinesInfo *minilines=NULL;
!    char s[MAXSTRING+1];
  
!    sprintf(s, "%s%s", AttrName, AttrValue);
  
     text_obj_ptr = (struct ObjRec *)malloc(sizeof(struct ObjRec));
--- 275,282 ----
     StrSegInfo *pStrSeg=NULL;
     MiniLinesInfo *minilines=NULL;
!    char *buf=(char*)malloc(strlen(AttrName)+strlen(AttrValue)+1);
  
!    if (buf == NULL) FailAllocMessage();
!    sprintf(buf, "%s%s", AttrName, AttrValue);
  
     text_obj_ptr = (struct ObjRec *)malloc(sizeof(struct ObjRec));
***************
*** 294,298 ****
     pStrSeg = GetTextPtrFirstStrSeg(text_ptr);
  
!    DynStrSet(&pStrSeg->dyn_str, s);
  
     pStrSeg->font = curFont;
--- 302,306 ----
     pStrSeg = GetTextPtrFirstStrSeg(text_ptr);
  
!    DynStrSet(&pStrSeg->dyn_str, buf);
  
     pStrSeg->font = curFont;
***************
*** 413,424 ****
     struct ObjRec *ObjPtr, *TextObjPtr;
  {
!    struct AttrRec *attr_ptr;
!    struct TextRec *text_ptr;
!    char name[MAXSTRING+1], value[MAXSTRING+1];
  
-    text_ptr = TextObjPtr->detail.t; 
- 
-    ParseAttrStr(GetTextPtrFirstStrSeg(text_ptr)->dyn_str.s,
-          name, sizeof(name), value, sizeof(value));
     topAttr = ObjPtr->fattr;
     botAttr = ObjPtr->lattr;
--- 421,427 ----
     struct ObjRec *ObjPtr, *TextObjPtr;
  {
!    struct AttrRec *attr_ptr=NULL;
!    struct TextRec *text_ptr=TextObjPtr->detail.t;
  
     topAttr = ObjPtr->fattr;
     botAttr = ObjPtr->lattr;
***************
*** 685,705 ****
     struct AttrRec *AttrPtr;
  {
!    int len1=0, len2=0;
!    char buf[MAXSTRING+1];
!    struct DynStrRec *dest_dyn_str=(&GetTextObjFirstStrSeg(ObjPtr)->dyn_str);
  
!    DynStrCpy(dest_dyn_str, &AttrPtr->attr_name);
! 
!    len1 = AttrPtr->attr_name.sz-1;
!    len2 = AttrPtr->attr_value.sz-1;
!    if (len1+len2 >= MAXSTRING) {
!       sprintf(gszMsgBox, TgLoadString(STID_STRING_LEN_EXCEEDS_AND_TRUNC),
!             MAXSTRING);
!       Msg(gszMsgBox);
!       AttrPtr->attr_value.s[MAXSTRING-len1] = '\0';
!       AttrPtr->attr_value.sz = MAXSTRING-len1+1;
!    }
!    sprintf(buf, "%s%s", dest_dyn_str->s, AttrPtr->attr_value.s);
!    DynStrSet(dest_dyn_str, buf);
  }
  
--- 688,698 ----
     struct AttrRec *AttrPtr;
  {
!    char *buf=(char*)malloc(AttrPtr->attr_name.sz+AttrPtr->attr_value.sz);
  
!    /* one extra char allocated, no big deal */
!    if (buf == NULL) FailAllocMessage();
!    sprintf(buf, "%s%s", AttrPtr->attr_name.s, AttrPtr->attr_value.s);
!    DynStrSet(&GetTextObjFirstStrSeg(ObjPtr)->dyn_str, buf);
!    free(buf);
  }
  
***************
*** 1760,1764 ****
  {
     struct AttrRec *to_attr_ptr, *from_attr_ptr;
-    char msg[MAXSTRING];
     int confirm_status=MB_ID_CANCEL;
  
--- 1753,1756 ----
***************
*** 1783,1786 ****
--- 1775,1780 ----
  
           if (from_attr_ptr->inherited) {
+             char msg[MAXSTRING];
+ 
              /* obsolete attribute? */
              confirm_status = (dropObsIconAttrWhenUpdate) ? MB_ID_YES :
***************
*** 1829,1833 ****
     char *attr_name;
  {
!    char *paren_ptr, msg[MAXSTRING+1];
     struct AttrRec *attr_ptr;
     int ltx, lty, rbx, rby;
--- 1823,1827 ----
     char *attr_name;
  {
!    char *paren_ptr;
     struct AttrRec *attr_ptr;
     int ltx, lty, rbx, rby;
***************
*** 1844,1847 ****
--- 1838,1843 ----
     *paren_ptr = '\0';
     if ((attr_ptr=FindAttrWithName(topSel->obj, attr_name, NULL)) == NULL) {
+       char msg[MAXSTRING+1];
+ 
        sprintf(msg, TgLoadString(STID_CANNOT_FIND_NAMED_ATTR), attr_name);
        MsgBox(msg, TOOL_NAME, INFO_MB);
*** drawing.c.orig	Fri Nov 10 13:07:29 2000
--- drawing.c	Fri Nov 10 13:07:29 2000
***************
*** 123,126 ****
--- 123,128 ----
  int		executingCommands=FALSE;
  int		gnDisableShortcuts=FALSE;
+ int		enableMouseWheel=TRUE;
+ int		btn2PopupMainMenu=FALSE;
  
  static Pixmap	execAnimatePixmap=None;
***************
*** 685,689 ****
     case OBJ_BOX:
     case OBJ_OVAL:
-    case OBJ_TEXT:
     case OBJ_POLYGON:
     case OBJ_ARC:
--- 687,690 ----
***************
*** 695,698 ****
--- 696,707 ----
        break;
  
+    case OBJ_TEXT:
+       if (ObjPtr->detail.t->fill != NONEPAT && colorLayerOn[ObjPtr->color]) {
+          return TRUE;
+       } else {
+          return MiniLinesInVisibleLayer(&ObjPtr->detail.t->minilines);
+       }
+       break;
+ 
     case OBJ_XPM: return TRUE;
  
***************
*** 1918,1925 ****
        case 'w': /*^w*/ SetCurChoice(DRAWTEXT); break;
        case 'x': /*^x*/
!          if (curChoice == DRAWTEXT && textCursorShown) {
!             DelSelText();
           } else {
!             DelAllSelObj();
           }
           break;
--- 1927,1938 ----
        case 'w': /*^w*/ SetCurChoice(DRAWTEXT); break;
        case 'x': /*^x*/
!          if (deleteCmdAsCut) {
!             CutToCutBuffer();
           } else {
!             if (curChoice == DRAWTEXT && textCursorShown) {
!                DelSelText();
!             } else {
!                DelAllSelObj();
!             }
           }
           break;
***************
*** 3352,3355 ****
--- 3365,3378 ----
  
     button_ev = &(input->xbutton);
+    if (enableMouseWheel &&
+          (button_ev->button == Button4 || button_ev->button == Button5)) {
+       if (button_ev->button == Button4) {
+          ScrollUp(button_ev);
+       } else if (button_ev->button == Button5) {
+          ScrollDown(button_ev);
+       }
+       *pn_status = INVALID;
+       return TRUE;
+    }
     if ((button_ev->state & ShiftMask) && (button_ev->state & ControlMask)) {
        int abs_x=ABS_X(button_ev->x);
***************
*** 3376,3381 ****
           MoveEditText(input);
           *pn_status = INVALID;
!       } else {
           *pn_status = MainMenu();
        }
        return TRUE;
--- 3399,3406 ----
           MoveEditText(input);
           *pn_status = INVALID;
!       } else if (btn2PopupMainMenu) {
           *pn_status = MainMenu();
+       } else {
+          *pn_status = INVALID;
        }
        return TRUE;
***************
*** 3401,3406 ****
        if (curChoice == DRAWPOLY && gstWiringInfo.num_ports_to_connect > 0) {
           return HandlePressForPortInDrawWindow(TRUE);
        }
-       *pn_status = MainMenu();
        return TRUE;
     } else if (button_ev->button == Button3) {
--- 3426,3434 ----
        if (curChoice == DRAWPOLY && gstWiringInfo.num_ports_to_connect > 0) {
           return HandlePressForPortInDrawWindow(TRUE);
+       } else if (btn2PopupMainMenu) {
+          *pn_status = MainMenu();
+       } else {
+          *pn_status = INVALID;
        }
        return TRUE;
     } else if (button_ev->button == Button3) {
*** eps.c.orig	Fri Nov 10 13:07:30 2000
--- eps.c	Fri Nov 10 13:07:30 2000
***************
*** 502,506 ****
  
     /* convert TIFF to XBM */
!    MkTempFile(xbm_fname, sizeof(xbm_fname), tmpDir, TOOL_NAME);
     if ((xbm_fp=fopen(xbm_fname, "w")) == NULL) {
        return ErrorInConvertTiffToXbm(fp, NULL, NULL, NULL);
--- 502,506 ----
  
     /* convert TIFF to XBM */
!    MkTempFile(xbm_fname, xbm_sz, tmpDir, TOOL_NAME);
     if ((xbm_fp=fopen(xbm_fname, "w")) == NULL) {
        return ErrorInConvertTiffToXbm(fp, NULL, NULL, NULL);
*** exec.c.orig	Fri Nov 10 13:07:31 2000
--- exec.c	Fri Nov 10 13:07:31 2000
***************
*** 8101,8104 ****
--- 8101,8110 ----
        MsgBox(gszMsgBox, TOOL_NAME, INFO_MB);
        return FALSE;
+    }
+    if (radius < 1) {
+       sprintf(gszMsgBox, TgLoadString(STID_CANNOT_CREATE_ARC_WITH_RAD1),
+             TOOL_NAME, radius);
+       MsgBox(gszMsgBox, TOOL_NAME, INFO_MB);
+       return FALSE;
     }
     MakeQuiescent();
*** font.c.orig	Fri Nov 10 13:07:33 2000
--- font.c	Fri Nov 10 13:07:33 2000
***************
*** 444,448 ****
     char szIniFile[MAXPATHLENGTH];
  
!    sprintf(szIniFile, "%s/fontinfo.ini", tgifDir);
     tgWriteProfileString(pszSection, NULL, NULL, szIniFile);
  
--- 444,448 ----
     char szIniFile[MAXPATHLENGTH];
  
!    sprintf(szIniFile, "%s%cfontinfo.ini", tgifDir, DIR_SEP);
     tgWriteProfileString(pszSection, NULL, NULL, szIniFile);
  
*** menu.c.orig	Fri Nov 10 13:07:35 2000
--- menu.c	Fri Nov 10 13:07:35 2000
***************
*** 101,104 ****
--- 101,106 ----
  int maxScrollableMenuHeight=0;
  
+ int deleteCmdAsCut=0;
+ 
  static int savedZoomScale=0, savedDrawOrigX=0, savedDrawOrigY=0;
  static int savedZoomedIn=FALSE;
***************
*** 3019,3022 ****
--- 3021,3025 ----
  {
     XGCValues values;
+    char *c_ptr=NULL;
  
     values.foreground = myFgPixel;
***************
*** 3042,3045 ****
--- 3045,3054 ----
  
     separatorHeight = (threeDLook ? SEPARATOR_PADDING+2 : SEPARATOR_PADDING+1);
+ 
+    deleteCmdAsCut = FALSE;
+    if (((c_ptr=XGetDefault(mainDisplay,TOOL_NAME,"DeleteCmdAsCut")) == NULL) ||
+          UtilStrICmp(c_ptr,"true") != 0) {
+       deleteCmdAsCut = TRUE;
+    }
  }
  
*** miniline.c.orig	Fri Nov 10 13:07:36 2000
--- miniline.c	Fri Nov 10 13:07:36 2000
***************
*** 5416,5417 ****
--- 5416,5486 ----
  }
  
+ /* ----------------- MiniLinesInVisibleLayer() ----------------- */
+ 
+ static
+ int StrSegInVisibleLayer(pStrSeg)
+    StrSegInfo *pStrSeg;
+ {
+    return colorLayerOn[pStrSeg->color];
+ }
+ 
+ static
+ int StrBlockInVisibleLayer(pStrBlock)
+    StrBlockInfo *pStrBlock;
+ {
+    switch (pStrBlock->type) {
+    case SB_SIMPLE: return StrSegInVisibleLayer(pStrBlock->seg);
+    case SB_CHAR_SPACE: return FALSE;
+ 
+    case SB_SUPSUB_LEFT:
+    case SB_SUPSUB_CENTER:
+    case SB_SUPSUB_RIGHT:
+       if (pStrBlock->type == SB_SUPSUB_CENTER) {
+          if (StrSegInVisibleLayer(pStrBlock->seg)) {
+             return TRUE;
+          }
+       }
+       if (pStrBlock->sup != NULL) {
+          if (MiniLinesInVisibleLayer(pStrBlock->sup)) {
+             return TRUE;
+          }
+       }
+       if (pStrBlock->sub != NULL) {
+          if (MiniLinesInVisibleLayer(pStrBlock->sub)) {
+             return TRUE;
+          }
+       }
+       break;
+    }
+    return FALSE;
+ }
+ 
+ static
+ int MiniLineInVisibleLayer(pMiniLine)
+    MiniLineInfo *pMiniLine;
+ {
+    StrBlockInfo *pStrBlock=NULL;
+ 
+    for (pStrBlock=pMiniLine->first_block; pStrBlock != NULL;
+          pStrBlock=pStrBlock->next) {
+       if (StrBlockInVisibleLayer(pStrBlock)) {
+          return TRUE;
+       }
+    }
+    return FALSE;
+ }
+ 
+ int MiniLinesInVisibleLayer(minilines)
+    MiniLinesInfo *minilines;
+ {
+    MiniLineInfo *pMiniLine=NULL;
+ 
+    for (pMiniLine=minilines->first; pMiniLine != NULL;
+          pMiniLine=pMiniLine->next) {
+       if (MiniLineInVisibleLayer(pMiniLine)) {
+          return TRUE;
+       }
+    }
+    return FALSE;
+ }
+ 
*** msg.c.orig	Fri Nov 10 13:07:38 2000
--- msg.c	Fri Nov 10 13:07:38 2000
***************
*** 127,137 ****
  }
  
! int FailToOpenMessage(file_name, rw, extra_msg)
!    char *file_name, *rw, *extra_msg;
  {
     char msg[MAXPATHLENGTH<<1];
  
     if (extra_msg == NULL) {
!       sprintf(msg, TgLoadString(STID_CANNOT_OPEN_FILE_FOR_READING), file_name);
        if (PRTGIF) {
           fprintf(stderr, "%s\n", msg);
--- 127,145 ----
  }
  
! int FailToOpenMessage(file_name, rwa, extra_msg)
!    char *file_name, *rwa, *extra_msg;
!    /* rwa is either "r", "w", or "a" */
  {
     char msg[MAXPATHLENGTH<<1];
+    int msgid=0;
  
+    switch (*rwa) {
+    case 'r': msgid = STID_CANNOT_OPEN_FILE_FOR_READING; break;
+    case 'w': msgid = STID_CANNOT_OPEN_FILE_FOR_WRITING; break;
+    case 'a': msgid = STID_CANNOT_OPEN_FILE_FOR_APPEND; break;
+    default: msgid = INVALID; break;
+    }
     if (extra_msg == NULL) {
!       sprintf(msg, TgLoadString(msgid), file_name);
        if (PRTGIF) {
           fprintf(stderr, "%s\n", msg);
***************
*** 140,144 ****
        }
     } else {
!       sprintf(msg, TgLoadString(STID_CANNOT_OPEN_FILE_FOR_READING), file_name);
        strcat(msg, "  ");
        strcat(msg, extra_msg);
--- 148,152 ----
        }
     } else {
!       sprintf(msg, TgLoadString(msgid), file_name);
        strcat(msg, "  ");
        strcat(msg, extra_msg);
*** names.c.orig	Fri Nov 10 13:07:38 2000
--- names.c	Fri Nov 10 13:07:39 2000
***************
*** 583,587 ****
     char *pszDomainNames=NULL, *psz_default_path=NULL;
  
!    sprintf(gszDomainIniFile, "%s/domain.ini", tgifDir);
  
     domainInIni = FALSE;
--- 583,587 ----
     char *pszDomainNames=NULL, *psz_default_path=NULL;
  
!    sprintf(gszDomainIniFile, "%s%cdomain.ini", tgifDir, DIR_SEP);
  
     domainInIni = FALSE;
*** navigate.c.orig	Fri Nov 10 13:07:39 2000
--- navigate.c	Fri Nov 10 13:07:39 2000
***************
*** 490,494 ****
           hotListFileName = (char*)malloc((len+1)*sizeof(char));
           if (hotListFileName == NULL) FailAllocMessage();
!          sprintf(hotListFileName, "%s/.%s_hotlist", homeDir, TOOL_NAME);
        }
     }
--- 490,495 ----
           hotListFileName = (char*)malloc((len+1)*sizeof(char));
           if (hotListFileName == NULL) FailAllocMessage();
!          sprintf(hotListFileName, "%s%c.%s_hotlist", homeDir, DIR_SEP,
!                TOOL_NAME);
        }
     }
*** obj.c.orig	Fri Nov 10 13:07:40 2000
--- obj.c	Fri Nov 10 13:07:40 2000
***************
*** 839,842 ****
--- 839,846 ----
        AdjCaches();
        AdjSplineVs();
+       curPage->draw_orig_x = drawOrigX;
+       curPage->draw_orig_y = drawOrigY;
+       curPage->zoom_scale = zoomScale;
+       curPage->zoomed_in = zoomedIn;
     }
     topObj = saved_top_obj;
*** remote.c.orig	Fri Nov 10 13:07:41 2000
--- remote.c	Fri Nov 10 13:07:41 2000
***************
*** 1400,1404 ****
        strcpy(fname, c_ptr);
     } else {
!       sprintf(fname, "%s/.mime.types", homeDir);
     }
     if ((fp=fopen(fname, "r")) == NULL) return;
--- 1400,1404 ----
        strcpy(fname, c_ptr);
     } else {
!       sprintf(fname, "%s%c.mime.types", homeDir, DIR_SEP);
     }
     if ((fp=fopen(fname, "r")) == NULL) return;
***************
*** 1443,1447 ****
        spec = UtilStrDup(c_ptr);
     } else {
!       sprintf(gszMsgBox, "%s/.mailcap", homeDir);
        spec = UtilStrDup(gszMsgBox);
     }
--- 1443,1447 ----
        spec = UtilStrDup(c_ptr);
     } else {
!       sprintf(gszMsgBox, "%s%c.mailcap", homeDir, DIR_SEP);
        spec = UtilStrDup(gszMsgBox);
     }
*** setup.c.orig	Fri Nov 10 13:07:42 2000
--- setup.c	Fri Nov 10 13:07:42 2000
***************
*** 1429,1433 ****
        strcpy(homeDir, c_ptr);
     }
!    sprintf(tgifDir, "%s/.%s", homeDir, TOOL_NAME);
     memset(&stat_buf, 0, sizeof(struct stat));
     if (stat(tgifDir, &stat_buf) != 0) {
--- 1429,1433 ----
        strcpy(homeDir, c_ptr);
     }
!    sprintf(tgifDir, "%s%c.%s", homeDir, DIR_SEP, TOOL_NAME);
     memset(&stat_buf, 0, sizeof(struct stat));
     if (stat(tgifDir, &stat_buf) != 0) {
***************
*** 1484,1487 ****
--- 1484,1497 ----
  #endif /* ~_TMP_DIR_IN_HOME_DIR */
     }
+    enableMouseWheel = TRUE;
+    if (threeDLook && (c_ptr=XGetDefault(mainDisplay, TOOL_NAME,
+          "EnableMouseWheel")) != NULL && UtilStrICmp(c_ptr, "false") == 0) {
+       enableMouseWheel = FALSE;
+    }
+    btn2PopupMainMenu = TRUE;
+    if (threeDLook && (c_ptr=XGetDefault(mainDisplay, TOOL_NAME,
+          "Btn2PopupMainMenu")) != NULL && UtilStrICmp(c_ptr, "false") == 0) {
+       btn2PopupMainMenu = FALSE;
+    }
     InitFonts();
  
*** stretch.c.orig	Fri Nov 10 13:07:43 2000
--- stretch.c	Fri Nov 10 13:07:43 2000
***************
*** 2365,2368 ****
--- 2365,2369 ----
        PrepareToRecord(CMD_GOTO_PAGE, NULL, NULL, prev_page_num);
        GotoPageNum(curPageNum);
+       RedrawPageWindow();
        RecordCmd(CMD_GOTO_PAGE, NULL, NULL, NULL, curPageNum);
        prev_page_num = curPageNum;
***************
*** 2390,2393 ****
--- 2391,2395 ----
     PrepareToRecord(CMD_GOTO_PAGE, NULL, NULL, prev_page_num);
     GotoPageNum(saved_cur_page_num);
+    RedrawPageWindow();
     RecordCmd(CMD_GOTO_PAGE, NULL, NULL, NULL, saved_cur_page_num);
  
*** strtbl.c.orig	Fri Nov 10 13:07:44 2000
--- strtbl.c	Fri Nov 10 13:07:45 2000
***************
*** 307,311 ****
     /* CSTID_BAD_RCBOX_BBOX_ADJUSTED */
     N_("Bad rcbox bounding box.  Adjusted."),
!    /* CSTID_SEC_ELAPSED_AVG_SPEED */
     N_("(%1d sec elapsed, avg %.2fKB/sec)"),
     /* CSTID_UNZIPPING_WITH_CMD_DOTS */
--- 307,311 ----
     /* CSTID_BAD_RCBOX_BBOX_ADJUSTED */
     N_("Bad rcbox bounding box.  Adjusted."),
!    /* CSTID_PARANED_SEC_ELAPSED_AVG_SPEED */
     N_("(%1d sec elapsed, avg %.2fKB/sec)"),
     /* CSTID_UNZIPPING_WITH_CMD_DOTS */
***************
*** 3212,3215 ****
--- 3212,3217 ----
     /* STID_TRY_AGAIN_AND_END_IN_A_PORT */
     N_("The last vertex did not end in a port, please try again."),
+    /* STID_CANNOT_CREATE_ARC_WITH_RAD1 */
+    N_("%s cannot create an arc with radius %1d (must be at least 1)."),
     NULL
  };
*** tangram2.c.orig	Fri Nov 10 13:07:46 2000
--- tangram2.c	Fri Nov 10 13:07:46 2000
***************
*** 228,232 ****
  /* --------------- Tangram2 Internal Commands Implementation --------------- */
  
! #define MAXVARS              20
  #define MAXVARNAME          250
  #define MAXCONNECTTRIES       3
--- 228,232 ----
  /* --------------- Tangram2 Internal Commands Implementation --------------- */
  
! #define MAXVARS             200
  #define MAXVARNAME          250
  #define MAXCONNECTTRIES       3
***************
*** 295,299 ****
          if( (sin.sin_port = htons( (u_short)atoi( service ) )) == 0 )
          {
!             fprintf( stderr, "TGIF: Can't get \"%s\" service entry\n", service );
              return;
          }
--- 295,299 ----
          if( (sin.sin_port = htons( (u_short)atoi( service ) )) == 0 )
          {
!             fprintf( stderr,"TGIF: Can't get \"%s\" service entry\n", service );
              return;
          }
***************
*** 329,333 ****
      }
      
!     if( setsockopt( s, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof( one ) ) < 0 )
      {
          perror( "TGIF: REUSEADDR" );
--- 329,334 ----
      }
      
!     if( setsockopt( s, SOL_SOCKET, SO_REUSEADDR, (char *)&one,
!         sizeof( one ) ) < 0 )
      {
          perror( "TGIF: REUSEADDR" );
***************
*** 350,354 ****
      FD_SET( s, &soc_pool );
      max_desc = s + 1;
!     timeout.tv_sec  = 20;
      timeout.tv_usec = 0;
      if( select( max_desc, &soc_pool, NULL, NULL, &timeout ) < 0 )
--- 351,355 ----
      FD_SET( s, &soc_pool );
      max_desc = s + 1;
!     timeout.tv_sec  = 10;
      timeout.tv_usec = 0;
      if( select( max_desc, &soc_pool, NULL, NULL, &timeout ) < 0 )
***************
*** 360,364 ****
      {
          sin_size = sizeof( sin );
!         if( recvfrom( s, buffer, sizeof( T_Packet ), 0, (struct sockaddr *)&sin, &sin_size ) < 0 )
          {
              perror( "TGIF: recv" );
--- 361,366 ----
      {
          sin_size = sizeof( sin );
!         if( recvfrom( s, buffer, sizeof( T_Packet ), 0, (struct sockaddr *)&sin,
!                       &sin_size ) < 0 )
          {
              perror( "TGIF: recv" );
***************
*** 388,392 ****
      simulator_socket = s;
      
!     printf("TGIF: Cliente Conectado.\n");
  }
  
--- 390,394 ----
      simulator_socket = s;
      
!     printf("TGIF: Client Connected.\n");
  }
  
***************
*** 417,438 ****
  }
  
! static
! void monta_buffer(char *buffer, T_Packet pack)
  {
!    int i;
!    char temp[MAXSTRING+1];
  
!    memset(buffer, 0, sizeof(buffer));
!    for (i=0; i < pack.varcount; i++) {
!       strcat(buffer, pack.vars[i].name);
!       sprintf(temp, "=%d@", pack.vars[i].value);
!       strcat(buffer, temp);
!    }
  
!    /* printf("monta: %s\n", buffer); */
  }
  
! static
! int recv_packet(int soc, T_Packet *pack_in)
  {
     int  byread, status;   /* bytes read from the socket */
--- 419,491 ----
  }
  
! static int isVector( char *varname )
  {
!     char *pt = varname;
!     while( (*pt != '[') && (*pt != '\0'))
!         pt++;
  
!     return( *pt == '[' ? pt - varname : 0 );
! }
  
! /******************************************************************************/
! /* This function extracts the state var names and values from the packet that */
! /* came from markfind and fullfill the buffer attribute of simulation step    */
! /* button.                                                                    */
! /******************************************************************************/
! static void monta_buffer(char *buffer, T_Packet pack)
! {
!     int i, pos;
!     int initial_index, final_index;
!     int temp_index;
!     char temp[MAXSTRING+1];
!     char value[MAXSTRING+1];
!     char basename[MAXSTRING+1];
! 
!     buffer[0] = 0;
!     for (i=0; i < pack.varcount; i++)
!     {
!         if( ( pos = isVector( pack.vars[i].name ) ) > 0 )
!         {
!             final_index = -1;
!             strncpy( basename, pack.vars[i].name, pos );
!             basename[ pos ] = 0;
!             initial_index = atoi( &pack.vars[i].name[ pos + 1 ] );
! 
!             sprintf( value, "%d", pack.vars[i].value );
! 
!             i++;
!             while( (strncmp( basename, pack.vars[i].name, pos ) == 0) && 
!                    (pack.vars[i].name[pos] == '[') && (i < pack.varcount) )
!             {
!                 temp_index = atoi( &pack.vars[i].name[ pos + 1 ] );
!                 if( (final_index == -1 && temp_index == initial_index + 1)
!                     || temp_index == final_index + 1 )
!                 {
!                     final_index = temp_index;
!                     sprintf( temp, ",%d", pack.vars[i].value );
!                     strcat( value, temp );
!                     i++;
!                 }
!                 else
!                     break;
!             }
!             i--;
!             if( final_index != -1 )
!                 sprintf( temp, "%s[%d:%d]=[%s]@", basename, initial_index,
!                          final_index, value);
!             else
!                 sprintf( temp, "%s[%d]=%s@", basename, initial_index, value);
!             strcat( buffer, temp );
!         }
!         else
!         {
!             strcat( buffer, pack.vars[i].name );
!             sprintf( temp, "=%d@", pack.vars[i].value );
!             strcat( buffer, temp );
!         }
!     }
  }
  
! static int recv_packet(int soc, T_Packet *pack_in)
  {
     int  byread, status;   /* bytes read from the socket */
***************
*** 463,468 ****
  }
  
! static
! int send_packet(int soc, T_Packet pack_out)
  {
     int  bywrite, status;
--- 516,520 ----
  }
  
! static int send_packet(int soc, T_Packet pack_out)
  {
     int  bywrite, status;
***************
*** 490,514 ****
  }
  
! 
! static
! void desmonta_buffer(char *buffer, T_Packet *pack)
  {
     int i;
     char *token;
  
-    /* printf("desmonta: %s\n", buffer); */
- 
     i = 0;
!    token = strtok(buffer, "=");
!    strcpy(pack->vars[i].name, token);
     while (token != NULL) {
!       token = strtok(NULL, "@");
!       pack->vars[i].value = atoi(token);
!       i++;
!       token = strtok(NULL, "=");
!       if (token == NULL) {
!          break;
!       }
!       strcpy(pack->vars[i].name, token);
     }
  
--- 542,573 ----
  }
  
! /******************************************************************************/
! /* This function extracts the state var names and values from buffer which    */
! /* came from simulation step button and builds a packet that goes to markfind */
! /******************************************************************************/
! static void desmonta_buffer(char *buffer, T_Packet *pack)
  {
     int i;
     char *token;
+    char *pt;
  
     i = 0;
!    token = strtok(buffer, "@");
     while (token != NULL) {
!         pt = token;
!         while( (*pt != '=') && (*pt != '\0') )
!             pt++;
!         *pt = '\0';
! 
!         strcpy( pack->vars[i].name, token );
!         /* FIXME - if necessary feedback markfind with the state vars values */
!         /* this is the right place to get them */
!         pack->vars[i].value = 0;
! 
!         i++;
!         if( i >= MAXVARS )
!             break;
! 
!         token = strtok(NULL, "@");
     }
  
***************
*** 540,543 ****
--- 599,603 ----
        return;
     }
+    
     /* pega o valor do atributo buffer */
     strcpy(execDummyStr, "buffer=");
***************
*** 558,561 ****
--- 618,622 ----
        step = 1;
     }
+ 
     /* monta o pacote */
     memset((char *)&pack_out, 0, sizeof(T_Packet));
***************
*** 562,565 ****
--- 623,628 ----
     pack_out.code = STEP_SIMULATION;
     pack_out.step = step;
+ 
+ 
     desmonta_buffer(buffer, &pack_out);
  
***************
*** 783,791 ****
    NULL
  };
! 
! 
  static char *StartSimulatorSetModeB[] = {
!   "strcpy(command, \"simulate_chain $(__GENERATE_CHAIN__.basename) B $(__GENERATE_CHAIN__.dbglevel) $(Event) $(Transitions) $(Time) $(Runs) >> $(__GENERATE_CHAIN__.output) & \");",
!   "launch(command);",
    NULL
  };
--- 846,853 ----
    NULL
  };
! /* ----------------------------------------------------------------------- */
  static char *StartSimulatorSetModeB[] = {
! /*  "strcpy(command, \"simulate_chain $(__GENERATE_CHAIN__.basename) B $(__GENERATE_CHAIN__.dbglevel) $(Event) $(Transitions) $(Time) $(Runs) >> $(__GENERATE_CHAIN__.output) & \");", */
! /*  "launch(command);", */
    NULL
  };
***************
*** 794,799 ****
   "strcpy(Transitions, \"0\");",
   "strcpy(Time, \"0.0\");",
!  "strcpy(command, \"simulate_chain $(__GENERATE_CHAIN__.basename) I $(__GENERATE_CHAIN__.dbglevel) >> $(__GENERATE_CHAIN__.output) & \");",
!  "launch(command);",
   "start_simulator();",
    NULL
--- 856,861 ----
   "strcpy(Transitions, \"0\");",
   "strcpy(Time, \"0.0\");",
! /* "strcpy(command, \"simulate_chain $(__GENERATE_CHAIN__.basename) I $(__GENERATE_CHAIN__.dbglevel) >> $(__GENERATE_CHAIN__.output) & \");", */
! /* "launch(command);", */
   "start_simulator();",
    NULL
***************
*** 822,835 ****
   NULL
  };
! 
! static char *SimulationStepWriteVarLine[] = {
!  "tokenize(state_var_tok,$(state_var_line),'=');",
!  "get_line_in_attr(state_var_name,state_var_tok,1);",
!  "get_line_in_attr(state_var_value,state_var_tok,2);",
!  "strcpy(new_line, \"$(cur_obj).$(state_var_name)=$(state_var_value)\");",
!  "strcpy(buffer,\"$(buffer)$(new_line)@\");",
!   NULL
! };
! 
  static char *SimulationStepLoopAnimation[] = {
   "for_i(Ani_C_Step,1,$(Ani_T_Steps),1,Do_Animation);",
--- 884,888 ----
   NULL
  };
! /* ----------------------------------------------------------------------- */
  static char *SimulationStepLoopAnimation[] = {
   "for_i(Ani_C_Step,1,$(Ani_T_Steps),1,Do_Animation);",
***************
*** 839,848 ****
  };
  
- static char *SimulationStepAnimateObj[] = {
-  "get_line_in_attr(cur_obj,obj_list,$(obj_index));",
-  "exec(\"$(cur_obj).Animation\");",
-   NULL
- };
- 
  static char *SimulationStepDoAnimation[] = {
   "find_obj_names(obj_list,\"\",\"Animation=*\");",
--- 892,895 ----
***************
*** 852,855 ****
--- 899,909 ----
  };
  
+ static char *SimulationStepAnimateObj[] = {
+  "get_line_in_attr(cur_obj,obj_list,$(obj_index));",
+  "exec(\"$(cur_obj).Animation\");",
+   NULL
+ };
+ 
+ 
  static char *SimulationStepCallSimulator[] = {
    "simulate_step();",
***************
*** 865,880 ****
  };
  
! static char *SimulationStepUpdateObjects[] = {
!  "tokenize(state_var_list,$(buffer),'@');",
!  "get_line_in_attr(no_state_vars,state_var_list,0);",
!  "for_i(var_index,1,\"$(no_state_vars)-1\",1,update_vars);",
    NULL
  };
  
! static char *SimulationStepStop[] = {
!   "stop();",
    NULL
  };
  
  static char *SimulationStepStepSimulation[] = {
   "strcpy(buffer,\"\");",
--- 919,945 ----
  };
  
! static char *SimulationStepStop[] = {
!   "stop();",
    NULL
  };
  
! static char *SimulationStepExec[] = {
!  "disable_undo();",
!  /*"show_attr(Step);",
!  "show_attr(Delay);",
!  "show_attr(Animation);",
!  "show_attr(Time_Scale);",*/
!  "if(\"$(Step)\"==\"0\",play_simulation,step_simulation);",
!  "enable_undo();",
!  "redraw_drawing_area();",
    NULL
  };
  
+ 
+ static char *SimulationStepPlaySimulation[] = {
+   "while(1,play_one_step);",
+   NULL
+ };
+ 
  static char *SimulationStepStepSimulation[] = {
   "strcpy(buffer,\"\");",
***************
*** 881,885 ****
--- 946,952 ----
   "find_obj_names(obj_list,\"\",\"State_vars=*\");",
   "get_line_in_attr(no_objs,obj_list,0);",
+ 
   "for_i(obj_index,1,$(no_objs),1,parse_obj);",
+ /* aqui furou */
   "exec(call_simulator);",
   "exec(update_objects);",
***************
*** 889,909 ****
  };
  
- static char *SimulationStepPlaySimulation[] = {
-   "while(1,play_one_step);",
-   NULL
- };
- 
- static char *SimulationStepUpdateVars[] = {
-  "get_line_in_attr(state_var_str,state_var_list,$(var_index));",
-  "tokenize(state_var_tok,$(state_var_str),'.');",
-  "get_line_in_attr(obj_name,state_var_tok,1);",
-  "get_line_in_attr(state_var_str,state_var_tok,2);",
-  "tokenize(state_var_tok,$(state_var_str),'=');",
-  "get_line_in_attr(state_var_name,state_var_tok,1);",
-  "get_line_in_attr(state_var_value,state_var_tok,2);",
-  "append_line_into_attr($(obj_name).State_vars,\" $(state_var_name)=$(state_var_value)\");",
-   NULL
- };
- 
  static char *SimulationStepParseObj[] = {
   "get_line_in_attr(cur_obj,obj_list,$(obj_index));",
--- 956,959 ----
***************
*** 910,913 ****
--- 960,964 ----
   "get_number_of_lines_in_attr(no_state_vars,$(cur_obj).State_vars);",
   "for_i(var_index,1,$(no_state_vars)-1,1,write_vars);",
+ /* "for_i(var_index,1,2,1,write_vars);", */
   "clear_attr($(cur_obj).State_vars);",
    NULL
***************
*** 914,938 ****
  };
  
- static char *SimulationStepExec[] = {
-  "disable_undo();",
-  "show_attr(Step);",
-  "show_attr(Delay);",
-  "show_attr(Animation);",
-  "show_attr(Time_Scale);",
-  "if(\"$(Step)\"==\"0\",play_simulation,step_simulation);",
-  "enable_undo();",
-  "redraw_drawing_area();",
-   NULL
- };
- 
  static char *SimulationStepWriteVars[] = {
   "get_line_in_attr(state_var_line,$(cur_obj).State_vars,$(var_index));",
   "trim(state_var_line);",
   "strlen(line_size, $(state_var_line));",
!  "if(\"$(line_size)\">=\"3\",write_var_line,NULL);",
    NULL
  };
  
  
  static
  void AppendLinesToAttr(attr_ptr, ppsz_lines)
--- 965,1018 ----
  };
  
  static char *SimulationStepWriteVars[] = {
+   /* FIXME this part must be used to feedback (state vars) to markfind */
   "get_line_in_attr(state_var_line,$(cur_obj).State_vars,$(var_index));",
   "trim(state_var_line);",
   "strlen(line_size, $(state_var_line));",
!  "if($(line_size)>=1,write_var_line,NULL);",
! /* "if(1==1,write_var_line,NULL);", */
    NULL
  };
  
+ static char *SimulationStepWriteVarLine[] = {
+  /* wipes out the spaces inside the lines eg: S = 3 -> S=3 */
+  "tokenize(state_var_tok,$(state_var_line),'=');",
+  "get_line_in_attr(state_var_name,state_var_tok,1);",
+  "get_line_in_attr(state_var_value,state_var_tok,2);",
+  "strcpy(new_line, \"$(cur_obj).$(state_var_name)=$(state_var_value)\");",
+  /* append state var assignment (without spaces) in buffer attribute */
+  "strcpy(buffer,\"$(buffer)$(new_line)@\");",
+ /* "strcpy(buffer,\"<obj.state_var>=<value>@\");", */
+   NULL
+ };
  
+ static char *SimulationStepUpdateObjects[] = {
+  "tokenize(state_var_list,$(buffer),'@');",
+  "get_line_in_attr(no_state_vars,state_var_list,0);",
+  "for_i(var_index,1,\"$(no_state_vars)-1\",1,update_vars);",
+   NULL
+ };
+ 
+ static char *SimulationStepUpdateVars[] = {
+  "get_line_in_attr(state_var_str,state_var_list,$(var_index));",
+  "tokenize(state_var_tok,$(state_var_str),'.');",
+  "get_line_in_attr(obj_name,state_var_tok,1);",
+  "get_line_in_attr(state_var_str,state_var_tok,2);",
+  "tokenize(state_var_tok,$(state_var_str),'=');",
+  "get_line_in_attr(state_var_name,state_var_tok,1);",
+  "get_line_in_attr(state_var_value,state_var_tok,2);",
+  /* sets the color, font and size of the State_vars attribute */
+  "select_obj_by_name($(obj_name));",
+ /* "set_selected_obj_pen(0000ff);", */
+ /* "set_selected_text_size(14);", */
+ /* "set_selected_text_font(\"Courier\");", */
+ /*"set_color(\"black\");", */
+  "append_line_into_attr($(obj_name).State_vars,\" $(state_var_name)=$(state_var_value)\");",
+  "show_attr($(obj_name).State_vars);",
+   NULL
+ };
+ 
+ /* ----------------------------------------------------------------------- */
+ 
  static
  void AppendLinesToAttr(attr_ptr, ppsz_lines)
*** xbitmap.c.orig	Fri Nov 10 13:07:47 2000
--- xbitmap.c	Fri Nov 10 13:07:47 2000
***************
*** 2906,2909 ****
--- 2906,2948 ----
  }
  
+ static
+ XImage *RotateImageForLandscape(src_image, p_w, p_h, p_left, p_top, p_right,
+       p_bottom)
+    XImage *src_image;
+    int *p_w, *p_h, *p_left, *p_top, *p_right, *p_bottom;
+ {
+    int x=0, y=0;
+    int new_w=(*p_h), new_h=(*p_w), new_left=(*p_top), new_top=(*p_right);
+    int new_right=(*p_bottom), new_bottom=(*p_left);
+    Pixmap dest_pixmap=None;
+    XImage *dest_image=NULL;
+ 
+    dest_pixmap = XCreatePixmap(mainDisplay, mainWindow, new_w, new_h,
+          mainDepth);
+    dest_image = (dest_pixmap==None ? NULL : XGetImage(mainDisplay, dest_pixmap,
+          0, 0, new_w, new_h, AllPlanes, ZPixmap));
+    if (dest_pixmap == None || dest_image == NULL) {
+       FailAllocPixmapMessage(new_w, new_h);
+       if (dest_pixmap != None) XFreePixmap(mainDisplay, dest_pixmap);
+       if (dest_image != NULL) XDestroyImage(dest_image);
+       return NULL;
+    }
+    for (y=0; y < new_w; y++) {
+       for (x=0; x < new_h; x++) {
+          XPutPixel(dest_image, y, (new_h-1)-x, XGetPixel(src_image, x, y));
+       }
+    }
+    *p_w = new_w;
+    *p_h = new_h;
+    *p_left = new_left;
+    *p_top = new_top;
+    *p_right = new_right;
+    *p_bottom = new_bottom;
+ 
+    XFreePixmap(mainDisplay, dest_pixmap);
+ 
+    return dest_image;
+ }
+ 
  #define FS_SCALE 0x400
  #define HALF_FS_SCALE 0x200
***************
*** 2913,2920 ****
  {  /* called when printing in the xbm or xpm format */
     int j, k, bit_count, index, data=0;
!    int i, ltx, lty, w, h, byte_count, short_name, pixel;
     int left, top, right, bottom, target_percent;
     int bg_pixel=GetDrawingBgPixel(INVALID, INVALID);
!    char xbm_file_name[MAXPATHLENGTH<<1], *rest, name[MAXPATHLENGTH+1];
     FILE *fp=NULL;
     Pixmap pixmap=None;
--- 2952,2959 ----
  {  /* called when printing in the xbm or xpm format */
     int j, k, bit_count, index, data=0;
!    int i, ltx, lty, w, h, byte_count, short_name=FALSE, pixel;
     int left, top, right, bottom, target_percent;
     int bg_pixel=GetDrawingBgPixel(INVALID, INVALID);
!    char xbm_file_name[MAXPATHLENGTH<<1], *rest=NULL, name[MAXPATHLENGTH+1];
     FILE *fp=NULL;
     Pixmap pixmap=None;
***************
*** 3023,3026 ****
--- 3062,3088 ----
        Msg(gszMsgBox);
     }
+    if (whereToPrint == EPSI_FILE && generateTiffEPSI &&
+          pageStyle == LANDSCAPE) {
+       /* for landscape mode TiffEPSI, we need to rotate the image */
+       XImage *rotated_image=RotateImageForLandscape(image, &w, &h, &left, &top,
+             &right, &bottom);
+ 
+       if (rotated_image == NULL) {
+          MsgBox(TgLoadString(STID_XGETIMAGE_MAY_RUN_OUT_VMEM), TOOL_NAME,
+                INFO_MB);
+          if (!(PRTGIF && cmdLineStdOut &&
+                !(whereToPrint == EPSI_FILE && generateTiffEPSI) &&
+                !preDumpSetup)) {
+             fclose(fp);
+             unlink(xbm_file_name);
+          }
+          if (bitmap_image != NULL) XDestroyImage(bitmap_image);
+          XDestroyImage(image);
+          XFreePixmap(mainDisplay, pixmap);
+          return;
+       }
+       XDestroyImage(image);
+       image = rotated_image;
+    }
     writeFileFailed = FALSE;
     if (colorDump && nInImageProc && gnConvolving) {
*** drawing.e.orig	Fri Nov 10 13:07:48 2000
--- drawing.e	Fri Nov 10 13:07:48 2000
***************
*** 52,55 ****
--- 52,57 ----
  extern int	executingCommands;
  extern int	gnDisableShortcuts; /* used by ExecCmdsFromFile() */
+ extern int	enableMouseWheel;
+ extern int	btn2PopupMainMenu;
  
  #ifdef _INCLUDE_FROM_DRAWING_C_
*** menu.e.orig	Fri Nov 10 13:07:49 2000
--- menu.e	Fri Nov 10 13:07:49 2000
***************
*** 48,51 ****
--- 48,53 ----
  extern int	maxScrollableMenuHeight;
  
+ extern int	deleteCmdAsCut;
+ 
  #ifdef _INCLUDE_FROM_MENU_C_
  #undef extern
*** miniline.e.orig	Fri Nov 10 13:07:49 2000
--- miniline.e	Fri Nov 10 13:07:49 2000
***************
*** 264,267 ****
--- 264,268 ----
  extern char	*ConvertAttrNameFirstMiniLineToString ARGS_DECL((
  				struct AttrRec *, int *pnNeedToFree));
+ extern int	MiniLinesInVisibleLayer ARGS_DECL((MiniLinesInfo*));
  
  #ifdef _INCLUDE_FROM_MINILINE_C_
*** msg.e.orig	Fri Nov 10 13:07:50 2000
--- msg.e	Fri Nov 10 13:07:50 2000
***************
*** 51,55 ****
  extern int	FailAllocPixmapMessage ARGS_DECL((int W, int H));
  extern int	FailToWriteFileMessage ARGS_DECL((char *file_name));
! extern int	FailToOpenMessage ARGS_DECL((char *file_name, char *rw,
  		                             char *extra_msg));
  extern int	FailToCreateWindowMessage ARGS_DECL((char *where,
--- 51,55 ----
  extern int	FailAllocPixmapMessage ARGS_DECL((int W, int H));
  extern int	FailToWriteFileMessage ARGS_DECL((char *file_name));
! extern int	FailToOpenMessage ARGS_DECL((char *file_name, char *rwa,
  		                             char *extra_msg));
  extern int	FailToCreateWindowMessage ARGS_DECL((char *where,
*** strtbl.e.orig	Fri Nov 10 13:07:51 2000
--- strtbl.e	Fri Nov 10 13:07:51 2000
***************
*** 1595,1600 ****
  #define STID_TRY_AGAIN_AND_CLICK_IN_A_PORT 2307
  #define STID_TRY_AGAIN_AND_END_IN_A_PORT   2308
  
! #define MAXNONCACHEDSTIDS 2309
  
  extern struct MouseStatusStrRec	colorMouseStatus[];
--- 1595,1601 ----
  #define STID_TRY_AGAIN_AND_CLICK_IN_A_PORT 2307
  #define STID_TRY_AGAIN_AND_END_IN_A_PORT   2308
+ #define STID_CANNOT_CREATE_ARC_WITH_RAD1   2309
  
! #define MAXNONCACHEDSTIDS 2310
  
  extern struct MouseStatusStrRec	colorMouseStatus[];
*** patchlvl.h.orig	Fri Nov 10 13:07:52 2000
--- patchlvl.h	Fri Nov 10 13:07:52 2000
***************
*** 35,39 ****
  #define _TGIF_PATCHLEVEL_H_
  
! #define TGIF_PATCHLEVEL 39
  
  #endif /*_TGIF_PATCHLEVEL_H_*/
--- 35,39 ----
  #define _TGIF_PATCHLEVEL_H_
  
! #define TGIF_PATCHLEVEL 40
  
  #endif /*_TGIF_PATCHLEVEL_H_*/
*** Imakefile.orig	Fri Nov 10 13:07:52 2000
--- Imakefile	Fri Nov 10 13:07:52 2000
***************
*** 54,58 ****
                    $(MOREDEFINES)
  
! TGIFVERSION	= 4.1.39
  
  XCOMM Things to try to add to the DEFINES line above:
--- 54,58 ----
                    $(MOREDEFINES)
  
! TGIFVERSION	= 4.1.40
  
  XCOMM Things to try to add to the DEFINES line above:
*** tgif.man.orig	Fri Nov 10 13:07:53 2000
--- tgif.man	Fri Nov 10 13:07:54 2000
***************
*** 9,13 ****
  .\"
  .\"
! .TH tgif n "Version 4.1 Patchlevel 39 and Above" "Tgif"
  .\"
  .SH NAME
--- 9,13 ----
  .\"
  .\"
! .TH tgif n "Version 4.1 Patchlevel 40 and Above" "Tgif"
  .\"
  .SH NAME
***************
*** 4922,4925 ****
--- 4922,4939 ----
  can handle landscape PostScript files correctly.
  The default is true.
+ .TP
+ .I Tgif.DeleteCmdAsCut: [true,false]
+ If set to ``true'', when Delete is selected from the Edit Menu or
+ if <Cntrl>x is pressed, Cut will be executed instead of Delete.
+ Pressing the <DEL> key on the keyboard will still perform a regular Delete.
+ The default is false.
+ .I Tgif.EnableMouseWheel: [true,false]
+ If set to ``false'', Button4 and Button5 mouse wheel scrolling events will
+ be ignored.
+ The default is true.
+ .I Tgif.Btn2PopupMainMenu: [true,false]
+ If set to ``false'', Button2 events will not bring up the Main Menu in
+ the canvas window.
+ The default is true.
  .\"
  .\" add new X defaults here
*** HISTORY.orig	Fri Nov 10 13:07:55 2000
--- HISTORY	Fri Nov 10 13:07:55 2000
***************
*** 1,5 ****
  -----------------------> tgif-4.1.38 => tgif-4.1.39 <-----------------------
  1)  Add a new X default, Tgif.LandscapePdfSetPageDevice.  Currently, when
!     when exporting landscape PDF files, tgif will use a PostScript
      "setpagedevice" command to rotate the generated PostScript file 270 degrees
      before calling ps2pdf.  This should not be necessary (and is considered a
--- 1,33 ----
+ -----------------------> tgif-4.1.39 => tgif-4.1.40 <-----------------------
+ 1)  Fix a crashing bug in Specify An Arc when the input is something like
+     "0.9,-,10,20".  Thanks to Adrian Bridgett <adrian.bridgett@iname.com>
+     and Jano van Hemert <jvhemert@cs.leidenuniv.nl> for pointing out the
+     problem.
+ 2)  Fix a uninitialized variable bug.  This causes crashes sometimes when
+     running tgif with -print -xbm commandline options.  Thanks to
+     Alexander Tenbusch <alexander.tenbusch@masch-bau.uni-magdeburg.de>
+     for pointing out the problem.
+ 3)  Fix a bug with exporting landscape TiffEPSI files.  Thanks to Geert Carron
+     <gca@adc-itcl.ce.philips.com> for pointing out the bug.
+ 4)  Fix a bug with displaying text objects when Color Layers are used and
+     some colors are turned off.  Thanks to Johan Vromans
+     <jvromans@squirrel.nl> for pointing out the bug.
+ 5)  Add scroll support for mouse wheel.  By default, mouse wheel up is mapped
+     to Button4 and mouse wheel down is mapped to Button5.  A new X default,
+     Tgif.EnableMouseWheel, is added so that this can be turned off.  Some
+     mouse wheel can generate Button2 events, and this may interfere with
+     scrolling; therefore, another X default, Tgif.Btn2PopupMainMenu, is added
+     so that Button2 events will not popup the Main Menu in the canvas window.
+     Thanks to Juha Takala <juha.takala@vtt.fi> for providing the information.
+ 6)  New Tgif.tmpl-cgywin file.  Thanks to Simon Moore
+     <Simon.Moore@cl.cam.ac.uk> for providing it.
+ 7)  New Tgif.tmpl-uw7 file.  Thanks to Ron Record <rr@sco.com> for providing it.
+ 8)  Add a new X default, Tgif.DeleteCmdAsCut so that <Cntrl>x can be used
+     Cut selected objects.  (Pressing the <DEL> key on the keyboard will still
+     perform a regular Delete in this case.)
+ 
  -----------------------> tgif-4.1.38 => tgif-4.1.39 <-----------------------
  1)  Add a new X default, Tgif.LandscapePdfSetPageDevice.  Currently, when
!     exporting landscape PDF files, tgif will use a PostScript
      "setpagedevice" command to rotate the generated PostScript file 270 degrees
      before calling ps2pdf.  This should not be necessary (and is considered a
*** tgif.Xdefaults.orig	Fri Nov 10 13:07:56 2000
--- tgif.Xdefaults	Fri Nov 10 13:07:56 2000
***************
*** 487,488 ****
--- 487,494 ----
  !
  !Tgif.LandscapePdfSetPageDevice:	true
+ !
+ ! Added in version 4.1.40
+ !
+ !Tgif.DeleteCmdAsCut:		true
+ !Tgif.EnableMouseWheel:		false
+ !Tgif.Btn2PopupMainMenu:	false
*** Tgif.tmpl-cgywin.orig	Fri Nov 10 13:07:56 2000
--- Tgif.tmpl-cgywin	Fri Nov 10 13:07:57 2000
***************
*** 0 ****
--- 1,80 ----
+ XCOMM 
+ XCOMM  Author:      William Chia-Wei Cheng (william@cs.ucla.edu)
+ XCOMM  Modified-by: Simon W. Moore (Simon.Moore@cl.cam.ac.uk)
+ XCOMM 
+ XCOMM  Copyright (C) 1990-2000, William Chia-Wei Cheng.
+ XCOMM 
+ XCOMM  Permission limited to the use, copy, display, distribute without
+ XCOMM  charging for a fee, and produce derivative works of "tgif" and
+ XCOMM  its documentation for not-for-profit purpose is hereby granted by
+ XCOMM  the Author, provided that the above copyright notice appears in
+ XCOMM  all copies made of "tgif" and that both the copyright notice
+ XCOMM  and this permission notice appear in supporting documentation,
+ XCOMM  and that the name of the Author not be used in advertising or
+ XCOMM  publicity pertaining to distribution of the software without
+ XCOMM  specific, written prior permission.  The Author makes no
+ XCOMM  representations about the suitability of this software for any
+ XCOMM  purpose.  It is provided "as is" without express or implied
+ XCOMM  warranty.  All other rights (including, but not limited to, the
+ XCOMM  right to sell "tgif", the right to sell or distribute derivative
+ XCOMM  works of "tgif", the right to distribute "tgif" for a fee, and
+ XCOMM  the right to include "tgif" or derivative works of "tgif" in a
+ XCOMM  for-sale product or service) are reserved by the Author.
+ XCOMM 
+ XCOMM  THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ XCOMM  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ XCOMM  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ XCOMM  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ XCOMM  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ XCOMM  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ XCOMM  PERFORMANCE OF THIS SOFTWARE.
+ XCOMM 
+ XCOMM  @(#)$Header: /mm/src/tgif/v4/RCS/Tgif.tmpl-cgywin,v 4.0 2000/10/09 15:22:01 william Exp $
+ XCOMM
+ 
+ #if ProjectX == 5
+ #if BuildXimp
+ XIMPDEFINES      =
+ #else
+ XIMPDEFINES      = -D_NO_XIMP
+ #endif
+ #elif ProjectX > 5
+ XIMPDEFINES      =
+ #endif
+ 
+ PROGRAMS	= tgif XCOMM prtgif frontend11.o testdrive
+ TGIFDIR		= $(LIBDIR)/tgif
+ XCOMM CDEBUGFLAGS= -g -Wall
+ XCOMM INSTPGMFLAGS= -s
+ XCOMM BINDIR	= /u/halfmoon/bin
+ XCOMM MANPATH	= /u/halfmoon/man
+ XCOMM TGIFDIR	= /u/halfmoon/lib/X11/tgif
+ XCOMM MOREDEFINES	= -D_HAS_STREAMS_SUPPORT -DENABLE_NLS -D_TGIF_DBG
+ LOCALEDIR	= /usr/share/locale
+ DIRDEFINES	= -DTGIF_PATH=\"$(TGIFDIR)\" -DPSFILE_MOD=0664 \@@\
+                   -DLOCALEDIR=\"$(LOCALEDIR)\" \@@\
+                   -DTELEPORT_ATTR=\"warp_to=\" -DTMP_DIR=\"/tmp/\" \@@\
+                   -DLAUNCH_ATTR=\"launch=\" -DEXEC_ATTR=\"exec=\"
+ EXTDEFINES	= -DEPSF_FILE_EXT=\"eps\" -DPS_FILE_EXT=\"ps\" \@@\
+                   -DXBM_FILE_EXT=\"xbm\" -DXPM_FILE_EXT=\"xpm\" \@@\
+                   -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\
+                   -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" \@@\
+                   -DNETLIST_FILE_EXT=\"net\" -DCOMP_FILE_EXT=\"cmp\"
+ MISCDEFINES	= -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT \@@\
+                   -D_USE_PS_ADOBE_STRING=\"3.0/3.0\" -D_DONT_USE_MKTEMP
+ MOREDEFINES	= -D_NO_RAND48
+ 
+ XCOMM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ XCOMM Please see Imakefile for more defines to be added to MOREDEFINES above
+ XCOMM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ 
+ DEPLIBS		= $(DEPXLIB)
+ LOCAL_LIBRARIES	= $(XLIB)
+ XCOMM LOCAL_LIBRARIES	= $(XMULIB) $(XTOOLLIB) $(XLIB)
+ XCOMM SYS_LIBRARIES	= -ldl -lm
+ SYS_LIBRARIES	= -lm
+ 
+ XCOMM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^	XCOMM
+ XCOMM This file has been tested under (uname -s -r):	XCOMM
+ XCOMM		Windows 2000 w/ CgyWin+XFree86+Exceed	XCOMM
+ XCOMM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^	XCOMM
*** Tgif.tmpl-uw7.orig	Fri Nov 10 13:07:57 2000
--- Tgif.tmpl-uw7	Fri Nov 10 13:07:57 2000
***************
*** 0 ****
--- 1,87 ----
+ XCOMM 
+ XCOMM  Author:      William Chia-Wei Cheng (william@cs.ucla.edu)
+ XCOMM  Modified-by: Ron Record (rr@sco.com) 08-Nov-00
+ XCOMM 
+ XCOMM  Copyright (C) 1990-2000, William Chia-Wei Cheng.
+ XCOMM 
+ XCOMM  Permission limited to the use, copy, display, distribute without
+ XCOMM  charging for a fee, and produce derivative works of "tgif" and
+ XCOMM  its documentation for not-for-profit purpose is hereby granted by
+ XCOMM  the Author, provided that the above copyright notice appears in
+ XCOMM  all copies made of "tgif" and that both the copyright notice
+ XCOMM  and this permission notice appear in supporting documentation,
+ XCOMM  and that the name of the Author not be used in advertising or
+ XCOMM  publicity pertaining to distribution of the software without
+ XCOMM  specific, written prior permission.  The Author makes no
+ XCOMM  representations about the suitability of this software for any
+ XCOMM  purpose.  It is provided "as is" without express or implied
+ XCOMM  warranty.  All other rights (including, but not limited to, the
+ XCOMM  right to sell "tgif", the right to sell or distribute derivative
+ XCOMM  works of "tgif", the right to distribute "tgif" for a fee, and
+ XCOMM  the right to include "tgif" or derivative works of "tgif" in a
+ XCOMM  for-sale product or service) are reserved by the Author.
+ XCOMM 
+ XCOMM  THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ XCOMM  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ XCOMM  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ XCOMM  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ XCOMM  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ XCOMM  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ XCOMM  PERFORMANCE OF THIS SOFTWARE.
+ XCOMM 
+ XCOMM  @(#)$Header: /mm/src/tgif/v4/RCS/Tgif.tmpl-uw7,v 4.0 2000/11/08 23:37:40 william Exp $
+ XCOMM 
+ 
+ #if ProjectX == 5
+ #if BuildXimp
+ XIMPDEFINES      =
+ #else
+ XIMPDEFINES      = -D_NO_XIMP
+ #endif
+ #elif ProjectX > 5
+ XIMPDEFINES      =
+ #endif
+ 
+ CC		= gcc -Wall
+ PREPROCESSCMD	= gcc -E $(STD_CPP_DEFINES)
+ EXTRA_LDOPTIONS	=
+ EXTRA_LIBRARIES	= -lsocket -lnsl -lgen
+ LDCOMBINEFLAGS	= -r
+ CCOPTIONS	=
+ 
+ PROGRAMS	= tgif XCOMM prtgif frontend11.o testdrive
+ TGIFDIR		= $(LIBDIR)/tgif
+ XCOMM CDEBUGFLAGS= -g
+ XCOMM INSTPGMFLAGS= -s
+ BINDIR	= /usr/local/bin
+ MANPATH	= /usr/local/man
+ TGIFDIR	= /usr/local/lib/X11/tgif
+ LOCALEDIR	= /usr/local/share/locale
+ DIRDEFINES	= -DTGIF_PATH=\"$(TGIFDIR)\" -DPSFILE_MOD=0664 \@@\
+                   -DLOCALEDIR=\"$(LOCALEDIR)\" \@@\
+                   -DTELEPORT_ATTR=\"warp_to=\" -DTMP_DIR=\"/tmp/\" \@@\
+                   -DLAUNCH_ATTR=\"launch=\" -DEXEC_ATTR=\"exec=\"
+ EXTDEFINES	= -DEPSF_FILE_EXT=\"eps\" -DPS_FILE_EXT=\"ps\" \@@\
+                   -DXBM_FILE_EXT=\"xbm\" -DXPM_FILE_EXT=\"xpm\" \@@\
+                   -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\
+                   -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" \@@\
+                   -DNETLIST_FILE_EXT=\"net\" -DCOMP_FILE_EXT=\"cmp\"
+ MISCDEFINES	= -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT \@@\
+                   -D_USE_PS_ADOBE_STRING=\"3.0/3.0\"
+ MOREDEFINES	= -D_HAS_STREAMS_SUPPORT
+ 
+ XCOMM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ XCOMM Please see Imakefile for more defines to be added to MOREDEFINES above
+ XCOMM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ 
+ DEPLIBS		= $(DEPXLIB)
+ LOCAL_LIBRARIES	= $(XLIB)
+ XCOMM LOCAL_LIBRARIES	= $(XMULIB) $(XTOOLLIB) $(XLIB)
+ SYS_LIBRARIES	= -ldl -lm
+ XCOMM SYS_LIBRARIES	= -lm
+ 
+ XCOMM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^	XCOMM
+ XCOMM This file has been tested under (uname -s -r):	XCOMM
+ XCOMM		UnixWare 5				XCOMM
+ XCOMM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^	XCOMM
+ 
