*** drawing.c.orig Tue Nov 2 13:56:47 1999 --- drawing.c Tue Nov 2 13:56:47 1999 *************** *** 2460,2463 **** --- 2460,2465 ---- } else if (strcmp(name, "SetHtmlExportTemplate()") == 0) { SetHtmlExportTemplate(); + } else if (strcmp(name, "PrintPages()") == 0) { + PrintPages(); } } *** exec.c.orig Tue Nov 2 13:56:49 1999 --- exec.c Tue Nov 2 13:56:50 1999 *************** *** 4117,4141 **** { char *expr=argv[0], *then_attr_name=argv[1], *else_attr_name=argv[2]; ! struct AttrRec *then_attr_ptr=NULL, *else_attr_ptr=NULL; ! struct ObjRec *then_attr_owner_obj=NULL, *else_attr_owner_obj=NULL; ! int val; UtilRemoveQuotes(then_attr_name); UtilRemoveQuotes(else_attr_name); - if (strcmp(then_attr_name, "NULL") != 0) { - sprintf(execDummyStr, "%s=", then_attr_name); - then_attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, - &then_attr_owner_obj); - if (then_attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); - } - if (strcmp(else_attr_name, "NULL") != 0) { - sprintf(execDummyStr, "%s=", else_attr_name); - else_attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, - &else_attr_owner_obj); - if (else_attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); - } if (!IntExpression(expr, &val, orig_cmd)) return FALSE; if (val) { if (then_attr_ptr != NULL && !DoExec(then_attr_ptr, then_attr_owner_obj)) { --- 4117,4136 ---- { char *expr=argv[0], *then_attr_name=argv[1], *else_attr_name=argv[2]; ! int val=0; UtilRemoveQuotes(then_attr_name); UtilRemoveQuotes(else_attr_name); if (!IntExpression(expr, &val, orig_cmd)) return FALSE; if (val) { + struct AttrRec *then_attr_ptr=NULL; + struct ObjRec *then_attr_owner_obj=NULL; + + if (strcmp(then_attr_name, "NULL") != 0) { + sprintf(execDummyStr, "%s=", then_attr_name); + then_attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, + &then_attr_owner_obj); + if (then_attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); + } if (then_attr_ptr != NULL && !DoExec(then_attr_ptr, then_attr_owner_obj)) { *************** *** 4143,4146 **** --- 4138,4150 ---- } } else { + struct AttrRec *else_attr_ptr=NULL; + struct ObjRec *else_attr_owner_obj=NULL; + + if (strcmp(else_attr_name, "NULL") != 0) { + sprintf(execDummyStr, "%s=", else_attr_name); + else_attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, + &else_attr_owner_obj); + if (else_attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); + } if (else_attr_ptr != NULL && !DoExec(else_attr_ptr, else_attr_owner_obj)) { *** file.c.orig Tue Nov 2 13:56:53 1999 --- file.c Tue Nov 2 13:56:53 1999 *************** *** 111,114 **** --- 111,115 ---- int curFileWriteVersion=CUR_VERSION; int importingFile=FALSE; + int mergingFile=FALSE; int serializingFile=FALSE; int deserializingFile=FALSE; *************** *** 194,197 **** --- 195,200 ---- KeyValInfo *gaFilePSFontAliases=NULL; + SpecifyPagesInfo gPagesToPrintSpec; + static int psRegMarksInTiledPageMode=INVALID; static float psRegMarksGray=(float)0.95; *************** *** 1954,1958 **** gnCannotFindColorMsg = FALSE; ! if (!importingFile) { if (fileVersion <= 13) { switch (page_style) { --- 1957,1961 ---- gnCannotFindColorMsg = FALSE; ! if (!importingFile && !mergingFile) { if (fileVersion <= 13) { switch (page_style) { *************** *** 1985,1989 **** if (PRTGIF && useGray) forced_use_gray = TRUE; ! if (importingFile) return TRUE; page_arg1 = page_arg2 = 1; --- 1988,1992 ---- if (PRTGIF && useGray) forced_use_gray = TRUE; ! if (importingFile || mergingFile) return TRUE; page_arg1 = page_arg2 = 1; *************** *** 2729,2740 **** } if (curPage == NULL) { ! sprintf(gszMsgBox, TgLoadString(STID_BAD_INPUT_WHILE_READ_PAGE), ! page_num); ! if (PRTGIF) { ! fprintf(stderr, "%s\n", gszMsgBox); ! } else { ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); } ! return FALSE; } s = FindChar((int)',', s); --- 2732,2746 ---- } if (curPage == NULL) { ! if (!mergingFile) { ! sprintf(gszMsgBox, TgLoadString(STID_BAD_INPUT_WHILE_READ_PAGE), ! page_num); ! if (PRTGIF) { ! fprintf(stderr, "%s\n", gszMsgBox); ! } else { ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! } ! return FALSE; } ! AddPageAfter(); } s = FindChar((int)',', s); *************** *** 3099,3104 **** return FreeBufAndReturn(line, (read_state_ok) ? TRUE : INVALID); } else if (strcmp(obj_name, "file_attr") == 0) { ! if (importingFile && !importingIconFile) { ! struct AttrRec *saved_first_attr, *saved_last_attr; saved_first_attr = tgifObj->fattr; --- 3105,3110 ---- return FreeBufAndReturn(line, (read_state_ok) ? TRUE : INVALID); } else if (strcmp(obj_name, "file_attr") == 0) { ! if (mergingFile) { ! struct AttrRec *saved_first_attr=NULL, *saved_last_attr=NULL; saved_first_attr = tgifObj->fattr; *************** *** 3108,3111 **** --- 3114,3138 ---- ReadObjAttrs(START_HAVING_ATTRS-1, FP, &tgifObj); + + if (tgifObj->fattr == NULL) { + /* this file has no file attribute -- which should not happen */ + tgifObj->fattr = saved_first_attr; + tgifObj->lattr = saved_last_attr; + } else if (saved_last_attr == NULL) { + /* this is this first file that has file attributes, keep it */ + } else { + tgifObj->fattr->prev = saved_last_attr; + saved_last_attr->next = tgifObj->fattr; + tgifObj->fattr = saved_first_attr; + } + } else if (importingFile && !importingIconFile) { + struct AttrRec *saved_first_attr=NULL, *saved_last_attr=NULL; + + saved_first_attr = tgifObj->fattr; + saved_last_attr = tgifObj->lattr; + tgifObj->fattr = NULL; + tgifObj->lattr = NULL; + + ReadObjAttrs(START_HAVING_ATTRS-1, FP, &tgifObj); DelAllAttrs(tgifObj->fattr); *************** *** 4074,4077 **** --- 4101,4106 ---- static int dumpOnePageInTileMode=FALSE; static int dumpOnePageInStackMode=FALSE; + static int dumpPages=FALSE; + static int dumpPageNum=0; static FILE *dumpFP=NULL; *************** *** 5113,5117 **** rc = TRUE; } ! if (preDumpSetup) { return rc; } --- 5142,5146 ---- rc = TRUE; } ! if (preDumpSetup && rc) { return rc; } *************** *** 5302,5309 **** if ((whereToPrint != LATEX_FIG && whereToPrint != EPSI_FILE) || !minimalEPS) { ! if (fprintf(dumpFP, "%%%%Pages: %1d\n", ! (dumpOnePageInStackMode || dumpOnePageInTileMode) ? 1 : ! ((pageLayoutMode == PAGE_STACK) ? lastPageNum : ! paperCol * paperRow)) == EOF) { writeFileFailed = TRUE; } --- 5331,5346 ---- if ((whereToPrint != LATEX_FIG && whereToPrint != EPSI_FILE) || !minimalEPS) { ! int total_pages=0; ! ! if (dumpOnePageInStackMode || dumpOnePageInTileMode || ! whereToPrint == LATEX_FIG || whereToPrint == EPSI_FILE) { ! total_pages = 1; ! } else if (pageLayoutMode == PAGE_STACK) { ! total_pages = (dumpPages ? gPagesToPrintSpec.num_pages_specified : ! lastPageNum); ! } else { ! total_pages = paperCol * paperRow; ! } ! if (fprintf(dumpFP, "%%%%Pages: %1d\n", total_pages) == EOF) { writeFileFailed = TRUE; } *************** *** 5378,5384 **** if ((whereToPrint != LATEX_FIG && whereToPrint != EPSI_FILE) || !minimalEPS) { ! fprintf(dumpFP, "%%%%Page: %1d %1d\n\n", ! printingPageNum-printingFirstPageNum+1, ! printingPageNum-printingFirstPageNum+1); } if (!minimalEPS) { --- 5415,5426 ---- if ((whereToPrint != LATEX_FIG && whereToPrint != EPSI_FILE) || !minimalEPS) { ! if (dumpPages) { ! fprintf(dumpFP, "%%%%Page: %1d %1d\n\n", ! printingPageNum, dumpPageNum); ! } else { ! fprintf(dumpFP, "%%%%Page: %1d %1d\n\n", ! printingPageNum-printingFirstPageNum+1, ! printingPageNum-printingFirstPageNum+1); ! } } if (!minimalEPS) { *************** *** 6173,6177 **** { int ok=TRUE; - char dummy_str[MAXSTRING+1]; struct PageRec *saved_cur_page; --- 6215,6218 ---- *************** *** 6179,6185 **** whereToPrint == TIFFEPSI_FILE) && pageLayoutMode == PAGE_TILE && (paperCol != 1 || paperRow != 1)) { ! strcpy(dummy_str, TgLoadString(STID_CANNOT_PRINT_EPS_TILED_PAGE)); if (PRTGIF) { ! fprintf(stderr, "%s\n", dummy_str); } else { MsgBox(TgLoadString(STID_CANNOT_PRINT_EPS_TILED_PAGE), TOOL_NAME, --- 6220,6226 ---- whereToPrint == TIFFEPSI_FILE) && pageLayoutMode == PAGE_TILE && (paperCol != 1 || paperRow != 1)) { ! strcpy(gszMsgBox, TgLoadString(STID_CANNOT_PRINT_EPS_TILED_PAGE)); if (PRTGIF) { ! fprintf(stderr, "%s\n", gszMsgBox); } else { MsgBox(TgLoadString(STID_CANNOT_PRINT_EPS_TILED_PAGE), TOOL_NAME, *************** *** 6242,6248 **** topObj = curPage->top; botObj = curPage->bot; ! sprintf(dummy_str, TgLoadString(STID_PREPROCESS_PAGE_OF), printingPageNum, lastPageNum); ! SetStringStatus(dummy_str); ok = GenDump(FileName); } --- 6283,6289 ---- topObj = curPage->top; botObj = curPage->bot; ! sprintf(gszMsgBox, TgLoadString(STID_PREPROCESS_PAGE_OF), printingPageNum, lastPageNum); ! SetStringStatus(gszMsgBox); ok = GenDump(FileName); } *************** *** 6263,6269 **** topObj = curPage->top; botObj = curPage->bot; ! sprintf(dummy_str, TgLoadString(STID_GENERATING_PAGE_OF), printingPageNum, lastPageNum); ! SetStringStatus(dummy_str); ok = GenDump(FileName); } --- 6304,6310 ---- topObj = curPage->top; botObj = curPage->bot; ! sprintf(gszMsgBox, TgLoadString(STID_GENERATING_PAGE_OF), printingPageNum, lastPageNum); ! SetStringStatus(gszMsgBox); ok = GenDump(FileName); } *************** *** 6312,6315 **** --- 6353,6433 ---- } + void DumpPages() + { + struct PageRec *saved_cur_page=NULL; + int ok=TRUE; + XColor *saved_tgif_colors=tgifColors; + + if (printUsingRequestedColor) tgifColors = tgifRequestedColors; + + SetWatchCursor(drawWindow); + SetWatchCursor(mainWindow); + + ResetPSInfo(); + + printingFirstPageNum = INVALID; + printingPageNum = 1; + printingLastPageNum = lastPageNum; + saved_cur_page = curPage; + totalBBoxValid = FALSE; + SaveStatusStrings(); + for (curPage=firstPage; ok && curPage != NULL; curPage=curPage->next, + printingPageNum++) { + if (gPagesToPrintSpec.page_specified[printingPageNum-1]) { + if (printingFirstPageNum == INVALID) { + printingFirstPageNum = printingPageNum; + } + topObj = curPage->top; + botObj = curPage->bot; + sprintf(gszMsgBox, TgLoadString(STID_PREPROCESS_PAGE_OF), + printingPageNum, lastPageNum); + SetStringStatus(gszMsgBox); + ok = GenDump(""); + } + } + RestoreStatusStrings(); + curPage = saved_cur_page; + topObj = curPage->top; + botObj = curPage->bot; + + DoneResetPSInfo(); + + dumpPages = TRUE; + dumpPageNum = 0; + printingFirstPageNum = INVALID; + printingPageNum = 1; + printingLastPageNum = lastPageNum; + saved_cur_page = curPage; + totalBBoxValid = FALSE; + SaveStatusStrings(); + for (curPage=firstPage; ok && curPage != NULL; curPage=curPage->next, + printingPageNum++) { + if (gPagesToPrintSpec.page_specified[printingPageNum-1]) { + if (printingFirstPageNum == INVALID) { + printingFirstPageNum = printingPageNum; + } + dumpPageNum++; + topObj = curPage->top; + botObj = curPage->bot; + sprintf(gszMsgBox, TgLoadString(STID_GENERATING_PAGE_OF), + printingPageNum, lastPageNum); + SetStringStatus(gszMsgBox); + ok = GenDump(""); + } + } + RestoreStatusStrings(); + curPage = saved_cur_page; + topObj = curPage->top; + botObj = curPage->bot; + + dumpPages = FALSE; + dumpPageNum = INVALID; + + SetDefaultCursor(mainWindow); + ShowCursor(); + + if (printUsingRequestedColor) tgifColors = saved_tgif_colors; + } + void DumpOnePageInTileMode(row, col) int row, col; *************** *** 6382,6386 **** SetWatchCursor(mainWindow); ! if (lastPageNum != 1) dumpOneFilePerPage = TRUE; dumpOnePageInStackMode = TRUE; for (curPageNum=1; ok && curPageNum <= lastPageNum; curPageNum++) { --- 6500,6504 ---- SetWatchCursor(mainWindow); ! dumpOneFilePerPage = TRUE; dumpOnePageInStackMode = TRUE; for (curPageNum=1; ok && curPageNum <= lastPageNum; curPageNum++) { *************** *** 6388,6400 **** GotoPageNum(curPageNum); printingFirstPageNum = printingPageNum = printingLastPageNum = curPageNum; ! if (whereToPrint==LATEX_FIG || whereToPrint==PS_FILE || ! whereToPrint==PDF_FILE || whereToPrint==EPSI_FILE || ! whereToPrint==TIFFEPSI_FILE) { ! ResetPSInfo(); ! ok = GenDump(""); ! DoneResetPSInfo(); ! if (ok) ok = GenDump(""); ! } else { ! ok = GenDump(""); } } --- 6506,6520 ---- GotoPageNum(curPageNum); printingFirstPageNum = printingPageNum = printingLastPageNum = curPageNum; ! if (gPagesToPrintSpec.page_specified[curPageNum-1]) { ! if (whereToPrint==LATEX_FIG || whereToPrint==PS_FILE || ! whereToPrint==PDF_FILE || whereToPrint==EPSI_FILE || ! whereToPrint==TIFFEPSI_FILE) { ! ResetPSInfo(); ! ok = GenDump(""); ! DoneResetPSInfo(); ! if (ok) ok = GenDump(""); ! } else { ! ok = GenDump(""); ! } } } *************** *** 6456,6466 **** for (curPage=firstPage; ok && curPage != NULL; curPage=curPage->next, printingPageNum++) { - char dummy_str[MAXSTRING+1]; - topObj = curPage->top; botObj = curPage->bot; ! sprintf(dummy_str, TgLoadString(STID_PREPROCESS_PAGE_OF), printingPageNum, lastPageNum); ! SetStringStatus(dummy_str); ok = GenDump(FileName); } --- 6576,6584 ---- for (curPage=firstPage; ok && curPage != NULL; curPage=curPage->next, printingPageNum++) { topObj = curPage->top; botObj = curPage->bot; ! sprintf(gszMsgBox, TgLoadString(STID_PREPROCESS_PAGE_OF), printingPageNum, lastPageNum); ! SetStringStatus(gszMsgBox); ok = GenDump(FileName); } *************** *** 6479,6489 **** for (curPage=firstPage; ok && curPage != NULL; curPage=curPage->next, printingPageNum++) { - char dummy_str[MAXSTRING+1]; - topObj = curPage->top; botObj = curPage->bot; ! sprintf(dummy_str, TgLoadString(STID_GENERATING_PAGE_OF), printingPageNum, lastPageNum); ! SetStringStatus(dummy_str); ok = GenDump(FileName); } --- 6597,6605 ---- for (curPage=firstPage; ok && curPage != NULL; curPage=curPage->next, printingPageNum++) { topObj = curPage->top; botObj = curPage->bot; ! sprintf(gszMsgBox, TgLoadString(STID_GENERATING_PAGE_OF), printingPageNum, lastPageNum); ! SetStringStatus(gszMsgBox); ok = GenDump(FileName); } *************** *** 6972,6982 **** TgMenu *menu; { ! int ok=TRUE; ! /* Print/ExportInColor */ ok &= TgSetMenuItemCheckById(menu, CMDID_TOGGLEBWCOLORPS, colorDump); ! /* PrintOneFilePerPage */ ok &= TgEnableMenuItemById(menu, CMDID_PRINTONEFILEPERPAGE, ! (pageLayoutMode==PAGE_STACK)); return ok; --- 7088,7126 ---- TgMenu *menu; { ! int ok=TRUE, allow_print_pages=TRUE; ! /* Print/Export In Color */ ok &= TgSetMenuItemCheckById(menu, CMDID_TOGGLEBWCOLORPS, colorDump); ! ! /* Print With Cmd */ ! ok &= TgEnableMenuItemById(menu, CMDID_PRINTWITHCMD, ! (whereToPrint==PRINTER)); ! ! /* ! * Print Pages - only allows PRINTER, PS_FILE, PDF_FILE, or user supplied ! * export filters ! */ ! if (pageLayoutMode == PAGE_TILE) { ! allow_print_pages = FALSE; ! } else { ! switch (whereToPrint) { ! case LATEX_FIG: ! case XBM_FILE: ! case TEXT_FILE: ! case EPSI_FILE: ! case GIF_FILE: ! case HTML_FILE: ! case TIFFEPSI_FILE: ! case PNG_FILE: ! allow_print_pages = FALSE; ! break; ! default: break; ! } ! } ! ok &= TgEnableMenuItemById(menu, CMDID_PRINTPAGES, allow_print_pages); ! ! /* Print One File Per Page */ ok &= TgEnableMenuItemById(menu, CMDID_PRINTONEFILEPERPAGE, ! (pageLayoutMode == PAGE_STACK && whereToPrint != PRINTER)); return ok; *** grid.c.orig Tue Nov 2 13:56:57 1999 --- grid.c Tue Nov 2 13:56:57 1999 *************** *** 556,559 **** --- 556,560 ---- ShowWhereToPrint(); UpdatePinnedMenu(MENU_LAYOUT); + UpdatePinnedMenu(MENU_FILE); } *************** *** 566,570 **** WhereToPrintMsg(); ShowWhereToPrint(); ! /* UpdatePinnedMenu(MENU_LAYOUT); -- no need since we have ExportFormat popup */ nIndex = GetExportIndex(whereToPrint, EXPORT_NEXT); --- 567,571 ---- WhereToPrintMsg(); ShowWhereToPrint(); ! UpdatePinnedMenu(MENU_FILE); nIndex = GetExportIndex(whereToPrint, EXPORT_NEXT); *** mainloop.c.orig Tue Nov 2 13:56:58 1999 --- mainloop.c Tue Nov 2 13:56:58 1999 *************** *** 68,71 **** --- 68,72 ---- #include "mainloop.e" #include "mainmenu.e" + #include "markup.e" #include "menu.e" #include "miniline.e" *************** *** 113,116 **** --- 114,120 ---- char *cmdLineBackground=NULL; char *cmdLineBorder=NULL; + int cmdLineMerge=FALSE; + int cmdLineMergeArgc=0; + char **cmdLineMergeArgv=NULL; int geometrySpecified=FALSE; int exitNormally=FALSE; *************** *** 122,125 **** --- 126,131 ---- struct WinInfoRec *extraWinInfo=NULL; + PageInfo mergingPageInfo; + static int maxExtraWins=0; static int quitDraw=TRUE; *************** *** 268,271 **** --- 274,292 ---- */ + static + void CleanUpMergeArgs() + { + if (cmdLineMergeArgv != NULL) { + int i=0; + + for (i=0; i < cmdLineMergeArgc; i++) { + UtilFree(cmdLineMergeArgv[i]); + } + free(cmdLineMergeArgv); + } + cmdLineMergeArgc = 0; + cmdLineMergeArgv = NULL; + } + void CleanUp() { *************** *** 321,324 **** --- 342,346 ---- CleanUpMsg(); CleanUpShortCut(); + CleanUpHtml(); if (iconWindowCreated) { *************** *** 661,676 **** #endif /* ~_NO_LOCALE_SUPPORT */ ! int JustInit(pszFile, pnNeedToCheckAutoExec) char *pszFile; ! int *pnNeedToCheckAutoExec; { ! int tmp_linenum; char tmp_filename[MAXPATHLENGTH+1], tmp_filefullpath[MAXPATHLENGTH+1]; ! char full_name[MAXPATHLENGTH+1], *rest; ! char *c_ptr=NULL, file_name[MAXPATHLENGTH+1], gzipped_fname[MAXPATHLENGTH+1]; ! int rc, gzipped_obj_file=FALSE; int file_is_remote=FALSE, remote_buf_sz=0, is_html=FALSE; char remote_fname[MAXPATHLENGTH+1], *tmp_remote_fname=NULL; char *remote_buf=NULL, *page_spec=NULL; #ifdef USE_XAPPLRESDIR FILE *xenv_fp=NULL; --- 683,1013 ---- #endif /* ~_NO_LOCALE_SUPPORT */ ! static ! int JustLoadAFile(pszFile, pnNeedToCheckAutoExec, nAttemptToMerge, pnAbortMerge) char *pszFile; ! int *pnNeedToCheckAutoExec, nAttemptToMerge, *pnAbortMerge; ! /* ! * return FALSE if nAttemptToMerge is TRUE and pszFile is in ! * TILED page mode ! * return TRUE otherwise ! */ { ! int short_name=FALSE, obj_file=TRUE; ! int tmp_linenum=0; char tmp_filename[MAXPATHLENGTH+1], tmp_filefullpath[MAXPATHLENGTH+1]; ! char full_name[MAXPATHLENGTH+1], *rest=NULL; ! char file_name[MAXPATHLENGTH+1], gzipped_fname[MAXPATHLENGTH+1]; ! int rc=0, gzipped_obj_file=FALSE; int file_is_remote=FALSE, remote_buf_sz=0, is_html=FALSE; char remote_fname[MAXPATHLENGTH+1], *tmp_remote_fname=NULL; char *remote_buf=NULL, *page_spec=NULL; + struct ObjRec *obj_ptr=NULL; + FILE *fp=NULL; + + *remote_fname = *gzipped_fname = '\0'; + + if (FileIsRemote(pszFile)) { + if (!FormNewFileName(curDir, pszFile, NULL, remote_fname, &page_spec)) { + sprintf(gszMsgBox, TgLoadString(STID_INVALID_REMOTE_FNAME), pszFile); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + *pszFile = '\0'; + } else { + char *content_type=NULL; + char final_url[MAXPATHLENGTH+1]; + + *final_url = '\0'; + SaveStatusStrings(); + rc = LoadRemoteFileInMem(remote_fname, &remote_buf, + &content_type, &remote_buf_sz, &is_html, TRUE, + final_url, sizeof(final_url)); + RestoreStatusStrings(); + if (rc && remote_buf != NULL && + (tmp_remote_fname=WriteRemoteFileIntoTemp(remote_buf, + remote_buf_sz, NULL)) != NULL) { + if (*final_url != '\0') { + UtilStrCpyN(pszFile, MAXPATHLENGTH+1, final_url); + UtilStrCpyN(remote_fname, MAXPATHLENGTH+1, final_url); + } + if (FileNameHasExtension(remote_fname, OBJ_FILE_TYPE, + &gzipped_obj_file, NULL)) { + file_is_remote = TRUE; + } else if (UseExternalViewer(is_html, remote_fname, content_type, + tmp_remote_fname) != FALSE) { + unlink(tmp_remote_fname); + FreeRemoteBuf(tmp_remote_fname); + if (remote_buf != NULL) FreeRemoteBuf(remote_buf); + remote_buf = tmp_remote_fname = NULL; + file_is_remote = FALSE; + *pszFile = '\0'; + } else { + file_is_remote = TRUE; + } + } else { + if (remote_buf != NULL) FreeRemoteBuf(remote_buf); + remote_buf = NULL; + *pszFile = '\0'; + } + if (content_type != NULL) FreeRemoteBuf(content_type); + } + } + *file_name = '\0'; + if (file_is_remote) { + if ((fp=fopen(tmp_remote_fname, "r")) == NULL) { + sprintf(gszMsgBox, TgLoadString(STID_CANNOT_READ_TMP_FILE), + tmp_remote_fname); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + + unlink(tmp_remote_fname); + FreeRemoteBuf(tmp_remote_fname); + FreeRemoteBuf(remote_buf); + remote_buf = tmp_remote_fname = NULL; + file_is_remote = FALSE; + } else { + if (FileNameHasExtension(remote_fname, SYM_FILE_TYPE, NULL, NULL)) { + obj_file = FALSE; + } else if (FileNameHasExtension(remote_fname, PIN_FILE_TYPE, + NULL, NULL)) { + obj_file = FALSE; + } else { + obj_file = TRUE; + } + } + } else { + if (FileNameHasExtension(pszFile, OBJ_FILE_TYPE, &gzipped_obj_file, + NULL)) { + if (gzipped_obj_file) { + char *tmp_fname=NULL; + + if ((tmp_fname=GunzipFileIntoTemp(pszFile)) == NULL) { + *file_name = '\0'; + } else { + strcpy(gzipped_fname, pszFile); + strcpy(file_name, tmp_fname); + free(tmp_fname); + } + } else { + strcpy(file_name, pszFile); + } + } else if (FileNameHasExtension(pszFile, SYM_FILE_TYPE, NULL, NULL)) { + strcpy(file_name, pszFile); + obj_file = FALSE; + } else if (FileNameHasExtension(pszFile, PIN_FILE_TYPE, NULL, NULL)) { + strcpy(file_name, pszFile); + obj_file = FALSE; + } else { + sprintf(file_name, "%s.%s", pszFile, OBJ_FILE_EXT); + } + if (*gzipped_fname == '\0') { + if ((short_name=IsPrefix(bootDir, file_name, &rest))) ++rest; + } else { + if ((short_name=IsPrefix(bootDir, gzipped_fname, &rest))) ++rest; + } + } + if (*file_name != '\0' && (fp=fopen(file_name, "r")) == NULL) { + DelAllPages(); + lastPageNum = 1; + InitPage(); + + sprintf(gszMsgBox, TgLoadString(STID_CANNOT_OPEN_FILE_FOR_READING), + (short_name ? rest : file_name)); + Msg(gszMsgBox); + + if (*file_name == DIR_SEP) { + strcpy(full_name, file_name); + } else { + sprintf(full_name, "%s%c%s", curDir, DIR_SEP, file_name); + } + if (obj_file) { + SetCurDir(full_name); + *curSymDir = '\0'; + } else { + SetCurSymDir(full_name); + } + curFileDefined = TRUE; + + SetFileModified(FALSE); + sprintf(gszMsgBox, TgLoadString(STID_CUR_EMPTY_FILE_IS), + (short_name ? rest : file_name)); + Msg(gszMsgBox); + } else if (file_is_remote || *file_name != '\0') { + int read_status; + + SetFileModified(FALSE); + SaveStatusStrings(); + if (file_is_remote) { + sprintf(gszMsgBox, TgLoadCachedString(CSTID_LOADING_FILE), + remote_fname); + } else { + if (short_name) { + sprintf(gszMsgBox, TgLoadCachedString(CSTID_LOADING_FILE), rest); + } else { + if (*gzipped_fname == '\0') { + sprintf(gszMsgBox, TgLoadCachedString(CSTID_LOADING_FILE), + file_name); + } else { + sprintf(gszMsgBox, TgLoadCachedString(CSTID_LOADING_FILE), + gzipped_fname); + } + } + if (*gzipped_fname == '\0') { + if (*file_name == DIR_SEP) { + strcpy(full_name, file_name); + } else { + sprintf(full_name, "%s%c%s", curDir, DIR_SEP, file_name); + } + } else { + if (*gzipped_fname == DIR_SEP) { + strcpy(full_name, gzipped_fname); + } else { + sprintf(full_name, "%s%c%s", curDir, DIR_SEP, + gzipped_fname); + } + } + } + SetStringStatus(gszMsgBox); + + strcpy(tmp_filefullpath, scanFileFullPath); + strcpy(tmp_filename, scanFileName); + tmp_linenum = scanLineNum; + UtilStrCpyN(scanFileFullPath, sizeof(scanFileFullPath), + (file_is_remote ? remote_fname : full_name)); + if (file_is_remote) { + strcpy(scanFileName, tmp_remote_fname); + } else { + strcpy(scanFileName, (short_name ? rest : file_name)); + } + scanLineNum = 0; + + SetWatchCursor(drawWindow); + SetWatchCursor(mainWindow); + + readingPageNum = loadedCurPageNum = 0; + foundGoodStateObject = FALSE; + while ((read_status=ReadObj(fp, &obj_ptr)) == TRUE) { + if (obj_ptr != NULL) { + AdjForOldVersion(obj_ptr); + AddObj(NULL, topObj, obj_ptr); + } + } + strcpy(scanFileFullPath, tmp_filefullpath); + strcpy(scanFileName, tmp_filename); + scanLineNum = tmp_linenum; + + fclose(fp); + + if (!mergingFile && loadedCurPageNum <= 0) { + DelAllPages(); + loadedCurPageNum = curPageNum = lastPageNum = 1; + InitPage(); + } + if (read_status == INVALID) { + sprintf(gszMsgBox, TgLoadString(STID_FILE_VER_ABORT_OPEN), + fileVersion, TOOL_NAME, homePageURL); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + } else { + if (loadedCurPageNum > 0 && curPage != NULL) { + GotoPageNum(loadedCurPageNum); + } + CheckFileAttrsInLoad(); + + curFileDefined = TRUE; + if (file_is_remote) { + SetCurDir(remote_fname); + if (!foundGoodStateObject) PasteString(remote_buf); + } else { + if (*gzipped_fname == '\0') { + if (*file_name == DIR_SEP) { + strcpy(full_name, file_name); + } else { + sprintf(full_name, "%s%c%s", curDir, DIR_SEP, file_name); + } + } else { + if (*gzipped_fname == DIR_SEP) { + strcpy(full_name, gzipped_fname); + } else { + sprintf(full_name, "%s%c%s", curDir, DIR_SEP, + gzipped_fname); + } + } + if (obj_file) { + SetCurDir(full_name); + *curSymDir = '\0'; + } else { + SetCurSymDir(full_name); + } + } + if (file_is_remote) { + sprintf(gszMsgBox, TgLoadCachedString(CSTID_CUR_FILE_IS), + remote_fname); + } else if (short_name) { + sprintf(gszMsgBox, TgLoadCachedString(CSTID_CUR_FILE_IS), rest); + } else { + sprintf(gszMsgBox, TgLoadCachedString(CSTID_CUR_FILE_IS), + (*gzipped_fname == '\0' ? file_name : gzipped_fname)); + } + Msg(gszMsgBox); + } + RestoreStatusStrings(); + + GotoPageNum(loadedCurPageNum); + SetDefaultCursor(mainWindow); + SetDefaultCursor(drawWindow); + + if (file_is_remote) { + unlink(tmp_remote_fname); + if (tmp_remote_fname != NULL) FreeRemoteBuf(tmp_remote_fname); + if (remote_buf != NULL) FreeRemoteBuf(remote_buf); + remote_buf = tmp_remote_fname = NULL; + if (!nAttemptToMerge && !mergingFile) CommitNavigate(); + } else { + if (*gzipped_fname != '\0') { + unlink(file_name); + } + } + if (foundGoodStateObject && !nAttemptToMerge && !mergingFile) { + struct AttrRec *exec_attr=FindFileAttrWithName("auto_exec="); + + if (!nAttemptToMerge && !mergingFile) CommitNavigate(); + if (exec_attr != NULL) { + XSync(mainDisplay, False); + if (pnNeedToCheckAutoExec != NULL) *pnNeedToCheckAutoExec = TRUE; + } + } + } + if (page_spec != NULL) { + int new_page_num=(-1); + + if (!GetPageNumFromPageSpec(page_spec, &new_page_num)) { + sprintf(gszMsgBox, TgLoadString(STID_INVALID_PAGE_SPECIFIED_FOR), + pszFile); + Msg(gszMsgBox); + } else if (new_page_num != curPageNum) { + GotoPageNum(new_page_num); + } + } + if (page_spec != NULL) free(page_spec); + + if (pageLayoutMode == PAGE_TILE && nAttemptToMerge && pnAbortMerge != NULL) { + if (file_is_remote) { + sprintf(gszMsgBox, TgLoadString(STID_CANNOT_MERGE_WITH_TILED_PAGE), + remote_fname); + } else if (short_name) { + sprintf(gszMsgBox, TgLoadString(STID_CANNOT_MERGE_WITH_TILED_PAGE), + rest); + } else { + sprintf(gszMsgBox, TgLoadString(STID_CANNOT_MERGE_WITH_TILED_PAGE), + (*gzipped_fname == '\0' ? file_name : gzipped_fname)); + } + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + *pnAbortMerge = TRUE; + } + return TRUE; + } + + int JustInit(pszFile, pnNeedToCheckAutoExec) + char *pszFile; + int *pnNeedToCheckAutoExec; + { + char *c_ptr=NULL; #ifdef USE_XAPPLRESDIR FILE *xenv_fp=NULL; *************** *** 678,683 **** int len=0; #endif /* USE_XAPPLRESDIR */ - struct ObjRec *obj_ptr=NULL; - FILE *fp=NULL; #ifdef USE_XAPPLRESDIR --- 1015,1018 ---- *************** *** 777,782 **** prTgifFoundColorInfo = FALSE; - *remote_fname = *gzipped_fname = '\0'; - if (pszFile == NULL) { DelAllPages(); --- 1112,1115 ---- *************** *** 787,1072 **** initializingMain = TRUE; ! if (*pszFile != '\0' && FileIsRemote(pszFile)) { ! if (!FormNewFileName(curDir, pszFile, NULL, remote_fname, &page_spec)) { ! sprintf(gszMsgBox, TgLoadString(STID_INVALID_REMOTE_FNAME), pszFile); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! *pszFile = '\0'; ! } else { ! char *content_type=NULL; ! char final_url[MAXPATHLENGTH+1]; ! *final_url = '\0'; ! SaveStatusStrings(); ! rc = LoadRemoteFileInMem(remote_fname, &remote_buf, ! &content_type, &remote_buf_sz, &is_html, TRUE, ! final_url, sizeof(final_url)); ! RestoreStatusStrings(); ! if (rc && remote_buf != NULL && ! (tmp_remote_fname=WriteRemoteFileIntoTemp(remote_buf, ! remote_buf_sz, NULL)) != NULL) { ! if (*final_url != '\0') { ! UtilStrCpyN(pszFile, MAXPATHLENGTH+1, final_url); ! UtilStrCpyN(remote_fname, MAXPATHLENGTH+1, final_url); ! } ! if (FileNameHasExtension(remote_fname, OBJ_FILE_TYPE, ! &gzipped_obj_file, NULL)) { ! file_is_remote = TRUE; ! } else if (UseExternalViewer(is_html, remote_fname, content_type, ! tmp_remote_fname) != FALSE) { ! unlink(tmp_remote_fname); ! FreeRemoteBuf(tmp_remote_fname); ! if (remote_buf != NULL) FreeRemoteBuf(remote_buf); ! remote_buf = tmp_remote_fname = NULL; ! file_is_remote = FALSE; ! *pszFile = '\0'; ! } else { ! file_is_remote = TRUE; ! } ! } else { ! if (remote_buf != NULL) FreeRemoteBuf(remote_buf); ! remote_buf = NULL; ! *pszFile = '\0'; ! } ! if (content_type != NULL) FreeRemoteBuf(content_type); ! } ! } ! if (*pszFile != '\0') { ! int short_name=FALSE, obj_file=TRUE; ! *file_name = '\0'; ! if (file_is_remote) { ! if ((fp=fopen(tmp_remote_fname, "r")) == NULL) { ! sprintf(gszMsgBox, TgLoadString(STID_CANNOT_READ_TMP_FILE), ! tmp_remote_fname); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! unlink(tmp_remote_fname); ! FreeRemoteBuf(tmp_remote_fname); ! FreeRemoteBuf(remote_buf); ! remote_buf = tmp_remote_fname = NULL; ! file_is_remote = FALSE; ! } else { ! if (FileNameHasExtension(remote_fname, SYM_FILE_TYPE, NULL, NULL)) { ! obj_file = FALSE; ! } else if (FileNameHasExtension(remote_fname, PIN_FILE_TYPE, ! NULL, NULL)) { ! obj_file = FALSE; ! } else { ! obj_file = TRUE; ! } ! } ! } else { ! if (FileNameHasExtension(pszFile, OBJ_FILE_TYPE, &gzipped_obj_file, ! NULL)) { ! if (gzipped_obj_file) { ! char *tmp_fname=NULL; ! if ((tmp_fname=GunzipFileIntoTemp(pszFile)) == NULL) { ! *file_name = '\0'; ! } else { ! strcpy(gzipped_fname, pszFile); ! strcpy(file_name, tmp_fname); ! free(tmp_fname); ! } ! } else { ! strcpy(file_name, pszFile); ! } ! } else if (FileNameHasExtension(pszFile, SYM_FILE_TYPE, NULL, NULL)) { ! strcpy(file_name, pszFile); ! obj_file = FALSE; ! } else if (FileNameHasExtension(pszFile, PIN_FILE_TYPE, NULL, NULL)) { ! strcpy(file_name, pszFile); ! obj_file = FALSE; ! } else { ! sprintf(file_name, "%s.%s", pszFile, OBJ_FILE_EXT); ! } ! if (*gzipped_fname == '\0') { ! if ((short_name=IsPrefix(bootDir, file_name, &rest))) ++rest; ! } else { ! if ((short_name=IsPrefix(bootDir, gzipped_fname, &rest))) ++rest; ! } ! } ! if (*file_name != '\0' && (fp=fopen(file_name, "r")) == NULL) { ! DelAllPages(); ! lastPageNum = 1; ! InitPage(); ! ! sprintf(gszMsgBox, TgLoadString(STID_CANNOT_OPEN_FILE_FOR_READING), ! (short_name ? rest : file_name)); ! Msg(gszMsgBox); ! ! if (*file_name == DIR_SEP) { ! strcpy(full_name, file_name); ! } else { ! sprintf(full_name, "%s%c%s", curDir, DIR_SEP, file_name); ! } ! if (obj_file) { ! SetCurDir(full_name); ! *curSymDir = '\0'; ! } else { ! SetCurSymDir(full_name); ! } ! curFileDefined = TRUE; ! ! SetFileModified(FALSE); ! sprintf(gszMsgBox, TgLoadString(STID_CUR_EMPTY_FILE_IS), ! (short_name ? rest : file_name)); ! Msg(gszMsgBox); ! } else if (file_is_remote || *file_name != '\0') { ! int read_status; ! ! SetFileModified(FALSE); ! SaveStatusStrings(); ! if (file_is_remote) { ! sprintf(gszMsgBox, TgLoadCachedString(CSTID_LOADING_FILE), ! remote_fname); ! } else { ! if (short_name) { ! sprintf(gszMsgBox, TgLoadCachedString(CSTID_LOADING_FILE), rest); ! } else { ! if (*gzipped_fname == '\0') { ! sprintf(gszMsgBox, TgLoadCachedString(CSTID_LOADING_FILE), ! file_name); ! } else { ! sprintf(gszMsgBox, TgLoadCachedString(CSTID_LOADING_FILE), ! gzipped_fname); ! } ! } ! if (*gzipped_fname == '\0') { ! if (*file_name == DIR_SEP) { ! strcpy(full_name, file_name); ! } else { ! sprintf(full_name, "%s%c%s", curDir, DIR_SEP, file_name); ! } ! } else { ! if (*gzipped_fname == DIR_SEP) { ! strcpy(full_name, gzipped_fname); ! } else { ! sprintf(full_name, "%s%c%s", curDir, DIR_SEP, ! gzipped_fname); ! } ! } ! } ! SetStringStatus(gszMsgBox); ! ! strcpy(tmp_filefullpath, scanFileFullPath); ! strcpy(tmp_filename, scanFileName); ! tmp_linenum = scanLineNum; ! UtilStrCpyN(scanFileFullPath, sizeof(scanFileFullPath), ! (file_is_remote ? remote_fname : full_name)); ! if (file_is_remote) { ! strcpy(scanFileName, tmp_remote_fname); ! } else { ! strcpy(scanFileName, (short_name ? rest : file_name)); ! } ! scanLineNum = 0; ! ! SetWatchCursor(drawWindow); ! SetWatchCursor(mainWindow); ! ! readingPageNum = loadedCurPageNum = 0; ! foundGoodStateObject = FALSE; ! while ((read_status=ReadObj(fp, &obj_ptr)) == TRUE) { ! if (obj_ptr != NULL) { ! AdjForOldVersion(obj_ptr); ! AddObj(NULL, topObj, obj_ptr); ! } ! } ! strcpy(scanFileFullPath, tmp_filefullpath); ! strcpy(scanFileName, tmp_filename); ! scanLineNum = tmp_linenum; ! ! fclose(fp); ! ! if (loadedCurPageNum <= 0) { DelAllPages(); ! loadedCurPageNum = curPageNum = lastPageNum = 1; InitPage(); - } - if (read_status == INVALID) { - sprintf(gszMsgBox, TgLoadString(STID_FILE_VER_ABORT_OPEN), - fileVersion, TOOL_NAME, homePageURL); - MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); - } else { - if (loadedCurPageNum > 0 && curPage != NULL) { - GotoPageNum(loadedCurPageNum); - } - CheckFileAttrsInLoad(); ! curFileDefined = TRUE; ! if (file_is_remote) { ! SetCurDir(remote_fname); ! if (!foundGoodStateObject) PasteString(remote_buf); ! } else { ! if (*gzipped_fname == '\0') { ! if (*file_name == DIR_SEP) { ! strcpy(full_name, file_name); ! } else { ! sprintf(full_name, "%s%c%s", curDir, DIR_SEP, file_name); ! } ! } else { ! if (*gzipped_fname == DIR_SEP) { ! strcpy(full_name, gzipped_fname); ! } else { ! sprintf(full_name, "%s%c%s", curDir, DIR_SEP, ! gzipped_fname); ! } } ! if (obj_file) { ! SetCurDir(full_name); ! *curSymDir = '\0'; } else { ! SetCurSymDir(full_name); } ! } ! if (file_is_remote) { ! sprintf(gszMsgBox, TgLoadCachedString(CSTID_CUR_FILE_IS), ! remote_fname); ! } else if (short_name) { ! sprintf(gszMsgBox, TgLoadCachedString(CSTID_CUR_FILE_IS), rest); ! } else { ! sprintf(gszMsgBox, TgLoadCachedString(CSTID_CUR_FILE_IS), ! (*gzipped_fname == '\0' ? file_name : gzipped_fname)); ! } ! Msg(gszMsgBox); ! } ! RestoreStatusStrings(); ! GotoPageNum(loadedCurPageNum); ! SetDefaultCursor(mainWindow); ! SetDefaultCursor(drawWindow); ! if (file_is_remote) { ! unlink(tmp_remote_fname); ! if (tmp_remote_fname != NULL) FreeRemoteBuf(tmp_remote_fname); ! if (remote_buf != NULL) FreeRemoteBuf(remote_buf); ! remote_buf = tmp_remote_fname = NULL; ! CommitNavigate(); ! } else { ! if (*gzipped_fname != '\0') { ! unlink(file_name); } ! } ! if (foundGoodStateObject) { ! struct AttrRec *exec_attr=FindFileAttrWithName("auto_exec="); ! CommitNavigate(); ! if (exec_attr != NULL) { ! XSync(mainDisplay, False); ! if (pnNeedToCheckAutoExec != NULL) *pnNeedToCheckAutoExec = TRUE; ! } } } ! if (page_spec != NULL) { ! int new_page_num=(-1); ! ! if (!GetPageNumFromPageSpec(page_spec, &new_page_num)) { ! sprintf(gszMsgBox, TgLoadString(STID_INVALID_PAGE_SPECIFIED_FOR), ! pszFile); ! Msg(gszMsgBox); ! } else if (new_page_num != curPageNum) { ! GotoPageNum(new_page_num); ! } ! } } else { DelAllPages(); --- 1120,1182 ---- initializingMain = TRUE; ! if (cmdLineMerge && cmdLineMergeArgc > 0 && cmdLineMergeArgv != NULL) { ! int arg_index=0, abort_merge=FALSE; ! if (JustLoadAFile(cmdLineMergeArgv[0], NULL, TRUE, &abort_merge)) { ! if (!abort_merge) { ! PageInfo pi; ! memset(&pi, 0, sizeof(PageInfo)); ! GetPageInfo(&pi); ! CleanUpComments(); ! firstPage = lastPage = curPage = NULL; ! topObj = botObj = NULL; DelAllPages(); ! lastPageNum = 1; InitPage(); ! mergingFile = TRUE; ! for (arg_index=1; arg_index < cmdLineMergeArgc; arg_index++) { ! if (!JustLoadAFile(cmdLineMergeArgv[arg_index], NULL, FALSE, ! NULL)) { ! break; } ! CleanUpComments(); ! ! firstPage->prev = pi.last_page; ! if (pi.last_page == NULL) { ! pi.first_page = firstPage; } else { ! pi.last_page->next = firstPage; } ! pi.last_page = lastPage; ! pi.last_page_num += lastPageNum; ! firstPage = lastPage = curPage = NULL; ! topObj = botObj = NULL; ! DelAllPages(); ! lastPageNum = 1; ! InitPage(); } ! mergingFile = FALSE; ! DelAllPages(); ! curPageNum = pi.cur_page_num; ! lastPageNum = pi.last_page_num; ! firstPage = pi.first_page; ! lastPage = pi.last_page; ! curPage = pi.cur_page; ! topObj = curPage->top; ! botObj = curPage->bot; } } ! CleanUpMergeArgs(); ! ClearFileInfo(FALSE); ! SetFileModified(TRUE); ! } else if (*pszFile != '\0') { ! JustLoadAFile(pszFile, pnNeedToCheckAutoExec, FALSE, NULL); } else { DelAllPages(); *************** *** 1076,1080 **** SetDefaultDrawWinClipRecs(); UpdateDirInfo(); - if (page_spec != NULL) free(page_spec); initializingMain = FALSE; --- 1186,1189 ---- *************** *** 1422,1425 **** --- 1531,1539 ---- gettingHttpHeaderOnly = TRUE; } + if (cmdLineParseHtml) { + cmdLineDumpURL = FALSE; + debugHttp = saved_http_debug; + InitHtml(); + } DownloadRemoteFile(pszUrl, &content_type, &page_spec, &is_html, tmp_fname, NULL, 0); *** markup.c.orig Tue Nov 2 13:57:00 1999 --- markup.c Tue Nov 2 13:57:00 1999 *************** *** 36,44 **** --- 36,50 ---- #include "tgifdefs.h" + #include "file.e" #include "http.e" #include "markup.e" #include "msg.e" + #include "setup.e" #include "util.e" + int cmdLineParseHtml=FALSE; + + static int parseHtml=FALSE; + /* ===================== Parse Routines ===================== */ *************** *** 48,51 **** --- 54,58 ---- char *psz_start; { + int last_ch_is_lf=FALSE; char *psz=NULL; *************** *** 55,63 **** case '\r': if (psz[1] == '\n') { - printf("\n"); psz++; } break; ! default: fputc(*psz, stdout); } } --- 62,78 ---- case '\r': if (psz[1] == '\n') { psz++; } + printf("\n"); + last_ch_is_lf = TRUE; break; ! case '\n': ! printf("\n"); ! last_ch_is_lf = TRUE; ! break; ! default: ! fputc(*psz, stdout); ! last_ch_is_lf = FALSE; ! break; } } *************** *** 67,78 **** case '\r': if (psz[1] == '\n') { - printf("\n"); psz++; } break; ! default: fputc(*psz, stdout); } } } return TRUE; } --- 82,104 ---- case '\r': if (psz[1] == '\n') { psz++; } + printf("\n"); + last_ch_is_lf = TRUE; break; ! case '\n': ! printf("\n"); ! last_ch_is_lf = TRUE; ! break; ! default: ! fputc(*psz, stdout); ! last_ch_is_lf = FALSE; ! break; } } } + if (!last_ch_is_lf) { + printf("\n"); + } return TRUE; } *************** *** 110,113 **** --- 136,142 ---- DumpHtmlBuf(in_tag, psz_start); } + printf("\n"); + fflush(stdout); + return TRUE; } *************** *** 117,121 **** int buf_sz, *pn_html; { ! if (debugHttp == 9) { if (*pn_html || *buf == '>') { if (!DoParseMarkUpFile(buf)) { --- 146,150 ---- int buf_sz, *pn_html; { ! if (parseHtml) { if (*pn_html || *buf == '>') { if (!DoParseMarkUpFile(buf)) { *************** *** 134,137 **** --- 163,178 ---- int InitHtml() { + parseHtml = FALSE; + if (!PRTGIF || cmdLineOpenDisplay) { + char *c_ptr=FALSE; + + if ((c_ptr=XGetDefault(mainDisplay, TOOL_NAME, "ParseHtml")) != + NULL && UtilStrICmp(c_ptr, "true") == 0) { + parseHtml = TRUE; + } + } + if (PRTGIF && cmdLineParseHtml) { + parseHtml = TRUE; + } return TRUE; } *** menuinfo.c.orig Tue Nov 2 13:57:01 1999 --- menuinfo.c Tue Nov 2 13:57:01 1999 *************** *** 281,285 **** { N_("Print One Page"), NULL, "Print the curret page", NULL, CMDID_PRINTONEPAGE }, ! { N_("Print One File Per Page"), NULL, "Print into a separate file for each page", NULL, CMDID_PRINTONEFILEPERPAGE }, --- 281,287 ---- { N_("Print One Page"), NULL, "Print the curret page", NULL, CMDID_PRINTONEPAGE }, ! { N_("Print Pages..."), NULL, "Print user-specified pages", NULL, ! CMDID_PRINTPAGES }, ! { N_("Print One File Per Page..."), NULL, "Print into a separate file for each page", NULL, CMDID_PRINTONEFILEPERPAGE }, *************** *** 453,456 **** --- 455,487 ---- TgCreateMenuFromMenuInfo }; + static TgMenuItemInfo browseMenuItemInfo[] = { + { N_("Browse X Bitmap"), NULL, "Recursively read in all X11 bitmap files", + NULL, CMDID_BROWSEXBITMAP }, + { N_("Browse X Pixmap"), NULL, "Recursively read in all X11 pixmap files", + NULL, CMDID_BROWSEXPIXMAP }, + { N_("Browse Other..."), NULL, + "Recursively read in all another type of files", NULL, CMDID_BROWSEOTHER }, + { NULL, NULL, NULL, NULL, INVALID } + }; + static TgMenuInfo browseMenuInfo={ TGMUTYPE_TEXT, browseMenuItemInfo, + TgCreateMenuFromMenuInfo }; + + static TgMenuItemInfo captureMenuItemInfo[] = { + { N_("Screen Capture"), NULL, "Capture a rectangular area of the screen", + NULL, CMDID_SCREENCAPTURE }, + { N_("Full Screen Capture"), NULL, "Capture the whole screen", NULL, + CMDID_FULLSCREENCAPTURE }, + { N_("Delayed Full Screen Capture..."), NULL, + "Capture the whole screen after a specified delay", NULL, + CMDID_DELAYEDFULLSCREENCAPTURE }, + { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, + { N_("Hide During Capture"), NULL, + "Toggle between hiding and showing tgif during capture", NULL, + CMDID_TOGGLEHIDEDURINGCAPTURE }, + { NULL, NULL, NULL, NULL, INVALID } + }; + static TgMenuInfo captureMenuInfo={ TGMUTYPE_TEXT, captureMenuItemInfo, + CreateScreenCaptureMenu }; + static TgMenuItemInfo importMenuItemInfo[] = { { N_("Import..."), "Alt+p", "Embed/Import another drawing", NULL, *************** *** 471,474 **** --- 502,510 ---- { N_("Embed EPS File..."), NULL, "Embed/Import an PS/EPS file", NULL, CMDID_EMBEDEPSFILE }, + { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, + { N_("Browse"), TGMUITEM_SUBMENU, + "Browse submenu >>>", &browseMenuInfo, INVALID }, + { N_("Screen Capture"), TGMUITEM_SUBMENU, + "Screen Capture submenu >>>", &captureMenuInfo, INVALID }, { NULL, NULL, NULL, NULL, INVALID } }; *************** *** 476,491 **** TgCreateMenuFromMenuInfo }; - static TgMenuItemInfo browseMenuItemInfo[] = { - { N_("Browse X Bitmap"), NULL, "Recursively read in all X11 bitmap files", - NULL, CMDID_BROWSEXBITMAP }, - { N_("Browse X Pixmap"), NULL, "Recursively read in all X11 pixmap files", - NULL, CMDID_BROWSEXPIXMAP }, - { N_("Browse Other..."), NULL, - "Recursively read in all another type of files", NULL, CMDID_BROWSEOTHER }, - { NULL, NULL, NULL, NULL, INVALID } - }; - static TgMenuInfo browseMenuInfo={ TGMUTYPE_TEXT, browseMenuItemInfo, - TgCreateMenuFromMenuInfo }; - static TgMenuItemInfo domainMenuItemInfo[] = { { N_("Change Domain..."), "Alt+*", "Change to a different domain", NULL, --- 512,515 ---- *************** *** 524,544 **** TgCreateMenuFromMenuInfo }; - static TgMenuItemInfo captureMenuItemInfo[] = { - { N_("Screen Capture"), NULL, "Capture a rectangular area of the screen", - NULL, CMDID_SCREENCAPTURE }, - { N_("Full Screen Capture"), NULL, "Capture the whole screen", NULL, - CMDID_FULLSCREENCAPTURE }, - { N_("Delayed Full Screen Capture..."), NULL, - "Capture the whole screen after a specified delay", NULL, - CMDID_DELAYEDFULLSCREENCAPTURE }, - { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, - { N_("Hide During Capture"), NULL, - "Toggle between hiding and showing tgif during capture", NULL, - CMDID_TOGGLEHIDEDURINGCAPTURE }, - { NULL, NULL, NULL, NULL, INVALID } - }; - static TgMenuInfo captureMenuInfo={ TGMUTYPE_TEXT, captureMenuItemInfo, - CreateScreenCaptureMenu }; - #ifdef _TGIF_DBG static TgMenuItemInfo mimeMenuItemInfo[] = { --- 548,551 ---- *************** *** 563,568 **** { N_("Import"), TGMUITEM_SUBMENU, "Import submenu >>>", &importMenuInfo, INVALID }, - { N_("Browse"), TGMUITEM_SUBMENU, - "Browse submenu >>>", &browseMenuInfo, INVALID }, { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, { N_("Save"), "Cntrl+s", "Save current drawing", NULL, CMDID_SAVE }, --- 570,573 ---- *************** *** 571,581 **** { N_("Save Selected As..."), "Alt+~", "Save selected objects in a different file", NULL, CMDID_SAVESELECTEDAS }, - { N_("Save Sym In Library..."), NULL, - "Save symbol file in a library path within the current domain", NULL, - CMDID_SAVESYMINLIBRARY }, { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, - { N_("Domain"), TGMUITEM_SUBMENU, - "Domain submenu >>>", &domainMenuInfo, INVALID }, - { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, { N_("Print"), "Cntrl+p", "Print/export current drawing", NULL, CMDID_PRINT }, --- 576,580 ---- *************** *** 595,599 **** { N_("Print One Page"), NULL, "Print a page in a multipage drawing", NULL, CMDID_PRINTONEPAGE }, ! { N_("Print One File Per Page"), NULL, "Print into a separate file for each page", NULL, CMDID_PRINTONEFILEPERPAGE }, --- 594,600 ---- { N_("Print One Page"), NULL, "Print a page in a multipage drawing", NULL, CMDID_PRINTONEPAGE }, ! { N_("Print Pages..."), NULL, "Print user-specified pages", NULL, ! CMDID_PRINTPAGES }, ! { N_("Print One File Per Page..."), NULL, "Print into a separate file for each page", NULL, CMDID_PRINTONEFILEPERPAGE }, *************** *** 601,606 **** { N_("GIF Animation"), TGMUITEM_SUBMENU, "GIFAnimation submenu >>>", &gifAnimateMenuInfo, INVALID }, - { N_("Screen Capture"), TGMUITEM_SUBMENU, - "Screen Capture submenu >>>", &captureMenuInfo, INVALID }, #ifdef _TGIF_DBG { N_("Mime"), TGMUITEM_SUBMENU, "Mime submenu >>>", --- 602,605 ---- *************** *** 619,624 **** CMDID_SETTEMPLATE }, { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, - { N_("Return"), TGMUITEM_SUBMENU, - N_("Return submenu >>>"), &driverMenuInfo, INVALID }, { N_("Quit"), "Cntrl+q", "Exit <>", NULL, CMDID_QUIT }, { NULL, NULL, NULL, NULL, INVALID } --- 618,621 ---- *************** *** 690,693 **** --- 687,694 ---- { N_("Cut Poly"), NULL, "Cut a poly/polygon at a vertex into two pieces", NULL, CMDID_CUTPOLY }, + { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, + { N_("Make Regular Polygon..."), "Alt+\"", + "Make a selected polygon/closed spline into a regular one", NULL, + CMDID_MAKEREGPOLYGON }, { NULL, NULL, NULL, NULL, INVALID } }; *************** *** 750,756 **** { N_("Specify An Arc..."), "Alt+9", "Create and specify an arc", NULL, CMDID_SPECIFYANARC }, - { N_("Make Regular Polygon..."), "Alt+\"", - "Make a selected polygon/closed spline into a regular one", NULL, - CMDID_MAKEREGPOLYGON }, { N_("Get Bounding Box"), NULL, "Get rectangular bounding boxes of selected objects", NULL, --- 751,754 ---- *************** *** 1291,1297 **** --- 1289,1302 ---- "Refresh selected icon objects from their definition files", NULL, CMDID_UPDATESYMBOLS }, + { N_("Save Sym In Library..."), NULL, + "Save symbol file in a library path within the current domain", NULL, + CMDID_SAVESYMINLIBRARY }, { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, + { N_("Domain"), TGMUITEM_SUBMENU, + "Domain submenu >>>", &domainMenuInfo, INVALID }, { N_("Misc"), TGMUITEM_SUBMENU, "Misc submenu >>>", &animateMenuInfo, INVALID }, + { N_("Return"), TGMUITEM_SUBMENU, + N_("Return submenu >>>"), &driverMenuInfo, INVALID }, { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, { N_("Merge With Table..."), NULL, *** msg.c.orig Tue Nov 2 13:57:02 1999 --- msg.c Tue Nov 2 13:57:02 1999 *************** *** 47,50 **** --- 47,51 ---- #include "inmethod.e" #include "mainloop.e" + #include "markup.e" #include "menu.e" #include "msg.e" *************** *** 1375,1379 **** fprintf(stderr, "\t[-exec ] \\\n"); fprintf(stderr, "\t[-dbim {xcin|chinput|xim|kinput2}] \\\n"); ! fprintf(stderr, "\t[[.%s]]\n", OBJ_FILE_EXT); fprintf(stderr, "or:\n"); fprintf(stderr, "\t%s -print \\\n", tool_name); --- 1376,1381 ---- fprintf(stderr, "\t[-exec ] \\\n"); fprintf(stderr, "\t[-dbim {xcin|chinput|xim|kinput2}] \\\n"); ! fprintf(stderr, "\t[{[.%s] | -merge [.%s] [.%s] ...}]\n", ! OBJ_FILE_EXT, OBJ_FILE_EXT, OBJ_FILE_EXT); fprintf(stderr, "or:\n"); fprintf(stderr, "\t%s -print \\\n", tool_name); *************** *** 1427,1430 **** --- 1429,1434 ---- } else if (strcmp(*argv, "-stdout") == 0) { show_copyright = FALSE; + } else if (strcmp(*argv, "-parse_html") == 0) { + show_copyright = FALSE; } } *************** *** 1663,1666 **** --- 1667,1676 ---- UtilRemoveQuotes(cmdLineProducedBy); } + } else if (strcmp(*argv, "-parse_html") == 0) { + cmdLineParseHtml = TRUE; + /* cmdLineDumpURL will be reset in UrlDump() */ + cmdLineDumpURL = TRUE; + cmdLineDumpURLWithHeader = FALSE; + cmdLineDumpURLHeaderOnly = FALSE; } else if (strcmp(*argv, "-tgif_path") == 0) { argc--; argv++; *************** *** 1727,1731 **** /* Prolog's foreign function interface. */ { ! register int i; *file_name = '\0'; --- 1737,1741 ---- /* Prolog's foreign function interface. */ { ! int i=0; *file_name = '\0'; *************** *** 1732,1735 **** --- 1742,1746 ---- *cmdLineTmpFileModeStr = '\0'; *cmdLineFileToExec = '\0'; + cmdLineMergeArgv = NULL; for (i=1; i < argc; i++) { if (strcmp(argv[i], "-display") == 0) { *************** *** 1777,1780 **** --- 1788,1793 ---- strcpy(cmdLineInputMethod, argv[i]); cmdLineHasInputMethod = TRUE; + } else if (strcmp(argv[i], "-merge") == 0) { + cmdLineMerge = TRUE; } else if (strcmp(argv[i], "-a4") == 0) { cmdLineA4 = TRUE; *************** *** 1830,1834 **** geometrySpecified = TRUE; } else if (*argv[i] != '-') { ! UtilStrCpyN(file_name, name_sz, argv[i]); } else { Usage(progName); --- 1843,1863 ---- geometrySpecified = TRUE; } else if (*argv[i] != '-') { ! if (cmdLineMerge) { ! int j=0; ! ! cmdLineMergeArgc = argc-i; ! cmdLineMergeArgv = (char**)malloc(cmdLineMergeArgc*sizeof(char*)); ! if (cmdLineMergeArgv == NULL) FailAllocMessage(); ! for (j=i; j < argc; j++) { ! if (*argv[j] == '-') { ! Usage(progName); ! } ! cmdLineMergeArgv[j-i] = UtilStrDup(argv[j]); ! if (cmdLineMergeArgv[j-i] == NULL) FailAllocMessage(); ! } ! break; ! } else { ! UtilStrCpyN(file_name, name_sz, argv[i]); ! } } else { Usage(progName); *** page.c.orig Tue Nov 2 13:57:04 1999 --- page.c Tue Nov 2 13:57:04 1999 *************** *** 1256,1263 **** } void DeletePages() { ! char spec[MAXSTRING+1], *dup_spec, *c_ptr; ! int i, *mark_to_delete, ok=TRUE, num_to_delete=0; if (pageLayoutMode == PAGE_TILE) { --- 1256,1350 ---- } + void FreePageSpec(pspi) + SpecifyPagesInfo *pspi; + { + if (pspi->page_specified != NULL) free(pspi->page_specified); + } + + int ParsePagesSpec(spec, pspi) + char *spec; + SpecifyPagesInfo *pspi; + /* if return TRUE, must call FreePageSpec(pspi) */ + { + char *dup_spec=NULL, *c_ptr=NULL; + int i, ok=TRUE; + + UtilTrimBlanks(spec); + if (*spec == '\0') return FALSE; + if ((pspi->page_specified=(int*)malloc(lastPageNum*sizeof(int))) == NULL) { + FailAllocMessage(); + return FALSE; + } + if ((dup_spec=UtilStrDup(spec)) == NULL) { + free(pspi->page_specified); + FailAllocMessage(); + return FALSE; + } + if (strcmp(dup_spec, "*") == 0) { + for (i=0; i < lastPageNum; i++) pspi->page_specified[i] = TRUE; + } else { + for (i=0; i < lastPageNum; i++) pspi->page_specified[i] = FALSE; + if (*dup_spec == '*') *dup_spec = ' '; + for (c_ptr=strtok(dup_spec, " ,\t"); ok && c_ptr != NULL; + c_ptr=strtok(NULL, " ,\t")) { + char *dash_ptr=strchr(c_ptr, '-'); + + if (dash_ptr == NULL) { + int page_num=atoi(c_ptr); + + if (page_num > 0 && page_num <= lastPageNum) { + if (!pspi->page_specified[page_num-1]) { + pspi->num_pages_specified++; + } + pspi->page_specified[page_num-1] = TRUE; + } else { + sprintf(gszMsgBox, + TgLoadString(STID_GIVEN_PAGE_NUM_IS_OUT_OF_RNG), page_num); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + ok = FALSE; + } + } else { + int start_page_num, end_page_num; + + *dash_ptr = '\0'; + start_page_num = atoi(c_ptr); + end_page_num = atoi(&dash_ptr[1]); + *dash_ptr = '-'; + if (start_page_num <= 0 || start_page_num > lastPageNum) { + sprintf(gszMsgBox, + TgLoadString(STID_GIVEN_PAGE_NUM_IS_OUT_OF_RNG), + start_page_num); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + ok = FALSE; + } else if (end_page_num <= 0 || end_page_num > lastPageNum) { + sprintf(gszMsgBox, + TgLoadString(STID_GIVEN_PAGE_NUM_IS_OUT_OF_RNG), + end_page_num); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + ok = FALSE; + } else if (start_page_num > end_page_num) { + sprintf(gszMsgBox, + TgLoadString(STID_MALFORMED_SPECIFICATION_STR), spec); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + ok = FALSE; + } else { + for (i=start_page_num; i <= end_page_num; i++) { + if (!pspi->page_specified[i-1]) pspi->num_pages_specified++; + pspi->page_specified[i-1] = TRUE; + } + } + } + } + } + free(dup_spec); + + if (!ok) FreePageSpec(pspi); + return ok; + } + void DeletePages() { ! char spec[MAXSTRING+1]; ! SpecifyPagesInfo spi; if (pageLayoutMode == PAGE_TILE) { *************** *** 1277,1340 **** UtilTrimBlanks(spec); if (*spec == '\0') return; - if ((mark_to_delete=(int*)malloc(lastPageNum*sizeof(int))) == NULL) { - FailAllocMessage(); - return; - } - if ((dup_spec=UtilStrDup(spec)) == NULL) { - free(mark_to_delete); - FailAllocMessage(); - return; - } - for (i=0; i < lastPageNum; i++) mark_to_delete[i] = FALSE; - for (c_ptr=strtok(dup_spec, " ,\t"); ok && c_ptr != NULL; - c_ptr=strtok(NULL, " ,\t")) { - char *dash_ptr=strchr(c_ptr, '-'); ! if (dash_ptr == NULL) { ! int page_num=atoi(c_ptr); ! if (page_num > 0 && page_num <= lastPageNum) { ! if (!mark_to_delete[page_num-1]) num_to_delete++; ! mark_to_delete[page_num-1] = TRUE; ! } else { ! sprintf(gszMsgBox, TgLoadString(STID_GIVEN_PAGE_NUM_IS_OUT_OF_RNG), ! page_num); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! ok = FALSE; ! } ! } else { ! int start_page_num, end_page_num; ! ! *dash_ptr = '\0'; ! start_page_num = atoi(c_ptr); ! end_page_num = atoi(&dash_ptr[1]); ! *dash_ptr = '-'; ! if (start_page_num <= 0 || start_page_num > lastPageNum) { ! sprintf(gszMsgBox, TgLoadString(STID_GIVEN_PAGE_NUM_IS_OUT_OF_RNG), ! start_page_num); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! ok = FALSE; ! } else if (end_page_num <= 0 || end_page_num > lastPageNum) { ! sprintf(gszMsgBox, TgLoadString(STID_GIVEN_PAGE_NUM_IS_OUT_OF_RNG), ! end_page_num); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! ok = FALSE; ! } else if (start_page_num > end_page_num) { ! sprintf(gszMsgBox, TgLoadString(STID_MALFORMED_SPECIFICATION_STR), ! spec); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! ok = FALSE; ! } else { ! for (i=start_page_num; i <= end_page_num; i++) { ! if (!mark_to_delete[i-1]) num_to_delete++; ! mark_to_delete[i-1] = TRUE; ! } ! } ! } ! } ! if (ok && num_to_delete == lastPageNum) { MsgBox(TgLoadString(STID_CANT_DEL_ALL_PAGES), TOOL_NAME, INFO_MB); ! } else if (ok && num_to_delete > 0) { ! sprintf(gszMsgBox, TgLoadString(num_to_delete > 1 ? STID_DELETE_A_PAGE_CAUSE_FLUSH : STID_DELETE_PAGES_PAGE_CAUSE_FLUSH)); --- 1364,1375 ---- UtilTrimBlanks(spec); if (*spec == '\0') return; ! memset(&spi, 0, sizeof(SpecifyPagesInfo)); ! if (!ParsePagesSpec(spec, &spi)) return; ! if (spi.num_pages_specified == lastPageNum) { MsgBox(TgLoadString(STID_CANT_DEL_ALL_PAGES), TOOL_NAME, INFO_MB); ! } else if (spi.num_pages_specified > 0) { ! sprintf(gszMsgBox, TgLoadString(spi.num_pages_specified > 1 ? STID_DELETE_A_PAGE_CAUSE_FLUSH : STID_DELETE_PAGES_PAGE_CAUSE_FLUSH)); *************** *** 1344,1348 **** for (page_num=lastPageNum; page_num > 0; page_num--) { ! if (mark_to_delete[page_num-1]) { GotoPageNum(page_num); if (curPage == firstPage) { --- 1379,1383 ---- for (page_num=lastPageNum; page_num > 0; page_num--) { ! if (spi.page_specified[page_num-1]) { GotoPageNum(page_num); if (curPage == firstPage) { *************** *** 1370,1375 **** ShowPage(); ! sprintf(gszMsgBox, TgLoadString(num_to_delete > 1 ? ! STID_MANY_PAGES_DELETED : STID_ONE_PAGE_DELETED), num_to_delete); Msg(gszMsgBox); SetFileModified(TRUE); --- 1405,1411 ---- ShowPage(); ! sprintf(gszMsgBox, TgLoadString(spi.num_pages_specified > 1 ? ! STID_MANY_PAGES_DELETED : STID_ONE_PAGE_DELETED), ! spi.num_pages_specified); Msg(gszMsgBox); SetFileModified(TRUE); *************** *** 1376,1385 **** } } ! free(dup_spec); ! free(mark_to_delete); } void PrintOneFilePerPage() { if (pageLayoutMode == PAGE_TILE) { MsgBox(TgLoadString(STID_CANT_DO_POFPP_IN_TILED), TOOL_NAME, INFO_MB); --- 1412,1461 ---- } } ! FreePageSpec(&spi); } + void PrintPages() + { + char spec[MAXSTRING]; + + if (pageLayoutMode == PAGE_TILE) { + MsgBox(TgLoadString(STID_CANT_PRINT_PAGES_IN_TILED), TOOL_NAME, INFO_MB); + return; + } + /* only allows PRINTER, PS_FILE, PDF_FILE, or export filter formats */ + switch (whereToPrint) { + case LATEX_FIG: + case XBM_FILE: + case TEXT_FILE: + case EPSI_FILE: + case GIF_FILE: + case HTML_FILE: + case TIFFEPSI_FILE: + case PNG_FILE: + sprintf(gszMsgBox, TgLoadString(STID_CANT_PRINT_PAGES_IN_FORMAT), + GetExportName(whereToPrint, EXPORT_THIS)); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + return; + default: break; + } + MakeQuiescent(); + + strcpy(spec, "*"); + Dialog(TgLoadString(STID_SPECIFY_PAGES_TO_PRINT_EX), NULL, spec); + UtilTrimBlanks(spec); + if (*spec == '\0') return; + + memset(&gPagesToPrintSpec, 0, sizeof(SpecifyPagesInfo)); + if (!ParsePagesSpec(spec, &gPagesToPrintSpec)) return; + + DumpPages(); + + FreePageSpec(&gPagesToPrintSpec); + } + void PrintOneFilePerPage() { + char spec[MAXSTRING]; + if (pageLayoutMode == PAGE_TILE) { MsgBox(TgLoadString(STID_CANT_DO_POFPP_IN_TILED), TOOL_NAME, INFO_MB); *************** *** 1390,1394 **** --- 1466,1481 ---- } MakeQuiescent(); + + strcpy(spec, "*"); + Dialog(TgLoadString(STID_SPECIFY_PAGES_TO_PRINT_EX), NULL, spec); + UtilTrimBlanks(spec); + if (*spec == '\0') return; + + memset(&gPagesToPrintSpec, 0, sizeof(SpecifyPagesInfo)); + if (!ParsePagesSpec(spec, &gPagesToPrintSpec)) return; + DumpOneFilePerPage(); + + FreePageSpec(&gPagesToPrintSpec); } *************** *** 1785,1802 **** } ! static int savedPageLayoutMode, savedPaperCol, savedPaperRow; ! static int savedCurPageNum, savedLastPageNum; ! static struct PageRec *savedFirstPage, *savedLastPage, *savedCurPage; void PushPageInfo() { ! savedPageLayoutMode = pageLayoutMode; ! savedPaperCol = paperCol; ! savedPaperRow = paperRow; ! savedFirstPage = firstPage; ! savedLastPage = lastPage; ! savedCurPage = curPage; ! savedCurPageNum = curPageNum; ! savedLastPageNum = lastPageNum; } --- 1872,1887 ---- } ! static PageInfo stPageInfo; void PushPageInfo() { ! stPageInfo.page_layout_mode = pageLayoutMode; ! stPageInfo.paper_col = paperCol; ! stPageInfo.paper_row = paperRow; ! stPageInfo.cur_page_num = curPageNum; ! stPageInfo.last_page_num = lastPageNum; ! stPageInfo.first_page = firstPage; ! stPageInfo.last_page = lastPage; ! stPageInfo.cur_page = curPage; } *************** *** 1803,1816 **** void PopPageInfo() { ! pageLayoutMode = savedPageLayoutMode; ! paperCol = savedPaperCol; ! paperRow = savedPaperRow; ! firstPage = savedFirstPage; ! lastPage = savedLastPage; ! curPage = savedCurPage; ! curPageNum = savedCurPageNum; ! lastPageNum = savedLastPageNum; } /* --------------------- FixPageNumbersForSlideShow() --------------------- */ --- 1888,1914 ---- void PopPageInfo() { ! pageLayoutMode = stPageInfo.page_layout_mode; ! paperCol = stPageInfo.paper_col; ! paperRow = stPageInfo.paper_row; ! curPageNum = stPageInfo.cur_page_num; ! lastPageNum = stPageInfo.last_page_num; ! firstPage = stPageInfo.first_page; ! lastPage = stPageInfo.last_page; ! curPage = stPageInfo.cur_page; } + void GetPageInfo(pPageInfo) + PageInfo *pPageInfo; + { + pPageInfo->page_layout_mode = pageLayoutMode; + pPageInfo->paper_col = paperCol; + pPageInfo->paper_row = paperRow; + pPageInfo->cur_page_num = curPageNum; + pPageInfo->last_page_num = lastPageNum; + pPageInfo->first_page = firstPage; + pPageInfo->last_page = lastPage; + pPageInfo->cur_page = curPage; + } + /* --------------------- FixPageNumbersForSlideShow() --------------------- */ *** poly.c.orig Tue Nov 2 13:57:06 1999 --- poly.c Tue Nov 2 13:57:06 1999 *************** *** 1947,1951 **** if (curChoice != VERTEXMODE) { ! MsgBox(TgLoadString(STID_CMD_ONLY_AVAIL_IN_VERSEL_MODE), TOOL_NAME, INFO_MB); return; --- 1947,1951 ---- if (curChoice != VERTEXMODE) { ! MsgBox(TgLoadString(STID_CMD_ONLY_AVAIL_IN_VERTEX_MODE), TOOL_NAME, INFO_MB); return; *** remote.c.orig Tue Nov 2 13:57:08 1999 --- remote.c Tue Nov 2 13:57:08 1999 *************** *** 1018,1022 **** } sprintf(gszMsgBox, TgLoadCachedString(CSTID_FORWARDING_URL_TO_URL), ! url, location); Msg(gszMsgBox); ShowRemoteStatus(gszMsgBox); --- 1018,1022 ---- } sprintf(gszMsgBox, TgLoadCachedString(CSTID_FORWARDING_URL_TO_URL), ! "HTTP", url, location); Msg(gszMsgBox); ShowRemoteStatus(gszMsgBox); *** setup.c.orig Tue Nov 2 13:57:10 1999 --- setup.c Tue Nov 2 13:57:10 1999 *************** *** 61,64 **** --- 61,65 ---- #include "mainmenu.e" #include "mark.e" + #include "markup.e" #include "menu.e" #include "miniline.e" *************** *** 1732,1735 **** --- 1733,1737 ---- InitShortCut(); + InitHtml(); #ifdef MAPBEFORESELECT *** shortcut.c.orig Tue Nov 2 13:57:11 1999 --- shortcut.c Tue Nov 2 13:57:12 1999 *************** *** 376,379 **** --- 376,380 ---- { '\0', 0, "EditIndexedAttrInEditor()", 0, CMDID_EDITATTRINEDITOR }, { '\0', 0, "SetHtmlExportTemplate()", 0, CMDID_SETHTMLEXPORTTEMPLATE }, + { '\0', 0, "PrintPages()", 0, CMDID_PRINTPAGES }, { '\0', 0, "", 0, 0 } }; *** strtbl.c.orig Tue Nov 2 13:57:13 1999 --- strtbl.c Tue Nov 2 13:57:13 1999 *************** *** 2262,2270 **** N_("File modified, save file before going back? [ync](y)"), /* STID_NOTHING_TO_GO_BACK_TO */ ! N_("Nothin to go back to."), /* STID_FILE_MOD_SAVE_BEFORE_FORWARD */ N_("File modified, save file before going forward? [ync](y)"), /* STID_NOTHING_TO_GO_FORWARD_TO */ ! N_("Nothin to go forward to."), /* STID_FAIL_TO_FIND_RECORD_IN_FUNC */ N_("Fail to find record in AdjustNavigate()."), --- 2262,2270 ---- N_("File modified, save file before going back? [ync](y)"), /* STID_NOTHING_TO_GO_BACK_TO */ ! N_("Nothing to go back to."), /* STID_FILE_MOD_SAVE_BEFORE_FORWARD */ N_("File modified, save file before going forward? [ync](y)"), /* STID_NOTHING_TO_GO_FORWARD_TO */ ! N_("Nothing to go forward to."), /* STID_FAIL_TO_FIND_RECORD_IN_FUNC */ N_("Fail to find record in AdjustNavigate()."), *************** *** 3067,3070 **** --- 3067,3080 ---- /* STID_WONT_CONDENSE_READHEXSTRING */ N_("Will not condense exported PS/EPS file due to 'readhexstring'."), + /* STID_CMD_ONLY_AVAIL_IN_VERTEX_MODE */ + N_("This command is only available in vertex mode."), + /* STID_CANNOT_MERGE_WITH_TILED_PAGE */ + N_("Does not know how to merge files with '%s' because it is in TILED page mode. Merge aborted."), + /* STID_SPECIFY_PAGES_TO_PRINT_EX */ + N_("Please specify pages to print: (e.g., 2,3,7-9,10 or '*' for all pages)"), + /* STID_CANT_PRINT_PAGES_IN_TILED */ + N_("Cannot print pages in TILED page mode."), + /* STID_CANT_PRINT_PAGES_IN_FORMAT */ + N_("Cannot print pages in the '%s' format."), NULL }; *** text.c.orig Tue Nov 2 13:57:16 1999 --- text.c Tue Nov 2 13:57:16 1999 *************** *** 4427,4430 **** --- 4427,4480 ---- } + static + void OldStyleRotateGetFinalOBBoxLtXY(ObjPtr, rotate, text_just, pnFinalLtX, + pnFinalLtY) + struct ObjRec *ObjPtr; + int rotate, text_just, *pnFinalLtX, *pnFinalLtY; + /* + * For fileVersion >= 33, rotate is always ROTATE0. So we need + * to convert the old format to the new one. The way we will + * do it is to: + * 1) Calculate where the final obbox.ltx and obbox.lty will be. + * 2) Rotate the object. + * 3) Move the object to matched the final position calculated in (1). + */ + { + /* + * This this point, coordinates in ObjPtr have been computed using ROTATE0. + * Remember, positive rotate is clockwise. + * In the old style, for JUST_L, pivot is left top corner, for JUST_C, pivot + * is center top corner, and for JUST_R, pivot is right top corner. + */ + int x=ObjPtr->x, y=ObjPtr->y, ltx=ObjPtr->obbox.ltx, lty=ObjPtr->obbox.lty; + int w=ObjPtr->obbox.rbx-ltx, h=ObjPtr->obbox.rby-lty; + + switch (rotate) { + case ROTATE90: + switch (text_just) { + case JUST_L: ltx=x-h; lty=y; break; + case JUST_C: ltx=x-h; lty=y-(w>>1); break; + case JUST_R: ltx=x-h; lty=y-w; break; + } + break; + case ROTATE180: + switch (text_just) { + case JUST_L: ltx=x-(w-(w>>1)); lty=y-h; break; + case JUST_C: ltx=x-w; lty=y-h; break; + case JUST_R: ltx=x; lty=y-h; break; + } + break; + case ROTATE270: + switch (text_just) { + case JUST_L: ltx=x; lty=y-w; break; + case JUST_C: ltx=x; lty=y-(w-(w>>1)); break; + case JUST_R: ltx=x; lty=y; break; + } + break; + } + *pnFinalLtX = ltx; + *pnFinalLtY = lty; + } + void ReadTextObj(FP, Inbuf, ObjPtr) FILE *FP; *************** *** 5104,5174 **** min_lbearing, max_rextra, rotate); } else { ! SetTextBBox(*ObjPtr, text_just, max_len, max_h, ! min_lbearing, max_rextra, rotate); } if (fileVersion < 33 && rotate != ROTATE0) { ! int ltx, lty; ! if (rotate == ROTATE90 || rotate == ROTATE270) { ! int h=(*ObjPtr)->obbox.rbx-(*ObjPtr)->obbox.ltx; ! int w=(*ObjPtr)->obbox.rby-(*ObjPtr)->obbox.lty; - (*ObjPtr)->obbox.rby = (*ObjPtr)->obbox.lty + h; - (*ObjPtr)->obbox.rbx = (*ObjPtr)->obbox.ltx + w; - - switch (text_just) { - case JUST_L: (*ObjPtr)->x = (*ObjPtr)->obbox.ltx; break; - case JUST_C: - (*ObjPtr)->x = (((*ObjPtr)->obbox.ltx+(*ObjPtr)->obbox.rbx)>>1); - break; - case JUST_R: (*ObjPtr)->x = (*ObjPtr)->obbox.rbx; break; - } - (*ObjPtr)->y = (*ObjPtr)->obbox.lty; - } else { - switch (text_just) { - case JUST_L: (*ObjPtr)->x = (*ObjPtr)->obbox.ltx; break; - case JUST_C: break; - case JUST_R: (*ObjPtr)->x = (*ObjPtr)->obbox.rbx; break; - } - (*ObjPtr)->y = (*ObjPtr)->obbox.lty; - } - ltx = ((*ObjPtr)->obbox.ltx); - lty = ((*ObjPtr)->obbox.lty); SetRotatePivotByObject(*ObjPtr); - switch (rotate) { ! case ROTATE90: ! RotateObj(*ObjPtr, CORNER_LT, CLOCKWISE90, <x, <y); ! break; ! case ROTATE180: ! RotateObj(*ObjPtr, CORNER_LT, CLOCKWISE90, <x, <y); ! RotateObj(*ObjPtr, CORNER_LT, CLOCKWISE90, <x, <y); ! break; ! case ROTATE270: ! RotateObj(*ObjPtr, CORNER_LT, COUNTER90, <x, <y); ! break; } ! rotate = ROTATE0; } - if (PRTGIF && fileVersion > 6) { - switch (rotate) { - case ROTATE0: - case ROTATE180: - SetTextBBox(*ObjPtr, text_just, obbox_w, obbox_h, - min_lbearing, max_rextra, rotate); - break; - case ROTATE90: - case ROTATE270: - SetTextBBox(*ObjPtr, text_just, obbox_h, obbox_w, - min_lbearing, max_rextra, rotate); - break; - } - } else if (!PRTGIF && text_ptr->read_only) { - SetTextBBox(*ObjPtr, text_just, text_ptr->orig_w, text_ptr->orig_h, - min_lbearing, max_rextra, rotate); - } else { - SetTextBBox(*ObjPtr, text_just, max_len, max_h, - min_lbearing, max_rextra, rotate); - } if (!PRTGIF) RestoreCurFont(); } --- 5154,5188 ---- min_lbearing, max_rextra, rotate); } else { ! if (fileVersion < 33 && rotate != ROTATE0) { ! /* pretend there's no rotate so we can get the coordiantes for obbox */ ! SetTextBBox(*ObjPtr, text_just, max_len, max_h, ! min_lbearing, max_rextra, ROTATE0); ! } else { ! SetTextBBox(*ObjPtr, text_just, max_len, max_h, ! min_lbearing, max_rextra, rotate); ! } } if (fileVersion < 33 && rotate != ROTATE0) { ! int ltx=0, lty=0, saved_rotation_increment=rotationIncrement; ! /* ! * For fileVersion >= 33, rotate is always ROTATE0. So we need ! * to convert the old format to the new one. The way we will ! * do it is to: ! * 1) Calculate where the final obbox.ltx and obbox.lty will be. ! * 2) Rotate the object. ! * 3) Move the object to matched the final position calculated in (1). ! */ ! OldStyleRotateGetFinalOBBoxLtXY(*ObjPtr, rotate, text_just, <x, <y); SetRotatePivotByObject(*ObjPtr); switch (rotate) { ! case ROTATE90: rotationIncrement = (90<<6); break; ! case ROTATE180: rotationIncrement = (180<<6); break; ! case ROTATE270: rotationIncrement = (270<<6); break; } ! RotateObjClockWise(*ObjPtr); ! rotationIncrement = saved_rotation_increment; } if (!PRTGIF) RestoreCurFont(); } *** xbitmap.c.orig Tue Nov 2 13:57:19 1999 --- xbitmap.c Tue Nov 2 13:57:19 1999 *************** *** 2474,2477 **** --- 2474,2478 ---- if (fname == NULL) FailAllocMessage(); if ((c_ptr=strchr(fname, '#')) != NULL) *c_ptr = '\0'; + GetRealBaseName(fname); if ((c_ptr=UtilStrRChr(fname, '.')) != NULL) *c_ptr = '\0'; *** file.e.orig Tue Nov 2 13:57:21 1999 --- file.e Tue Nov 2 13:57:21 1999 *************** *** 42,45 **** --- 42,46 ---- extern int curFileWriteVersion; extern int importingFile; + extern int mergingFile; extern int serializingFile; extern int deserializingFile; *************** *** 129,132 **** --- 130,135 ---- extern KeyValInfo *gaFilePSFontAliases; + extern SpecifyPagesInfo gPagesToPrintSpec; + #ifdef _INCLUDE_FROM_FILE_C_ #undef extern *************** *** 192,195 **** --- 195,199 ---- char **ppsz_rest)); extern void Dump ARGS_DECL((char *)); + extern void DumpPages ARGS_DECL((void)); extern void DumpOnePageInTileMode ARGS_DECL((int Row, int Col)); extern void DumpOnePageInStackMode ARGS_DECL((void)); *** mainloop.e.orig Tue Nov 2 13:57:22 1999 --- mainloop.e Tue Nov 2 13:57:22 1999 *************** *** 45,48 **** --- 45,51 ---- extern char * cmdLineBackground; extern char * cmdLineBorder; + extern int cmdLineMerge; + extern int cmdLineMergeArgc; + extern char * * cmdLineMergeArgv; extern int geometrySpecified; extern int exitNormally; *** markup.e.orig Tue Nov 2 13:57:23 1999 --- markup.e Tue Nov 2 13:57:23 1999 *************** *** 35,38 **** --- 35,40 ---- #define _TGIF_MARKUP_E_ + extern int cmdLineParseHtml; + #ifdef _INCLUDE_FROM_MARKUP_C_ #undef extern *** page.e.orig Tue Nov 2 13:57:24 1999 --- page.e Tue Nov 2 13:57:24 1999 *************** *** 67,71 **** --- 67,74 ---- extern int SetPaperSize ARGS_DECL((char *)); extern void SpecifyPaperSize ARGS_DECL((void)); + extern void FreePageSpec ARGS_DECL((SpecifyPagesInfo*)); + extern int ParsePagesSpec ARGS_DECL((char*, SpecifyPagesInfo*)); extern void DeletePages ARGS_DECL((void)); + extern void PrintPages ARGS_DECL((void)); extern void PrintOneFilePerPage ARGS_DECL((void)); extern int StackedPageMenu ARGS_DECL((int X, int Y, int TrackMenubar)); *************** *** 84,87 **** --- 87,91 ---- extern void PushPageInfo ARGS_DECL((void)); extern void PopPageInfo ARGS_DECL((void)); + extern void GetPageInfo ARGS_DECL((PageInfo*)); extern int FixPageNumInMiniLines ARGS_DECL((MiniLinesInfo*, struct AttrRec *, *** strtbl.e.orig Tue Nov 2 13:57:25 1999 --- strtbl.e Tue Nov 2 13:57:25 1999 *************** *** 1526,1531 **** #define STID_Q_FILE_UNSAVABLE_SAVE_NEW_YNC 2257 #define STID_WONT_CONDENSE_READHEXSTRING 2258 ! #define MAXNONCACHEDSTIDS 2259 extern struct MouseStatusStrRec colorMouseStatus[]; --- 1526,1536 ---- #define STID_Q_FILE_UNSAVABLE_SAVE_NEW_YNC 2257 #define STID_WONT_CONDENSE_READHEXSTRING 2258 + #define STID_CMD_ONLY_AVAIL_IN_VERTEX_MODE 2259 + #define STID_CANNOT_MERGE_WITH_TILED_PAGE 2260 + #define STID_SPECIFY_PAGES_TO_PRINT_EX 2261 + #define STID_CANT_PRINT_PAGES_IN_TILED 2262 + #define STID_CANT_PRINT_PAGES_IN_FORMAT 2263 ! #define MAXNONCACHEDSTIDS 2264 extern struct MouseStatusStrRec colorMouseStatus[]; *** cmdids.h.orig Tue Nov 2 13:57:26 1999 --- cmdids.h Tue Nov 2 13:57:26 1999 *************** *** 374,379 **** #define CMDID_EDITATTRINEDITOR 421 #define CMDID_SETHTMLEXPORTTEMPLATE 422 ! #define MAXCMDIDS 423 #endif /*_CMDIDS_H_*/ --- 374,380 ---- #define CMDID_EDITATTRINEDITOR 421 #define CMDID_SETHTMLEXPORTTEMPLATE 422 + #define CMDID_PRINTPAGES 423 ! #define MAXCMDIDS 424 #endif /*_CMDIDS_H_*/ *** patchlvl.h.orig Tue Nov 2 13:57:27 1999 --- patchlvl.h Tue Nov 2 13:57:27 1999 *************** *** 35,39 **** #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 22 #endif /*_TGIF_PATCHLEVEL_H_*/ --- 35,39 ---- #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 23 #endif /*_TGIF_PATCHLEVEL_H_*/ *** types.h.orig Tue Nov 2 13:57:28 1999 --- types.h Tue Nov 2 13:57:28 1999 *************** *** 806,808 **** --- 806,821 ---- } ExecInfo; + /* ------------------ page stuff ------------------ */ + + typedef struct tagSpecifyPagesInfoRec { + int num_pages_specified; + int *page_specified; + } SpecifyPagesInfo; + + typedef struct tagPageInfoRec { + int page_layout_mode, paper_col, paper_row; + int cur_page_num, last_page_num; + struct PageRec *first_page, *last_page, *cur_page; + } PageInfo; + #endif /*_TGIF_TYPES_H_*/ *** Imakefile.orig Tue Nov 2 13:57:29 1999 --- Imakefile Tue Nov 2 13:57:30 1999 *************** *** 53,57 **** $(MOREDEFINES) ! TGIFVERSION = 4.1.22 XCOMM Things to try to add to the DEFINES line above: --- 53,57 ---- $(MOREDEFINES) ! TGIFVERSION = 4.1.23 XCOMM Things to try to add to the DEFINES line above: *** Tgif.tmpl.orig Tue Nov 2 13:57:31 1999 --- Tgif.tmpl Tue Nov 2 13:57:31 1999 *************** *** 58,62 **** -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT MOREDEFINES = --- 58,63 ---- -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT \@@\ ! -D_USE_PS_ADOBE_STRING=\"3.0/3.0\" MOREDEFINES = *** tgif.man.orig Tue Nov 2 13:57:32 1999 --- tgif.man Tue Nov 2 13:57:33 1999 *************** *** 9,13 **** .\" .\" ! .TH tgif n "Version 4.1 Patchlevel 22 and Above" "Tgif" .\" .SH NAME --- 9,13 ---- .\" .\" ! .TH tgif n "Version 4.1 Patchlevel 23 and Above" "Tgif" .\" .SH NAME *************** *** 35,39 **** [\fB-geometry\fR ] [\fB=\fR] ! [\fI\fR[.\fIobj\fR]] .PP or --- 35,40 ---- [\fB-geometry\fR ] [\fB=\fR] ! [{\fIfile\fR[.\fIobj\fR]|-merge ! \fIfile1\fR[.\fIobj\fR] \fIfile2\fR[.\fIobj\fR] ...}] .PP or *************** *** 73,77 **** [\fB-tmp_file_mode ""\fR] [\fB-o\fR] ! [\fIfile1\fR \fIfile2\fR ...] .\" .SH DESCRIPTION --- 74,78 ---- [\fB-tmp_file_mode ""\fR] [\fB-o\fR] ! [\fIfile1\fR[.\fIobj\fR] \fIfile2\fR[.\fIobj\fR] ...] .\" .SH DESCRIPTION *************** *** 301,304 **** --- 302,309 ---- is specified, the output file goes into the directory specified by \fB\fR. + .TP + .B -merge \fIfile1\fR \fIfile2\fR ... + Using this option merges \fIfile1\fR.obj, \fIfile2\fR.obj, etc. + into a multipage file. .\" .SH BASIC FUNCTIONALITIES *** HISTORY.orig Tue Nov 2 13:57:35 1999 --- HISTORY Tue Nov 2 13:57:35 1999 *************** *** 1,2 **** --- 1,21 ---- + -----------------------> tgif-4.1.22 => tgif-4.1.23 <----------------------- + 1) Fix a bug in handling rotated text object exported from the gnuplot tgif + terminal. Thanks to Leana Golubchik for pointing + out the problem. + 2) Fix a bug in handling the if() internal command when "!*" is used. + Thanks to Marko Schuetz + for pointing out the problem. + 3) If a file contains only one page, Print One File Per Page will still + produce a file with file name containing the page number. + 4) Add a "-merge" commandline option to merge a list of obj files. + 5) Add "Print Pages" to the File and Page Menu. + 6) Print One File Page will now prompt to see if the user wants to + print only selected pages. + 7) Update po/ja/ja.po. Thanks to Jun Nishii for + the udpate. + 8) Change all Tgif.tmpl* files to use a default of + + _USE_PS_ADOBE_STRING=\"3.0/3.0\" + -----------------------> tgif-4.1.21 => tgif-4.1.22 <----------------------- 1) Fix a crashing bug with right click on an non-existant text object. *** Tgif.tmpl-aix4.orig Tue Nov 2 13:57:36 1999 --- Tgif.tmpl-aix4 Tue Nov 2 13:57:36 1999 *************** *** 58,62 **** -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT MOREDEFINES = -D_BSD -D_NO_DL_SUPPORT -D_NO_XIM --- 58,63 ---- -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT \@@\ ! -D_USE_PS_ADOBE_STRING=\"3.0/3.0\" MOREDEFINES = -D_BSD -D_NO_DL_SUPPORT -D_NO_XIM *** Tgif.tmpl-freebsd.orig Tue Nov 2 13:57:37 1999 --- Tgif.tmpl-freebsd Tue Nov 2 13:57:37 1999 *************** *** 58,62 **** -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT MOREDEFINES = --- 58,63 ---- -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT \@@\ ! -D_USE_PS_ADOBE_STRING=\"3.0/3.0\" MOREDEFINES = *** Tgif.tmpl-hpux.orig Tue Nov 2 13:57:38 1999 --- Tgif.tmpl-hpux Tue Nov 2 13:57:38 1999 *************** *** 61,65 **** -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT MOREDEFINES = -D_NO_DL_SUPPORT -D_NO_LOCALE_SUPPORT -D_NO_RECURSIVE_EXTERN --- 61,66 ---- -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT \@@\ ! -D_USE_PS_ADOBE_STRING=\"3.0/3.0\" MOREDEFINES = -D_NO_DL_SUPPORT -D_NO_LOCALE_SUPPORT -D_NO_RECURSIVE_EXTERN *** Tgif.tmpl-irix.orig Tue Nov 2 13:57:39 1999 --- Tgif.tmpl-irix Tue Nov 2 13:57:39 1999 *************** *** 62,66 **** -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT MOREDEFINES = --- 62,67 ---- -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT \@@\ ! -D_USE_PS_ADOBE_STRING=\"3.0/3.0\" MOREDEFINES = *** Tgif.tmpl-linux.orig Tue Nov 2 13:57:40 1999 --- Tgif.tmpl-linux Tue Nov 2 13:57:40 1999 *************** *** 58,62 **** -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT MOREDEFINES = --- 58,63 ---- -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT \@@\ ! -D_USE_PS_ADOBE_STRING=\"3.0/3.0\" MOREDEFINES = *** Tgif.tmpl-netbsd.orig Tue Nov 2 13:57:41 1999 --- Tgif.tmpl-netbsd Tue Nov 2 13:57:41 1999 *************** *** 58,62 **** -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT MOREDEFINES = --- 58,63 ---- -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT \@@\ ! -D_USE_PS_ADOBE_STRING=\"3.0/3.0\" MOREDEFINES = *** Tgif.tmpl-os2.orig Tue Nov 2 13:57:42 1999 --- Tgif.tmpl-os2 Tue Nov 2 13:57:42 1999 *************** *** 58,62 **** -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT MOREDEFINES = -D_NO_DL_SUPPORT -D_NO_LOCALE_SUPPORT -D_NO_LSTAT -D_NO_RAND48 --- 58,63 ---- -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT \@@\ ! -D_USE_PS_ADOBE_STRING=\"3.0/3.0\" MOREDEFINES = -D_NO_DL_SUPPORT -D_NO_LOCALE_SUPPORT -D_NO_LSTAT -D_NO_RAND48 *** Tgif.tmpl-osf1.orig Tue Nov 2 13:57:42 1999 --- Tgif.tmpl-osf1 Tue Nov 2 13:57:42 1999 *************** *** 58,62 **** -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT MOREDEFINES = --- 58,63 ---- -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT \@@\ ! -D_USE_PS_ADOBE_STRING=\"3.0/3.0\" MOREDEFINES = *** Tgif.tmpl-solaris.orig Tue Nov 2 13:57:43 1999 --- Tgif.tmpl-solaris Tue Nov 2 13:57:43 1999 *************** *** 71,75 **** -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! MISCDEFINES = -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT MOREDEFINES = -D_HAS_STREAMS_SUPPORT --- 71,76 ---- -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\ -DTEXT_FILE_EXT=\"txt\" -DPIN_FILE_EXT=\"pin\" ! 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