*** choice.c.orig Thu Dec 26 01:10:15 1996 --- choice.c Thu Dec 26 01:10:15 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/choice.c,v 3.5 1996/10/28 00:34:07 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/choice.c,v 3.6 1996/12/23 22:06:56 william Exp $"; #endif *************** *** 455,459 **** XClearArea (mainDisplay, choiceWindow, TEXT_SIZE_COL*choiceImageW, TEXT_SIZE_ROW*choiceImageH, choiceImageW, choiceImageH, FALSE); ! sprintf (s, "%1d", curSize); len = strlen (s); w = XTextWidth (defaultFontPtr, s, len); --- 455,461 ---- XClearArea (mainDisplay, choiceWindow, TEXT_SIZE_COL*choiceImageW, TEXT_SIZE_ROW*choiceImageH, choiceImageW, choiceImageH, FALSE); ! sprintf (s, "%1d", ! (curChoice == DRAWTEXT && editingText && editTextSize != 0 && ! savedEditTextSize != (-1)) ? savedEditTextSize : curSize); len = strlen (s); w = XTextWidth (defaultFontPtr, s, len); *** color.c.orig Thu Dec 26 01:10:17 1996 --- color.c Thu Dec 26 01:10:17 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/color.c,v 3.9 1996/10/30 19:42:34 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/color.c,v 3.10 1996/12/25 16:39:09 william Exp $"; #endif *************** *** 1089,1092 **** --- 1089,1093 ---- curTextModified = TRUE; RedrawCurText(); + SetFileModified(TRUE); if (cycleThroughChoice) { SetPushedFontValue(PUSH_COLORINDEX, colorIndex); *** drawing.c.orig Thu Dec 26 01:10:19 1996 --- drawing.c Thu Dec 26 01:10:19 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/drawing.c,v 3.10 1996/10/28 00:59:10 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/drawing.c,v 3.16 1996/12/26 05:29:30 william Exp $"; #endif *************** *** 305,309 **** int CheckInterval; { ! if (interruptLevel++ > 0) return; if (CheckInterval > 0) --- 305,309 ---- int CheckInterval; { ! if (PRTGIF || interruptLevel++ > 0) return; if (CheckInterval > 0) *************** *** 321,325 **** int HideInterrupt () { ! if (--interruptLevel > 0) return interruptLevel; interruptLevel = 0; if (execAnimatePixmap == None) { --- 321,325 ---- int HideInterrupt () { ! if (PRTGIF || --interruptLevel > 0) return interruptLevel; interruptLevel = 0; if (execAnimatePixmap == None) { *************** *** 409,412 **** --- 409,413 ---- XEvent ev; + if (PRTGIF) return FALSE; if (XCheckIfEvent(mainDisplay, &ev, CheckESC, NULL)) { return TRUE; *************** *** 417,421 **** int CheckInterrupt() { ! if (execAnimatePixmap == None && intrCheckInterval <= 0) return (FALSE); if (++checkCount >= intrCheckInterval) { XEvent ev; --- 418,423 ---- int CheckInterrupt() { ! if (PRTGIF) return FALSE; ! if (execAnimatePixmap == None && intrCheckInterval <= 0) return FALSE; if (++checkCount >= intrCheckInterval) { XEvent ev; *************** *** 520,523 **** --- 522,527 ---- struct AttrRec *attr_ptr; + if (!colorLayers) return TRUE; + switch (ObjPtr->type) { case OBJ_POLY: *************** *** 1372,1376 **** static ! int DoShortCut(name, key_sym, state, args) char *name, *args; KeySym key_sym; --- 1376,1381 ---- static ! int DoShortCut(key_ev, name, key_sym, state, args) ! XKeyEvent *key_ev; char *name, *args; KeySym key_sym; *************** *** 1498,1501 **** --- 1503,1507 ---- case ',': /*^#,*/ ImportXPixmapFile(); break; case '-': /*^#-*/ ToggleGridSystem(); break; + case '=': /*^#=*/ FindAgain(); break; } } else if (name != NULL && key_sym == '\0' && state == 0) { *************** *** 1736,1739 **** --- 1742,1767 ---- } else if (strcmp(name, "SetSelFontSize()") == 0) { SetSelectedFontSize(); + } else if (strcmp(name, "ZoomInAtCursor()") == 0) { + if (key_ev != NULL) { + int abs_x=ABS_X(key_ev->x); + int abs_y=ABS_Y(key_ev->y); + + ZoomInAtCursor(abs_x, abs_y); + } + } else if (strcmp(name, "CenterAtCursor()") == 0) { + if (key_ev != NULL) { + int abs_x=ABS_X(key_ev->x); + int abs_y=ABS_Y(key_ev->y); + + CenterAtCursor(abs_x, abs_y); + } + } else if (strcmp(name, "SetEditTextSize()") == 0) { + SetEditTextSize(); + } else if (strcmp(name, "FindCaseSensitive()") == 0) { + FindCaseSensitive(); + } else if (strcmp(name, "FindNoCase()") == 0) { + FindNoCase(); + } else if (strcmp(name, "FindAgain()") == 0) { + FindAgain(); } } *************** *** 1787,1791 **** if (valid_shortcut) { Msg(""); ! return DoShortCut(name, key_sym, key_ev->state, args); } return (INVALID); --- 1815,1819 ---- if (valid_shortcut) { Msg(""); ! return DoShortCut(key_ev, name, key_sym, key_ev->state, args); } return (INVALID); *************** *** 1797,1801 **** unsigned int state; { ! DoShortCut(name, (KeySym)(*code), state, (argc<=1 ? NULL : argv[1])); return TRUE; } --- 1825,1833 ---- unsigned int state; { ! if (UtilStrICmp(name, "ZoomInAtCursor") == 0 || ! UtilStrICmp(name, "CenterAtCursor") == 0) { ! return FALSE; ! } ! DoShortCut(NULL, name, (KeySym)(*code), state, (argc<=1 ? NULL : argv[1])); return TRUE; } *************** *** 1991,1999 **** if ((button_ev->state & ShiftMask) && (button_ev->state & ControlMask)) { ! if (button_ev->button == Button1) { ! int abs_x=ABS_X(button_ev->x); ! int abs_y=ABS_Y(button_ev->y); ZoomInAtCursor(abs_x, abs_y); } else if (button_ev->button == Button3) { ZoomOut(); --- 2023,2033 ---- if ((button_ev->state & ShiftMask) && (button_ev->state & ControlMask)) { ! int abs_x=ABS_X(button_ev->x); ! int abs_y=ABS_Y(button_ev->y); + if (button_ev->button == Button1) { ZoomInAtCursor(abs_x, abs_y); + } else if (button_ev->button == Button2) { + CenterAtCursor(abs_x, abs_y); } else if (button_ev->button == Button3) { ZoomOut(); *** edit.c.orig Thu Dec 26 01:10:21 1996 --- edit.c Thu Dec 26 01:10:21 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/edit.c,v 3.10 1996/10/28 01:03:24 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/edit.c,v 3.17 1996/12/26 06:06:14 william Exp $"; #endif *************** *** 128,131 **** --- 128,135 ---- "SetShapeShadow ", "NoTransform ", + "SetEditTextSize ", + "FindCaseSensitive", + "FindNoCase ", + "FindAgain ", NULL }; *************** *** 169,172 **** --- 173,180 ---- "Specify the shadow of shapes", "Get rid of transformations on selected simple objects", + "Set the text size to be used in editing existing text objects", + "Find string in visible text objects (case sensitive)", + "Find string in visible text objects (case insensitive)", + "Repeat the last Find command", NULL }; *************** *** 3116,3119 **** --- 3124,3453 ---- } + void SetEditTextSize() + { + char spec[MAXSTRING+1]; + int size=0; + + MakeQuiescent(); + *spec = '\0'; + sprintf(gszMsgBox, "%s (%s, %s): [current: %1d]", + "Please specify text size for editing existing text objects", + "please enter 0 or a value between 4 and 34", + "0 means to use the actual size of text", + editTextSize); + Dialog(gszMsgBox, NULL, spec); + UtilTrimBlanks(spec); + if (*spec == '\0') return; + size = atoi(spec); + if (size != 0 && (size < 4 || size > 34)) { + sprintf(gszMsgBox, "%s '%s' %s.\n\n%s.", + "The value entered:", spec, "is out of range", + "Please enter a value between 4 and 34"); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + } else { + editTextSize = size; + if (editTextSize == 0) { + sprintf(gszMsgBox, + "Actual text size will be used to edit existing text."); + } else { + sprintf(gszMsgBox, + "Text size of %1d will be used to edit existing text.", + editTextSize); + } + Msg(gszMsgBox); + } + } + + static char *gpszSearch=NULL; + static int gnSearchLen=0; + static int gnSearchCaseSensitive=TRUE; + static int gnFoundCharIndex=0; + static int gnFoundStrObjIndex=0; + + static + struct ObjRec *DoFind(obj_ptr) + struct ObjRec *obj_ptr; + { + int str_obj_index=0; + struct ObjRec *ptr=NULL; + struct ObjRec *return_obj=NULL; + struct StrRec *str_ptr=NULL; + + if (obj_ptr->type != OBJ_TEXT) { + struct AttrRec *attr_ptr; + + for (attr_ptr=obj_ptr->fattr; attr_ptr != NULL; attr_ptr=attr_ptr->next) { + if (attr_ptr->shown) { + return_obj = DoFind(attr_ptr->obj); + if (return_obj != NULL) { + return return_obj; + } + } + } + } + switch (obj_ptr->type) { + case OBJ_SYM: + case OBJ_GROUP: + case OBJ_ICON: + for (ptr=obj_ptr->detail.r->last; ptr != NULL; ptr=ptr->prev) { + ptr->tmp_parent = obj_ptr; + return_obj = DoFind(ptr); + if (return_obj != NULL) { + return return_obj; + } + } + break; + case OBJ_TEXT: + str_obj_index = 0; + for (str_ptr=obj_ptr->detail.t->first; str_ptr != NULL; + str_ptr=str_ptr->next, str_obj_index++) { + if (gnSearchCaseSensitive) { + char *c_ptr=strstr(str_ptr->dyn_str.s, gpszSearch); + + if (c_ptr != NULL) { + gnFoundCharIndex = (int)(c_ptr-str_ptr->dyn_str.s); + gnFoundStrObjIndex = str_obj_index; + return obj_ptr; + } + } else { + char *c_ptr; + + for (c_ptr=str_ptr->dyn_str.s; *c_ptr != '\0'; c_ptr++) { + if (UtilStrNCaseCmp(c_ptr, gpszSearch, gnSearchLen) == 0) { + gnFoundCharIndex = (int)(c_ptr-str_ptr->dyn_str.s); + gnFoundStrObjIndex = str_obj_index; + return obj_ptr; + } + } + } + } + break; + default: break; + } + return NULL; + } + + static int gnFoundStartingPoint=FALSE; + + static + struct ObjRec *DoFindAlready(obj_ptr, bottom_half, pn_give_up) + struct ObjRec *obj_ptr; + int bottom_half; /* TRUE if searching from curTextObj to topObj */ + int *pn_give_up; + { + struct ObjRec *ptr=NULL; + struct ObjRec *return_obj=NULL; + struct StrRec *str_ptr=NULL; + + if (obj_ptr->type != OBJ_TEXT) { + struct AttrRec *attr_ptr; + + for (attr_ptr=obj_ptr->fattr; attr_ptr != NULL; attr_ptr=attr_ptr->next) { + if (attr_ptr->shown) { + return_obj = DoFindAlready(attr_ptr->obj, bottom_half, pn_give_up); + if (return_obj != NULL) { + return return_obj; + } + if (pn_give_up != NULL && *pn_give_up) { + return NULL; + } + } + } + } + switch (obj_ptr->type) { + case OBJ_SYM: + case OBJ_GROUP: + case OBJ_ICON: + for (ptr=obj_ptr->detail.r->last; ptr != NULL; ptr=ptr->prev) { + ptr->tmp_parent = obj_ptr; + return_obj = DoFindAlready(ptr, bottom_half, pn_give_up); + if (return_obj != NULL) { + return return_obj; + } + if (pn_give_up != NULL && *pn_give_up) { + return NULL; + } + } + break; + case OBJ_TEXT: + if ((bottom_half && gnFoundStartingPoint) || + (!bottom_half && obj_ptr != curTextObj)) { + int str_obj_index=0; + + for (str_ptr=obj_ptr->detail.t->first; str_ptr != NULL; + str_ptr=str_ptr->next, str_obj_index++) { + if (gnSearchCaseSensitive) { + char *c_ptr=strstr(str_ptr->dyn_str.s, gpszSearch); + + if (c_ptr != NULL) { + gnFoundCharIndex = (int)(c_ptr-str_ptr->dyn_str.s); + gnFoundStrObjIndex = str_obj_index; + return obj_ptr; + } + } else { + char *c_ptr; + + for (c_ptr=str_ptr->dyn_str.s; *c_ptr != '\0'; c_ptr++) { + if (UtilStrNCaseCmp(c_ptr, gpszSearch, gnSearchLen) == 0) { + gnFoundCharIndex = (int)(c_ptr-str_ptr->dyn_str.s); + gnFoundStrObjIndex = str_obj_index; + return obj_ptr; + } + } + } + } + } else if (bottom_half) { + if (obj_ptr == curTextObj) { + gnFoundStartingPoint = TRUE; + } + } else { + if (obj_ptr == curTextObj) { + if (pn_give_up != NULL) *pn_give_up = TRUE; + } + } + break; + default: break; + } + return NULL; + } + + static + void Find() + { + int wrapped=FALSE; + struct PageRec *page_ptr=NULL; + struct ObjRec *obj_ptr=NULL; + struct ObjRec *found_obj=NULL; + + if (gpszSearch == NULL) return; + gnSearchLen = strlen(gpszSearch); + + gnFoundCharIndex = 0; + gnFoundStrObjIndex = 0; + + SetWatchCursor(drawWindow); + SetWatchCursor(mainWindow); + + if (curChoice == DRAWTEXT) { + if (curTextObj != NULL && FindTextInCurTextObj(gpszSearch, gnSearchLen, + gnSearchCaseSensitive, &gnFoundStrObjIndex, &gnFoundCharIndex)) { + found_obj = curTextObj; + } + if (found_obj == NULL) { + gnFoundStartingPoint = FALSE; + for (obj_ptr=botObj; obj_ptr != NULL; obj_ptr=obj_ptr->prev) { + obj_ptr->tmp_parent = NULL; + if (!ObjInVisibleLayer(obj_ptr)) { + continue; + } + found_obj = DoFindAlready(obj_ptr, TRUE, NULL); + if (found_obj != NULL) { + break; + } + } + if (found_obj == NULL && gnFoundStartingPoint) { + wrapped = TRUE; + for (obj_ptr=botObj; obj_ptr != NULL; obj_ptr=obj_ptr->prev) { + int give_up=FALSE; + + obj_ptr->tmp_parent = NULL; + if (!ObjInVisibleLayer(obj_ptr)) { + continue; + } + found_obj = DoFindAlready(obj_ptr, FALSE, &give_up); + if (found_obj != NULL) { + break; + } + if (give_up) { + break; + } + } + } + } + } + if (found_obj == NULL) { + if (curChoice == DRAWTEXT) { + wrapped = TRUE; + } + for (obj_ptr=botObj; obj_ptr != NULL; obj_ptr=obj_ptr->prev) { + obj_ptr->tmp_parent = NULL; + if (!ObjInVisibleLayer(obj_ptr)) { + continue; + } + found_obj = DoFind(obj_ptr); + if (found_obj != NULL) { + break; + } + } + if (found_obj != NULL) { + if (curChoice != DRAWTEXT) { + SetCurChoice(DRAWTEXT); + } + } + } + SetDefaultCursor(mainWindow); + ShowCursor(); + + if (found_obj == NULL) { + sprintf(gszMsgBox, "Cannot find '%s'.", gpszSearch); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + } else { + HighLightText(found_obj, gnFoundStrObjIndex, gnFoundCharIndex, gnSearchLen); + if (wrapped) { + Msg("Find command is wrapped."); + } + } + } + + void FindCaseSensitive() + { + char spec[MAXSTRING]; + + *spec = '\0'; + Dialog("Please enter a string to find (case sensitive):", NULL, spec); + if (*spec == '\0') { + return; + } + if (gpszSearch != NULL) free(gpszSearch); + if ((gpszSearch=UtilStrDup(spec)) == NULL) FailAllocMessage(); + + gnSearchCaseSensitive = TRUE; + if (curChoice != DRAWTEXT) { + MakeQuiescent(); + } + Find(); + } + + void FindNoCase() + { + char spec[MAXSTRING]; + + *spec = '\0'; + Dialog("Please enter a string to find (case insensitive):", NULL, spec); + if (*spec == '\0') { + return; + } + if (gpszSearch != NULL) free(gpszSearch); + if ((gpszSearch=UtilStrDup(spec)) == NULL) FailAllocMessage(); + + gnSearchCaseSensitive = FALSE; + if (curChoice != DRAWTEXT) { + MakeQuiescent(); + } + Find(); + } + + void FindAgain() + { + if (gpszSearch == NULL) { + sprintf(gszMsgBox, "%s.\n\n%s.", + "No previous find specified", + "Please select FindCaseSensitive() or FindNoCase()"); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + } else { + Find(); + } + } + /* ----------------------- EditMenu ----------------------- */ *************** *** 3160,3163 **** --- 3494,3501 ---- case EDIT_SET_SHAPE_SHADOW: SetShapeShadow (); break; case EDIT_NO_TRANSFORM: NoTransform (); break; + case EDIT_SET_EDIT_TEXT_SIZE: SetEditTextSize (); break; + case EDIT_FIND_CASE: FindCaseSensitive (); break; + case EDIT_FIND_NOCASE: FindNoCase (); break; + case EDIT_FIND_AGAIN: FindAgain (); break; } } *************** *** 3740,3742 **** --- 4078,4086 ---- } HighLightForward (); + } + + void CleanUpEdit() + { + if (gpszSearch != NULL) free(gpszSearch); + gpszSearch = NULL; } *** eps.c.orig Thu Dec 26 01:10:23 1996 --- eps.c Thu Dec 26 01:10:23 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/eps.c,v 3.5 1996/10/28 01:09:13 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/eps.c,v 3.6 1996/11/03 20:07:41 william Exp $"; #endif *************** *** 694,714 **** fclose (fp); if (*tiff_eps_fname != '\0') unlink(tiff_eps_fname); ! if (!boundingbox_found) ! { sprintf(gszMsgBox, "%s '%s'.", "Can not find bounding box information in", file_name); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! if (*bitmap != None) ! { ! XFreePixmap (mainDisplay, *bitmap); *bitmap = None; } ! if (*image != NULL) ! { ! XDestroyImage (*image); *image = NULL; } ! CleanUpLines (); ! return (BitmapFileInvalid); } if (*tiff_eps_fname != '\0' && !tiff_preview_ok) { --- 694,711 ---- fclose (fp); if (*tiff_eps_fname != '\0') unlink(tiff_eps_fname); ! if (!boundingbox_found) { sprintf(gszMsgBox, "%s '%s'.", "Can not find bounding box information in", file_name); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! if (*bitmap != None) { ! XFreePixmap(mainDisplay, *bitmap); *bitmap = None; } ! if (*image != NULL) { ! XDestroyImage(*image); *image = NULL; } ! CleanUpLines(); ! return BitmapFileInvalid; } if (*tiff_eps_fname != '\0' && !tiff_preview_ok) { *************** *** 717,724 **** MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); } ! stat (file_name, &stat_buf); ! strcpy (loc_time, ctime (&(stat_buf.st_mtime))); ! loc_time[24] = '\0'; ! strcpy (write_date, loc_time); *epsflines = (char**)malloc(numLines*sizeof(char*)); --- 714,724 ---- MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); } ! if (stat(file_name, &stat_buf) == 0) { ! strcpy(loc_time, ctime (&(stat_buf.st_mtime))); ! loc_time[24] = '\0'; ! } else { ! strcpy(loc_time, "(unknown)"); ! } ! strcpy(write_date, loc_time); *epsflines = (char**)malloc(numLines*sizeof(char*)); *************** *** 939,945 **** return (FALSE); } ! stat (file_name, &stat_buf); ! strcpy (loc_time, ctime (&(stat_buf.st_mtime))); ! loc_time[24] = '\0'; if (strcmp (xbm_ptr->write_date, loc_time) != 0) { --- 939,948 ---- return (FALSE); } ! if (stat(file_name, &stat_buf) == 0) { ! strcpy(loc_time, ctime (&(stat_buf.st_mtime))); ! loc_time[24] = '\0'; ! } else { ! strcpy(loc_time, "(unknown)"); ! } if (strcmp (xbm_ptr->write_date, loc_time) != 0) { *************** *** 989,995 **** struct stat stat_buf; ! stat(xbm_ptr->filename, &stat_buf); ! strcpy(loc_time, ctime(&(stat_buf.st_mtime))); ! loc_time[24] = '\0'; if (strcmp(xbm_ptr->write_date, loc_time) != 0) { sprintf(gszMsgBox, --- 992,1001 ---- struct stat stat_buf; ! if (stat(xbm_ptr->filename, &stat_buf) == 0) { ! strcpy(loc_time, ctime(&(stat_buf.st_mtime))); ! loc_time[24] = '\0'; ! } else { ! strcpy(loc_time, "(unknown)"); ! } if (strcmp(xbm_ptr->write_date, loc_time) != 0) { sprintf(gszMsgBox, *** exec.c.orig Thu Dec 26 01:10:25 1996 --- exec.c Thu Dec 26 01:10:25 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/exec.c,v 3.9 1996/10/30 23:22:17 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/exec.c,v 3.11 1996/11/03 20:03:56 william Exp $"; #endif *************** *** 38,41 **** --- 38,42 ---- #include #include + #include #ifdef _NO_GETTIMEOFDAY #include *************** *** 229,232 **** --- 230,236 ---- int ExecCallSimpleShortCut ARGS_DECL((char**, struct ObjRec *, char*)); int ExecCallOneArgShortCut ARGS_DECL((char**, struct ObjRec *, char*)); + int ExecSubstituteAttr ARGS_DECL((char**, struct ObjRec *, char*)); + int ExecGetFileSize ARGS_DECL((char**, struct ObjRec *, char*)); + int ExecIsFile ARGS_DECL((char**, struct ObjRec *, char*)); static *************** *** 311,314 **** --- 315,321 ---- { (void*)ExecCallSimpleShortCut, "call_simple_shortcut", 1, 0}, { (void*)ExecCallOneArgShortCut, "call_one_arg_shortcut", 2, 0}, + { (void*)ExecSubstituteAttr, "substitute_attr", 4, 0}, + { (void*)ExecGetFileSize, "get_file_size", 2, 0}, + { (void*)ExecIsFile, "is_file", 2, 0}, { NULL, NULL, 0, 0 } }; *************** *** 1055,1059 **** } sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", ! "Invalid evaluation", expr, "(integer expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); --- 1062,1067 ---- } sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", ! "Invalid evaluation", expr, ! "used (integer expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); *************** *** 2915,2919 **** sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid evaluation", expr, ! "(numeric value expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); --- 2923,2927 ---- sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid evaluation", expr, ! "used (numeric value expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); *************** *** 4146,4150 **** sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid evaluation", expr, ! "(numeric value expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); --- 4154,4158 ---- sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid evaluation", expr, ! "used (numeric value expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); *************** *** 4237,4241 **** sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid evaluation", expr, ! "(numeric value expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); --- 4245,4249 ---- sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid evaluation", expr, ! "used (numeric value expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); *************** *** 4316,4320 **** sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid evaluation", expr, ! "(numeric value expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); --- 4324,4328 ---- sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid evaluation", expr, ! "used (numeric value expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); *************** *** 4470,4474 **** sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid evaluation", expr, ! "(numeric value expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); --- 4478,4482 ---- sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid evaluation", expr, ! "used (numeric value expected) when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); *************** *** 4487,4491 **** char *shortcut_name=argv[0], *func_name=NULL, *buf=NULL, code='\0'; unsigned int state; ! int len; UtilRemoveQuotes(shortcut_name); --- 4495,4499 ---- char *shortcut_name=argv[0], *func_name=NULL, *buf=NULL, code='\0'; unsigned int state; ! int len, rc=TRUE; UtilRemoveQuotes(shortcut_name); *************** *** 4495,4499 **** sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid shortcut name", shortcut_name, ! "when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); return FALSE; --- 4503,4507 ---- sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid shortcut name", shortcut_name, ! "used when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); return FALSE; *************** *** 4510,4517 **** return FALSE; } ! CallShortCut(func_name, 1, &buf, &code, state); free(buf); free(func_name); ! return TRUE; } --- 4518,4531 ---- return FALSE; } ! rc = CallShortCut(func_name, 1, &buf, &code, state); free(buf); free(func_name); ! if (!rc) { ! sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", ! "Invalid shortcut name", shortcut_name, ! "used when executing the", orig_cmd, "command"); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! } ! return rc; } *************** *** 4533,4537 **** sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid shortcut name", shortcut_name, ! "when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); return FALSE; --- 4547,4551 ---- sprintf(gszMsgBox, "%s '%s' %s '%s' %s.", "Invalid shortcut name", shortcut_name, ! "used when executing the", orig_cmd, "command"); MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); return FALSE; *************** *** 4568,4571 **** --- 4582,4740 ---- free(ppsz_buf); free(func_name); + return TRUE; + } + + int ExecSubstituteAttr(argv, obj_ptr, orig_cmd) + char **argv, *orig_cmd; + struct ObjRec *obj_ptr; + /* substitute_attr(attr_name,src_attr_name,replace_attr_name,pattern_str); */ + { + char *attr_name=argv[0], *src_attr_name=argv[1]; + char *replace_attr_name=argv[2], *pattern_str=argv[3]; + char tmp_fname[MAXPATHLENGTH+1]; + struct AttrRec *attr_ptr=NULL, *src_attr_ptr=NULL, *replace_attr_ptr=NULL; + struct ObjRec *attr_owner_obj=NULL; + struct StrRec *src_str_ptr; + int rc, pattern_len=0; + FILE *fp; + + if (*pattern_str == '\0') return BadArg("pattern_str", orig_cmd); + + UtilRemoveQuotes(attr_name); + UtilRemoveQuotes(src_attr_name); + UtilRemoveQuotes(replace_attr_name); + UtilRemoveQuotes(pattern_str); + pattern_len = strlen(pattern_str); + + sprintf(execDummyStr, "%s=", attr_name); + attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, &attr_owner_obj); + if (attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); + + sprintf(execDummyStr, "%s=", src_attr_name); + src_attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, NULL); + if (src_attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); + + sprintf(execDummyStr, "%s=", replace_attr_name); + replace_attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, NULL); + if (replace_attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); + + sprintf(tmp_fname, "%sTgifXXXXXX", TMP_DIR); + mktemp(tmp_fname); + unlink(tmp_fname); + if ((fp=fopen(tmp_fname, "w")) == NULL) { + sprintf(gszMsgBox, "Fail to open '%s' for write %s '%s' command.", + tmp_fname, "while executing the", orig_cmd); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + return FALSE; + } + writeFileFailed = FALSE; + for (src_str_ptr=src_attr_ptr->obj->detail.t->first; + src_str_ptr != NULL; src_str_ptr=src_str_ptr->next) { + char *c_ptr, *buf=NULL; + + if (src_str_ptr==src_attr_ptr->obj->detail.t->first) { + buf = src_attr_ptr->attr_value.s; + } else { + buf = src_str_ptr->dyn_str.s; + } + for (c_ptr=strstr(buf, pattern_str); c_ptr != NULL; + c_ptr=strstr(buf, pattern_str)) { + char saved_ch=(*c_ptr), *buf1; + struct StrRec *replace_str_ptr; + + *c_ptr = '\0'; + if (fprintf(fp, "%s", buf) == EOF) { + writeFileFailed = TRUE; + } + for (replace_str_ptr=replace_attr_ptr->obj->detail.t->first; + replace_str_ptr != NULL; replace_str_ptr=replace_str_ptr->next) { + if (replace_str_ptr==replace_attr_ptr->obj->detail.t->first) { + buf1 = replace_attr_ptr->attr_value.s; + } else { + buf1 = replace_str_ptr->dyn_str.s; + } + if (fprintf(fp, "%s%s", buf1, + replace_str_ptr->next==NULL ? "" : "\n") == EOF) { + writeFileFailed = TRUE; + } + } + *c_ptr = saved_ch; + buf = (&c_ptr[pattern_len]); + } + if (buf != NULL) { + if (fprintf(fp, "%s\n", buf) == EOF) { + writeFileFailed = TRUE; + } + } + } + fclose(fp); + if (writeFileFailed) { + sprintf(gszMsgBox, "Fail to write to '%s' %s '%s' command.\n\n%s.", + tmp_fname, "while executing the", orig_cmd, + "File system may be full"); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + unlink(tmp_fname); + return FALSE; + } + SaveStatusStrings(); + rc = JustReadFileIntoAttr(attr_ptr, attr_owner_obj, tmp_fname, orig_cmd); + RestoreStatusStrings(); + unlink(tmp_fname); + return rc; + } + + int ExecGetFileSize(argv, obj_ptr, orig_cmd) + char **argv, *orig_cmd; + struct ObjRec *obj_ptr; + /* get_file_size(attr_name,file_name); */ + { + char *attr_name=argv[0], *file_name=argv[1], buf[40]; + struct AttrRec *attr_ptr=NULL; + struct ObjRec *attr_owner_obj=NULL; + struct stat stat_buf; + + UtilRemoveQuotes(attr_name); + UtilRemoveQuotes(file_name); + + sprintf(execDummyStr, "%s=", attr_name); + attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, &attr_owner_obj); + if (attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); + + if (stat(file_name, &stat_buf) != 0) { + sprintf(gszMsgBox, "Fail to get info for '%s' %s '%s' command.", + file_name, "while executing the", orig_cmd); + MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); + return FALSE; + } + sprintf(buf, "%ld", (long)stat_buf.st_size); + ReplaceAttrFirstValue(attr_owner_obj, attr_ptr, buf); + return TRUE; + } + + int ExecIsFile(argv, obj_ptr, orig_cmd) + char **argv, *orig_cmd; + struct ObjRec *obj_ptr; + /* is_file(attr_name,file_name); */ + { + char *attr_name=argv[0], *file_name=argv[1], buf[40]; + struct AttrRec *attr_ptr=NULL; + struct ObjRec *attr_owner_obj=NULL; + struct stat stat_buf; + FILE *fp; + + UtilRemoveQuotes(attr_name); + UtilRemoveQuotes(file_name); + + sprintf(execDummyStr, "%s=", attr_name); + attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, &attr_owner_obj); + if (attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); + + if ((fp=fopen(file_name, "r")) != NULL) { + fclose(fp); + strcpy(buf, "1"); + } else { + strcpy(buf, "0"); + } + ReplaceAttrFirstValue(attr_owner_obj, attr_ptr, buf); return TRUE; } *** file.c.orig Thu Dec 26 01:10:27 1996 --- file.c Thu Dec 26 01:10:27 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/file.c,v 3.13 1996/10/30 05:10:22 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/file.c,v 3.17 1996/12/17 21:25:41 william Exp $"; #endif *************** *** 199,202 **** --- 199,205 ---- int cmdLineRequestedColor=FALSE; + int cmdLineDumpURL=FALSE; + int cmdLineDumpURLWithHeader=FALSE; + int showPageInEPS=FALSE; *************** *** 208,211 **** --- 211,216 ---- char *myFileBgGifURL=NULL; + int dumpOneFilePerPage=FALSE; + static int importingPageNum=(-1); static char importingPageName[MAXSTRING+1]; *************** *** 2817,2821 **** } if (content_type != NULL) FreeRemoteBuf(content_type); ! if (page_spec != NULL) free(page_spec); if (*tmp_gif_fname != '\0') unlink(tmp_gif_fname); } else { --- 2822,2826 ---- } if (content_type != NULL) FreeRemoteBuf(content_type); ! if (page_spec != NULL) UtilFree(page_spec); if (*tmp_gif_fname != '\0') unlink(tmp_gif_fname); } else { *************** *** 3159,3163 **** static int dumpOnePageInTileMode=FALSE; static int dumpOnePageInStackMode=FALSE; - static int dumpOneFilePerPage=FALSE; static FILE * dumpFP=NULL; --- 3164,3167 ---- *************** *** 3828,3834 **** SetStringStatus("...Done"); ! stat (tmp_fname, &stat_buf); tmp_bytes = (long)stat_buf.st_size; ! stat (tiff_fname, &stat_buf); tiff_bytes = (long)stat_buf.st_size; --- 3832,3848 ---- SetStringStatus("...Done"); ! if (stat(tmp_fname, &stat_buf) != 0) { ! sprintf(gszMsgBox, "Fail to get file info for '%s'.\n\n%s!", ! tmp_fname, "EPSI file not generated!"); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! return; ! } tmp_bytes = (long)stat_buf.st_size; ! if (stat(tiff_fname, &stat_buf) != 0) { ! sprintf(gszMsgBox, "Fail to get file info for '%s'.\n\n%s!", ! tiff_fname, "EPSI file not generated!"); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! return; ! } tiff_bytes = (long)stat_buf.st_size; *** font.c.orig Thu Dec 26 01:10:29 1996 --- font.c Thu Dec 26 01:10:30 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/font.c,v 3.3 1996/10/28 01:20:56 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/font.c,v 3.5 1996/12/25 16:39:09 william Exp $"; #endif *************** *** 1425,1460 **** } ! static int pushedFont, pushedSize, pushedStyle, pushedJust; ! static int pushedColorIndex, pushedRotate, pushedPen, pushedVSpace; ! static int pushedFill, pushedUnderlineOn, pushedUnderline; void PushCurFont() { ! pushedFont = curFont; ! pushedSize = curSize; ! pushedStyle = curStyle; ! pushedJust = textJust; ! pushedRotate = curRotate; ! pushedPen = penPat; ! pushedFill = objFill; ! pushedVSpace = textVSpace; ! pushedColorIndex = colorIndex; ! pushedUnderlineOn = curUnderlineOn; ! pushedUnderline = curUnderline; } void PopCurFont() { ! curFont = pushedFont; ! curSize = pushedSize; ! curStyle = pushedStyle; ! textJust = pushedJust; ! curRotate = pushedRotate; ! penPat = pushedPen; ! objFill = pushedFill; ! textVSpace = pushedVSpace; ! colorIndex = pushedColorIndex; ! curUnderlineOn = pushedUnderlineOn; ! curUnderline = pushedUnderline; SetCanvasFont(); --- 1425,1504 ---- } ! typedef struct PushedFontRec { ! int font; ! int size; ! int style; ! int just; ! int rotate; ! int pen; ! int fill; ! int v_space; ! int color; ! int underline_on; ! int underline; ! struct PushedFontRec *next; ! } * PushedFontRecPtr; ! ! static struct PushedFontRec *topPushedFontStk=NULL; void PushCurFont() { ! struct PushedFontRec *pushed_font_ptr=(struct PushedFontRec *)malloc( ! sizeof(struct PushedFontRec)); ! ! if (pushed_font_ptr == NULL) FailAllocMessage(); ! ! memset(pushed_font_ptr, 0, sizeof(struct PushedFontRec)); ! pushed_font_ptr->next = topPushedFontStk; ! pushed_font_ptr->font = curFont; ! pushed_font_ptr->size = curSize; ! pushed_font_ptr->style = curStyle; ! pushed_font_ptr->just = textJust; ! pushed_font_ptr->rotate = curRotate; ! pushed_font_ptr->pen = penPat; ! pushed_font_ptr->fill = objFill; ! pushed_font_ptr->v_space = textVSpace; ! pushed_font_ptr->color = colorIndex; ! pushed_font_ptr->underline_on = curUnderlineOn; ! pushed_font_ptr->underline = curUnderline; ! topPushedFontStk = pushed_font_ptr; } void PopCurFont() { ! struct PushedFontRec *pushed_font_ptr=NULL; ! ! if (topPushedFontStk == NULL) { ! Msg("Possible fatal error. Please read the terminal error output."); ! fprintf(stderr, "Warning: empty stack in PopCurFont().\n"); ! fprintf(stderr, "Safest thing to do is to save and exit.\n"); ! fprintf(stderr, "Please try to reproduce this error and\n"); ! fprintf(stderr, "\tsend bug report to william@cs.ucla.edu.\n"); ! sprintf(gszMsgBox, "%s.\n\n%s.\n\n%s %s.", ! "Warning: empty stack in PopCurFont()", ! "Safest thing to do is to save and exit", ! "Please try to reproduce this error and", ! "send bug report to william@cs.ucla.edu"); ! MsgBox(gszMsgBox, TOOL_NAME, STOP_MB); ! XFlush(mainDisplay); ! XSync(mainDisplay, False); ! return; ! } ! pushed_font_ptr = topPushedFontStk->next; ! ! curFont = topPushedFontStk->font; ! curSize = topPushedFontStk->size; ! curStyle = topPushedFontStk->style; ! textJust = topPushedFontStk->just; ! curRotate = topPushedFontStk->rotate; ! penPat = topPushedFontStk->pen; ! objFill = topPushedFontStk->fill; ! textVSpace = topPushedFontStk->v_space; ! colorIndex = topPushedFontStk->color; ! curUnderlineOn = topPushedFontStk->underline_on; ! curUnderline = topPushedFontStk->underline; ! ! free(topPushedFontStk); ! topPushedFontStk = pushed_font_ptr; SetCanvasFont(); *************** *** 1464,1479 **** int which, value; { switch(which) { ! case PUSH_FONT: pushedFont = value; break; ! case PUSH_SIZE: pushedSize = value; break; ! case PUSH_STYLE: pushedStyle = value; break; ! case PUSH_JUST: pushedJust = value; break; ! case PUSH_ROTATE: pushedRotate = value; break; ! case PUSH_PEN: pushedPen = value; break; ! case PUSH_FILL: pushedFill = value; break; ! case PUSH_VSPACE: pushedVSpace = value; break; ! case PUSH_COLORINDEX: pushedColorIndex = value; break; ! case PUSH_UNDERLINEON: pushedUnderlineOn = value; break; ! case PUSH_UNDERLINE: pushedUnderline = value; break; } } --- 1508,1539 ---- int which, value; { + if (topPushedFontStk == NULL) { + Msg("Possible fatal error. Please read the terminal error output."); + fprintf(stderr, "Warning: empty stack in SetPushedFontValue().\n"); + fprintf(stderr, "Safest thing to do is to save and exit.\n"); + fprintf(stderr, "Please try to reproduce this error and\n"); + fprintf(stderr, "\tsend bug report to william@cs.ucla.edu.\n"); + sprintf(gszMsgBox, "%s.\n\n%s.\n\n%s %s.", + "Warning: empty stack in SetPushedFontValue()", + "Safest thing to do is to save and exit", + "Please try to reproduce this error and", + "send bug report to william@cs.ucla.edu"); + MsgBox(gszMsgBox, TOOL_NAME, STOP_MB); + XFlush(mainDisplay); + XSync(mainDisplay, False); + return; + } switch(which) { ! case PUSH_FONT: topPushedFontStk->font = value; break; ! case PUSH_SIZE: topPushedFontStk->size = value; break; ! case PUSH_STYLE: topPushedFontStk->style = value; break; ! case PUSH_JUST: topPushedFontStk->just = value; break; ! case PUSH_ROTATE: topPushedFontStk->rotate = value; break; ! case PUSH_PEN: topPushedFontStk->pen = value; break; ! case PUSH_FILL: topPushedFontStk->fill = value; break; ! case PUSH_VSPACE: topPushedFontStk->v_space = value; break; ! case PUSH_COLORINDEX: topPushedFontStk->color = value; break; ! case PUSH_UNDERLINEON: topPushedFontStk->underline_on = value; break; ! case PUSH_UNDERLINE: topPushedFontStk->underline = value; break; } } *************** *** 1565,1568 **** --- 1625,1629 ---- UpdCurTextBBox(); RedrawCurText(); + SetFileModified(TRUE); if (cycleThroughChoice) { SetPushedFontValue(PUSH_STYLE, curStyle); *************** *** 1663,1666 **** --- 1724,1728 ---- curTextModified = TRUE; UpdCurTextBBox(); + SetFileModified(TRUE); ClearAndRedrawDrawWindow(); if (cycleThroughChoice) { *************** *** 1853,1856 **** --- 1915,1919 ---- UpdCurTextBBox(); RedrawCurText(); + SetFileModified(TRUE); if (cycleThroughChoice) { SetPushedFontValue(PUSH_SIZE, curSize); *************** *** 2011,2014 **** --- 2074,2078 ---- UpdCurTextBBox(); RedrawCurText(); + SetFileModified(TRUE); if (cycleThroughChoice) { SetPushedFontValue(PUSH_FONT, curFont); *************** *** 2152,2155 **** --- 2216,2220 ---- UpdCurTextBBox(); RedrawCurText(); + SetFileModified(TRUE); if (cycleThroughChoice) { SetPushedFontValue(PUSH_VSPACE, textVSpace); *** ftp.c.orig Thu Dec 26 01:10:31 1996 --- ftp.c Thu Dec 26 01:10:31 1996 *************** *** 34,38 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/ftp.c,v 3.0 1996/05/06 16:05:17 william Exp $"; #endif --- 34,38 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/ftp.c,v 3.1 1996/11/29 23:54:19 william Exp $"; #endif *************** *** 60,64 **** #include "util.e" ! static int debugFtp=FALSE; static int gnReadyToReceiveData=FALSE; --- 60,65 ---- #include "util.e" ! int debugFtp=0; ! static int gnReadyToReceiveData=FALSE; *************** *** 151,155 **** FILE *fp=stdout; ! if (debugFtp) fprintf(fp, "In %s:\n", func_name); while (c_ptr != NULL) { char *prev_ptr=c_ptr; --- 152,156 ---- FILE *fp=stdout; ! if (debugFtp > 0) fprintf(fp, "In %s:\n", func_name); while (c_ptr != NULL) { char *prev_ptr=c_ptr; *************** *** 161,165 **** *c_ptr = '\0'; } ! if (debugFtp) fprintf(fp, " %s\n", line_ptr); if (prev_ptr == NULL) { *c_ptr = '\n'; --- 162,166 ---- *c_ptr = '\0'; } ! if (debugFtp > 0) fprintf(fp, " %s\n", line_ptr); if (prev_ptr == NULL) { *c_ptr = '\n'; *************** *** 175,182 **** if (len > 0 && line_ptr[len-1] == '\r') { line_ptr[len-1] = '\0'; ! if (debugFtp) fprintf(fp, " %s\n", line_ptr); line_ptr[len-1] = '\r'; } else { ! if (debugFtp) fprintf(fp, " %s\n", line_ptr); } } --- 176,183 ---- if (len > 0 && line_ptr[len-1] == '\r') { line_ptr[len-1] = '\0'; ! if (debugFtp > 0) fprintf(fp, " %s\n", line_ptr); line_ptr[len-1] = '\r'; } else { ! if (debugFtp > 0) fprintf(fp, " %s\n", line_ptr); } } *** grid.c.orig Thu Dec 26 01:10:32 1996 --- grid.c Thu Dec 26 01:10:32 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/grid.c,v 3.5 1996/10/30 19:36:46 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/grid.c,v 3.6 1996/11/02 23:35:06 william Exp $"; #endif *************** *** 79,82 **** --- 79,84 ---- int queryZoomInPoint=FALSE; + static int zoomInDontRedraw=FALSE; + char * layoutMenuStr[] = { "+Grid #i", *************** *** 779,793 **** UpdDrawWinBBox (); ! SetWatchCursor (drawWindow); ! SetWatchCursor (mainWindow); ! RedrawRulers (); ! RedrawScrollBars (); ! AdjSplineVs (); ! AdjCaches (); ! ShowZoom (); ! /* use to be ClearAndRedrawDrawWindowDontDrawCurText() */ ! ClearAndRedrawDrawWindowNoCurT (); ! SetDefaultCursor (mainWindow); ! ShowCursor (); justDupped = FALSE; } --- 781,797 ---- UpdDrawWinBBox (); ! if (!zoomInDontRedraw) { ! SetWatchCursor (drawWindow); ! SetWatchCursor (mainWindow); ! RedrawRulers (); ! RedrawScrollBars (); ! AdjSplineVs (); ! AdjCaches (); ! ShowZoom (); ! /* use to be ClearAndRedrawDrawWindowDontDrawCurText() */ ! ClearAndRedrawDrawWindowNoCurT (); ! SetDefaultCursor (mainWindow); ! ShowCursor (); ! } justDupped = FALSE; } *************** *** 984,987 **** --- 988,1000 ---- PostZoom(xc, yc); if (curChoice==DRAWTEXT && textCursorShown) PostZoomCurText(xc, yc); + } + + void CenterAtCursor(abs_x, abs_y) + int abs_x, abs_y; + { + zoomInDontRedraw = TRUE; + ZoomInAtCursor(abs_x, abs_y); + zoomInDontRedraw = FALSE; + ZoomOut(); } *** help.c.orig Thu Dec 26 01:10:33 1996 --- help.c Thu Dec 26 01:10:33 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/help.c,v 3.0 1996/05/06 16:05:28 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/help.c,v 3.1 1996/11/29 22:17:46 william Exp $"; #endif *************** *** 103,107 **** static char *gszCopyright[] = { - "Copyright (C) 1990-1996, William Chia-Wei Cheng", "", "William Cheng (\"Author\") grants to the party hereby receiving \"tgif\"", --- 103,106 ---- *************** *** 131,134 **** --- 130,135 ---- char **s_ptr=gszCopyright, *c_ptr=gszMsgBox; + sprintf(c_ptr, "%s ", copyrightString); + c_ptr = (&gszMsgBox[strlen(c_ptr)]); for ( ; *s_ptr != NULL; s_ptr++) { if (**s_ptr == '\0') { *** http.c.orig Thu Dec 26 01:10:35 1996 --- http.c Thu Dec 26 01:10:35 1996 *************** *** 34,38 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/http.c,v 3.2 1996/10/31 06:40:41 william Exp $"; #endif --- 34,38 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/http.c,v 3.4 1996/11/29 23:08:26 william Exp $"; #endif *************** *** 57,60 **** --- 57,61 ---- #include "patchlvl.h" + #include "file.e" #ifndef _NO_EXTERN #include "http.e" *************** *** 66,69 **** --- 67,72 ---- #include "version.e" + int debugHttp=0; + typedef struct TgifHttpLineInfo { char *name; *************** *** 103,108 **** static char SZ_USER_NAME[128]; - static int debugHttp=0; - void HttpFreeBuf(buf) char *buf; --- 106,109 ---- *************** *** 908,912 **** *c_ptr = '\0'; } ! if (debugHttp > 0) fprintf(fp, "%s\n", line_ptr); rc = HttpParseHeaderLine(line_ptr, first_line); if (rc != TG_REMOTE_STATUS_OK) { --- 909,918 ---- *c_ptr = '\0'; } ! if (debugHttp > 0) { ! if (debugHttp == 99 && cmdLineDumpURL && !cmdLineDumpURLWithHeader) { ! } else { ! fprintf(fp, "%s\n", line_ptr); ! } ! } rc = HttpParseHeaderLine(line_ptr, first_line); if (rc != TG_REMOTE_STATUS_OK) { *************** *** 1062,1068 **** sprintf(msg, "HTTP: responses received."); if (debugHttp == 99) { ! fprintf(stdout, "\n==========>>>\n"); ! fwrite(buf, sizeof(char), len, stdout); ! fprintf(stdout, "\n<<<==========\n"); } } else { --- 1068,1076 ---- sprintf(msg, "HTTP: responses received."); if (debugHttp == 99) { ! if (!cmdLineDumpURL) { ! fprintf(stdout, "\n==========>>>\n"); ! fwrite(buf, sizeof(char), len, stdout); ! fprintf(stdout, "\n<<<==========\n"); ! } } } else { *** import.c.orig Thu Dec 26 01:10:36 1996 --- import.c Thu Dec 26 01:10:36 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/import.c,v 3.4 1996/10/30 06:34:42 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/import.c,v 3.6 1996/11/03 20:31:10 william Exp $"; #endif *************** *** 424,432 **** if (rc != BitmapSuccess) { if (short_name) { ! sprintf(s, "Cannot import XBitmap file '%s'.", rest); } else { ! sprintf(s, "Cannot import XBitmap file '%s'.", file_name); } ! Msg(s); importingFile = FALSE; return; --- 424,432 ---- if (rc != BitmapSuccess) { if (short_name) { ! sprintf(gszMsgBox, "Cannot import XBitmap file '%s'.", rest); } else { ! sprintf(gszMsgBox, "Cannot import XBitmap file '%s'.", file_name); } ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); importingFile = FALSE; return; *************** *** 538,546 **** if (rc != BitmapSuccess) { if (short_name) { ! sprintf(s, "Cannot import XPixmap file '%s'.", rest); } else { ! sprintf(s, "Cannot import XPixmap file '%s'.", file_name); } ! Msg(s); importingFile = FALSE; return; --- 538,546 ---- if (rc != BitmapSuccess) { if (short_name) { ! sprintf(gszMsgBox, "Cannot import XPixmap file '%s'.", rest); } else { ! sprintf(gszMsgBox, "Cannot import XPixmap file '%s'.", file_name); } ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); importingFile = FALSE; return; *************** *** 1348,1358 **** sprintf(name, "%s/%s", DirName, d->d_name); ! stat(name, &stat_buf); ! if (stat_buf.st_mode & S_IFDIR) { int skip=FALSE; #ifndef _NO_LSTAT ! lstat(name, &stat_buf); ! if (stat_buf.st_mode & S_IFLNK) { sprintf(gszMsgBox, "Skipping %s because it's a link.", &name[savedDirNameLen+1]); --- 1348,1356 ---- sprintf(name, "%s/%s", DirName, d->d_name); ! if (stat(name, &stat_buf) == 0 && (stat_buf.st_mode & S_IFDIR)) { int skip=FALSE; #ifndef _NO_LSTAT ! if (lstat(name, &stat_buf) == 0 && (stat_buf.st_mode & S_IFLNK)) { sprintf(gszMsgBox, "Skipping %s because it's a link.", &name[savedDirNameLen+1]); *** mainloop.c.orig Thu Dec 26 01:10:37 1996 --- mainloop.c Thu Dec 26 01:10:37 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/mainloop.c,v 3.4 1996/10/30 21:18:54 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/mainloop.c,v 3.7 1996/12/25 17:12:45 william Exp $"; #endif *************** *** 56,65 **** --- 56,68 ---- #include "dialog.e" #include "drawing.e" + #include "edit.e" #include "exec.e" #include "expr.e" #include "file.e" #include "font.e" + #include "ftp.e" #include "grid.e" #include "help.e" + #include "http.e" #include "imgproc.e" #include "import.e" *************** *** 261,264 **** --- 264,268 ---- ResetPSInfo (); + CleanUpEdit (); CleanUpShape (); CleanUpHelp (); *************** *** 404,408 **** #ifdef USE_XAPPLRESDIR - #ifndef XAPPLOADDIR_DEF static int FindXApplResDir(psz_srch_path, psz_target_dir, cb_target_dir) --- 408,411 ---- *************** *** 430,434 **** return FALSE; } - #endif /* ~XAPPLOADDIR_DEF */ #endif /* USE_XAPPLRESDIR */ --- 433,436 ---- *************** *** 465,470 **** sprintf (initMsg2, "%s %s", copyrightString, "(william@cs.UCLA.edu)"); TwoLineMsg (initMsg1, initMsg2); ! fprintf (stderr, "%s\n", initMsg1); ! fprintf (stderr, "%s\n", initMsg2); fflush(stderr); --- 467,474 ---- sprintf (initMsg2, "%s %s", copyrightString, "(william@cs.UCLA.edu)"); TwoLineMsg (initMsg1, initMsg2); ! if (!cmdLineDumpURL) { ! fprintf (stderr, "%s\n", initMsg1); ! fprintf (stderr, "%s\n", initMsg2); ! } fflush(stderr); *************** *** 475,482 **** if (getenv ("XENVIRONMENT") == NULL) { ! if (((c_ptr=getenv("XAPPLRESDIR")) == NULL) || (*c_ptr == '\0')) { UtilStrCpy(tmp_buf, sizeof(tmp_buf), XAPPLOADDIR_DEF); - c_ptr = tmp_buf;; } len = strlen(c_ptr); #else /* ~XAPPLOADDIR_DEF */ --- 479,488 ---- if (getenv ("XENVIRONMENT") == NULL) { ! if (((c_ptr=getenv("XAPPLRESDIR")) == NULL)) { ! UtilStrCpy(tmp_buf, sizeof(tmp_buf), XAPPLOADDIR_DEF); ! } else if (!FindXApplResDir(c_ptr, tmp_buf, sizeof(tmp_buf)) { UtilStrCpy(tmp_buf, sizeof(tmp_buf), XAPPLOADDIR_DEF); } + c_ptr = tmp_buf; len = strlen(c_ptr); #else /* ~XAPPLOADDIR_DEF */ *************** *** 486,490 **** { if (FindXApplResDir(c_ptr, tmp_buf, sizeof(tmp_buf))) { ! c_ptr = tmp_buf;; } len = strlen(c_ptr); --- 492,496 ---- { if (FindXApplResDir(c_ptr, tmp_buf, sizeof(tmp_buf))) { ! c_ptr = tmp_buf; } len = strlen(c_ptr); *************** *** 1087,1090 **** --- 1093,1134 ---- } } + } + + void UrlDump(pszUrl) + char *pszUrl; + { + int saved_http_debug=debugHttp; + int saved_ftp_debug=debugFtp; + + debugHttp = 99; + debugFtp = (-99); + + if (FileIsRemote(pszUrl)) { + char tmp_fname[MAXPATHLENGTH+1], *content_type=NULL, *page_spec=NULL; + int is_html=FALSE; + + *tmp_fname = '\0'; + DownloadRemoteFile(pszUrl, &content_type, &page_spec, + &is_html, tmp_fname, NULL, 0); + if (content_type != NULL) FreeRemoteBuf(content_type); + if (page_spec != NULL) UtilFree(page_spec); + if (*tmp_fname != '\0') unlink(tmp_fname); + } else { + FILE *fp=fopen(pszUrl, "r"); + + if (fp == NULL) { + fprintf(stderr, "Cannot open '%s' for reading.\n", pszUrl); + } else { + char *buf; + + while ((buf=UtilGetALine(fp)) != NULL) { + fprintf(stdout, "%s\n", buf); + UtilFree(buf); + } + fclose(fp); + } + } + debugHttp = saved_http_debug; + debugFtp = saved_ftp_debug; } *** move.c.orig Thu Dec 26 01:10:39 1996 --- move.c Thu Dec 26 01:10:39 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/move.c,v 3.1 1996/05/24 22:37:25 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/move.c,v 3.2 1996/11/30 01:35:40 william Exp $"; #endif *************** *** 378,389 **** v = obj_ptr->detail.p->vlist; ! x_off = OFFSET_X(v[0].x); y_off = OFFSET_Y(v[0].y); ! move_first = EndPtInSelected (x_off, y_off); ! x_off = OFFSET_X(v[num_pts-1].x); y_off = OFFSET_Y(v[num_pts-1].y); ! move_last = EndPtInSelected (x_off, y_off); if (move_first || move_last) { PrepareToReplaceAnObj (obj_ptr); if (something_stretched) { --- 378,423 ---- v = obj_ptr->detail.p->vlist; ! if (obj_ptr->ctm == NULL) { ! x_off = OFFSET_X(v[0].x); y_off = OFFSET_Y(v[0].y); ! move_first = EndPtInSelected (x_off, y_off); ! x_off = OFFSET_X(v[num_pts-1].x); y_off = OFFSET_Y(v[num_pts-1].y); ! move_last = EndPtInSelected (x_off, y_off); ! } else { ! int tmp_x, tmp_y; ! ! TransformPointThroughCTM(v[0].x-obj_ptr->x, v[0].y-obj_ptr->y, ! obj_ptr->ctm, &tmp_x, &tmp_y); ! tmp_x += obj_ptr->x; ! tmp_y += obj_ptr->y; ! x_off = OFFSET_X(tmp_x); y_off = OFFSET_Y(tmp_y); ! move_first = EndPtInSelected (x_off, y_off); ! TransformPointThroughCTM(v[num_pts-1].x-obj_ptr->x, ! v[num_pts-1].y-obj_ptr->y, obj_ptr->ctm, &tmp_x, &tmp_y); ! tmp_x += obj_ptr->x; ! tmp_y += obj_ptr->y; ! x_off = OFFSET_X(tmp_x); y_off = OFFSET_Y(tmp_y); ! move_last = EndPtInSelected (x_off, y_off); ! } if (move_first || move_last) { PrepareToReplaceAnObj (obj_ptr); + + if (obj_ptr->ctm != NULL) { + /* Remove the transformations! */ + int i; + + for (i=0; i < num_pts; i++) { + int tmp_x, tmp_y; + + TransformPointThroughCTM(v[i].x-obj_ptr->x, v[i].y-obj_ptr->y, + obj_ptr->ctm, &tmp_x, &tmp_y); + v[i].x = tmp_x+obj_ptr->x; + v[i].y = tmp_y+obj_ptr->y; + } + free(obj_ptr->ctm); + obj_ptr->ctm = NULL; + UpdPolyBBox(obj_ptr, num_pts, v); + } if (something_stretched) { *** msg.c.orig Thu Dec 26 01:10:40 1996 --- msg.c Thu Dec 26 01:10:40 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/msg.c,v 3.4 1996/10/30 22:06:59 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/msg.c,v 3.5 1996/11/29 22:58:54 william Exp $"; #endif *************** *** 925,928 **** --- 925,929 ---- fprintf (stderr, "\t[-ps] [-f] \\\n"); fprintf (stderr, "\t[-text] \\\n"); + fprintf (stderr, "\t[--[h]] \\\n"); fprintf (stderr, "\t[-gray] \\\n"); fprintf (stderr, "\t[-color | -reqcolor] \\\n"); *************** *** 945,959 **** { char *c_ptr; cmdLineOneFilePerPage = FALSE; ! if (TGIF_PATCHLEVEL == 0) { ! fprintf(stderr, "%s Version %s\n", TOOL_NAME, versionString); ! } else { ! fprintf(stderr, "%s Version %s (patchlevel %1d)\n", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL); } - fprintf(stderr, "Copyright (C) 1990-1996, %s\n\n", "William Chia-Wei Cheng"); - fflush(stderr); - if (!from_prtgif) { if ((c_ptr=getenv("TGIFPATH")) == NULL) --- 946,976 ---- { char *c_ptr; + int saved_argc=argc; + char **saved_argv=argv; cmdLineOneFilePerPage = FALSE; ! for (argc--, argv++; argc > 0; argc--, argv++) { ! if (**argv == '-') { ! if (strcmp(*argv, "-raw") == 0) { ! cmdLineDumpURL = TRUE; ! cmdLineDumpURLWithHeader = FALSE; ! } else if (strcmp(*argv, "-raw+h") == 0) { ! cmdLineDumpURL = TRUE; ! cmdLineDumpURLWithHeader = TRUE; ! } ! } ! } ! argc = saved_argc; ! argv = saved_argv; ! if (!cmdLineDumpURL) { ! if (TGIF_PATCHLEVEL == 0) { ! fprintf(stderr, "%s Version %s\n", TOOL_NAME, versionString); ! } else { ! fprintf(stderr, "%s Version %s (patchlevel %1d)\n", TOOL_NAME, ! versionString, TGIF_PATCHLEVEL); ! } ! fprintf(stderr, "%s\n\n", copyrightString); ! fflush(stderr); } if (!from_prtgif) { if ((c_ptr=getenv("TGIFPATH")) == NULL) *************** *** 998,1001 **** --- 1015,1024 ---- } else if (strcmp(*argv, "-text") == 0) { whereToPrint = TEXT_FILE; + } else if (strcmp(*argv, "-raw") == 0) { + cmdLineDumpURL = TRUE; + cmdLineDumpURLWithHeader = FALSE; + } else if (strcmp(*argv, "-raw+h") == 0) { + cmdLineDumpURL = TRUE; + cmdLineDumpURLWithHeader = TRUE; } else if (strcmp(*argv, "-page") == 0) { argc--; argv++; *** names.c.orig Thu Dec 26 01:10:42 1996 --- names.c Thu Dec 26 01:10:42 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/names.c,v 3.2 1996/10/30 22:10:13 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/names.c,v 3.4 1996/11/03 20:20:11 william Exp $"; #endif *************** *** 405,419 **** } else { sprintf(s, "%s%s", path, d->d_name); ! stat(s, &stat_buf); ! dsp_ptr = (DspList*)malloc(sizeof(DspList)); ! if (dsp_ptr == NULL) FailAllocMessage(); ! memset(dsp_ptr, 0, sizeof(DspList)); ! if (stat_buf.st_mode & S_IFDIR) { ! dsp_ptr->directory = TRUE; ! strcat(d->d_name, "/"); } else { ! dsp_ptr->directory = FALSE; } - UtilStrCpy(dsp_ptr->itemstr, sizeof(dsp_ptr->itemstr), d->d_name); } } else if (ExtensionMatch(ext_str, d->d_name)) { --- 405,425 ---- } else { sprintf(s, "%s%s", path, d->d_name); ! if (stat(s, &stat_buf) != 0) { ! sprintf(gszMsgBox, "Fail to stat '%s'.", s); ! Msg(gszMsgBox); ! continue; } else { ! dsp_ptr = (DspList*)malloc(sizeof(DspList)); ! if (dsp_ptr == NULL) FailAllocMessage(); ! memset(dsp_ptr, 0, sizeof(DspList)); ! if (stat_buf.st_mode & S_IFDIR) { ! dsp_ptr->directory = TRUE; ! strcat(d->d_name, "/"); ! } else { ! dsp_ptr->directory = FALSE; ! } ! UtilStrCpy(dsp_ptr->itemstr, sizeof(dsp_ptr->itemstr), ! d->d_name); } } } else if (ExtensionMatch(ext_str, d->d_name)) { *************** *** 437,442 **** } else { sprintf(s, "%s%s", path, d->d_name); ! stat(s, &stat_buf); ! if (stat_buf.st_mode & S_IFDIR) { dsp_ptr = (DspList*)malloc(sizeof(DspList)); if (dsp_ptr == NULL) FailAllocMessage(); --- 443,451 ---- } else { sprintf(s, "%s%s", path, d->d_name); ! if (stat(s, &stat_buf) != 0) { ! sprintf(gszMsgBox, "Fail to stat '%s'.", s); ! Msg(gszMsgBox); ! continue; ! } else if (stat_buf.st_mode & S_IFDIR) { dsp_ptr = (DspList*)malloc(sizeof(DspList)); if (dsp_ptr == NULL) FailAllocMessage(); *** navigate.c.orig Thu Dec 26 01:10:43 1996 --- navigate.c Thu Dec 26 01:10:43 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/navigate.c,v 3.3 1996/10/30 05:09:58 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/navigate.c,v 3.4 1996/11/29 22:58:43 william Exp $"; #endif *************** *** 326,332 **** int update_lru; { ! char *simple_url_name=SimpleURLName(psz_url); struct URLCacheRec *url_cache; InitURLCache(); if (simple_url_name == NULL) return NULL; --- 326,335 ---- int update_lru; { ! char *simple_url_name=NULL; struct URLCacheRec *url_cache; + if (PRTGIF) return NULL; + + simple_url_name = SimpleURLName(psz_url); InitURLCache(); if (simple_url_name == NULL) return NULL; *************** *** 347,353 **** int remote_buf_sz, is_html; { ! char *simple_url_name=SimpleURLName(psz_url); struct URLCacheRec *url_cache; InitURLCache(); if (simple_url_name == NULL) return; --- 350,359 ---- int remote_buf_sz, is_html; { ! char *simple_url_name=NULL; struct URLCacheRec *url_cache; + if (PRTGIF) return; + + simple_url_name = SimpleURLName(psz_url); InitURLCache(); if (simple_url_name == NULL) return; *** pattern.c.orig Thu Dec 26 01:10:45 1996 --- pattern.c Thu Dec 26 01:10:45 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/pattern.c,v 3.2 1996/10/17 19:32:06 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/pattern.c,v 3.3 1996/12/25 16:39:09 william Exp $"; #endif *************** *** 316,319 **** --- 316,320 ---- UpdCurTextBBox(); RedrawCurText(); + SetFileModified(TRUE); if (cycleThroughChoice) { SetPushedFontValue(PUSH_FILL, objFill); *************** *** 1132,1135 **** --- 1133,1137 ---- UpdCurTextBBox(); RedrawCurText(); + SetFileModified(TRUE); if (cycleThroughChoice) { SetPushedFontValue(PUSH_PEN, penPat); *** remote.c.orig Thu Dec 26 01:10:47 1996 --- remote.c Thu Dec 26 01:10:47 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/remote.c,v 3.1 1996/10/30 05:09:19 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/remote.c,v 3.2 1996/11/29 23:54:31 william Exp $"; #endif *************** *** 365,368 **** --- 365,369 ---- char *psz_msg; { + if (PRTGIF) return; SetStringStatus(psz_msg); XSync(mainDisplay, False); *************** *** 608,611 **** --- 609,622 ---- *ppsz_buf = HttpExtractText(buf, pn_buf_sz, pn_html, ppsz_content_type); + if (*ppsz_buf != NULL && debugHttp == 99) { + /* + * Because of the way HttpExtractText() is coded, + * if *ppsz_buf != NULL, (*ppsz_buf)[*pn_buf_sz-1] is '\0' + * no matter what kind of file it is! + */ + if (cmdLineDumpURL) { + fwrite(*ppsz_buf, sizeof(char), (*pn_buf_sz)-1, stdout); + } + } if (pn_http_extracted_text != NULL) *pn_http_extracted_text = TRUE; FreeRemoteBuf(buf); *************** *** 703,706 **** --- 714,727 ---- *ppsz_buf = buf; if (pn_buf_sz != NULL) *pn_buf_sz = buf_sz; + if (*ppsz_buf != NULL && pn_buf_sz != NULL && debugFtp == -99) { + /* + * Because of the way FtpDoTalk() is coded, + * if *ppsz_buf != NULL, (*ppsz_buf)[*pn_buf_sz-1] is '\0' + * no matter what kind of file it is! + */ + if (cmdLineDumpURL) { + fwrite(*ppsz_buf, sizeof(char), (*pn_buf_sz)-1, stdout); + } + } sprintf(gszMsgBox, "FTP: data received."); ShowRemoteStatus(gszMsgBox); *** ruler.c.orig Thu Dec 26 01:10:49 1996 --- ruler.c Thu Dec 26 01:10:49 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/ruler.c,v 3.5 1996/10/30 22:54:09 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/ruler.c,v 3.6 1996/11/30 00:12:31 william Exp $"; #endif *************** *** 268,271 **** --- 268,297 ---- } + void PixelToMeasurementUnit(Buf, NumPixels) + char *Buf; + int NumPixels; + { + float fval; + int ival; + + if (*unitStr == '\0') { + sprintf(Buf, "%+1d", NumPixels); + } else { + fval = (float)((float)NumPixels*1000.0)/(gfPixelsPerUnit); + ival = ((int)round(fval)); + fval = ((float)ival)/((float)1000.0); + if (*formatUnitStr == '\0') { + sprintf(Buf, "%+.3f%s", fval, unitStr); + } else { + float frac; + + ival = (int)fval; + frac = ((ival >= 0) ? fval-((float)ival) : ((float)ival)-fval); + fval = (float)ival; + sprintf(Buf, formatUnitStr, fval, frac*gfNumFracUnits); + } + } + } + void RedrawHRuler () { *************** *** 699,728 **** frozenXOff = oldXOff; frozenYOff = oldYOff; - } - - void PixelToMeasurementUnit(Buf, NumPixels) - char *Buf; - int NumPixels; - { - float fval; - int ival; - - if (*unitStr == '\0') { - sprintf(Buf, "%+1d", NumPixels); - } else { - fval = (float)((float)NumPixels*1000.0)/(gfPixelsPerUnit); - ival = ((int)round(fval)); - fval = ((float)ival)/((float)1000.0); - if (*formatUnitStr == '\0') { - sprintf(Buf, "%+.3f%s", fval, unitStr); - } else { - float frac; - - ival = (int)fval; - frac = ((ival >= 0) ? fval-((float)ival) : ((float)ival)-fval); - fval = (float)ival; - sprintf(Buf, formatUnitStr, fval, frac*gfNumFracUnits); - } - } } --- 725,728 ---- *** setup.c.orig Thu Dec 26 01:10:50 1996 --- setup.c Thu Dec 26 01:10:50 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/setup.c,v 3.10 1996/10/31 04:42:20 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/setup.c,v 3.12 1996/12/22 20:23:43 william Exp $"; #endif *************** *** 990,993 **** --- 990,1008 ---- UtilStrICmp(c_ptr, "true") == 0) { stretchableText = TRUE; + } + + editTextSize = 0; + if ((c_ptr=XGetDefault(mainDisplay, TOOL_NAME, "EditTextSize")) != NULL) { + editTextSize = atoi(c_ptr); + if (editTextSize == 0) { + } else if (editTextSize < 4) { + fprintf (stderr, "Invalid %s*%s: '%s' (too small), 0 is used.\n", + TOOL_NAME, "EditTextSize", c_ptr); + editTextSize = 4; + } else if (editTextSize > 34) { + fprintf (stderr, "Invalid %s*%s: '%s' (too large), 34 is used.\n", + TOOL_NAME, "EditTextSize", c_ptr); + editTextSize = 34; + } } *** shortcut.c.orig Thu Dec 26 01:10:52 1996 --- shortcut.c Thu Dec 26 01:10:52 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/shortcut.c,v 3.6 1996/10/17 18:58:50 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/shortcut.c,v 3.9 1996/12/25 16:57:38 william Exp $"; #endif *************** *** 288,291 **** --- 288,297 ---- { '\0', 0, "Copyright()", 0, }, { '\0', 0, "SetSelFontSize()", 0, }, + { '\0', 0, "ZoomInAtCursor()", 0, }, + { '\0', 0, "CenterAtCursor()", 0, }, + { '\0', 0, "SetEditTextSize()", 0, }, + { '\0', 0, "FindCaseSensitive()", 0, }, + { '\0', 0, "FindNoCase()", 0, }, + { '\0', 0, "FindAgain()", 0, }, { '\0', 0, "", 0 } }; *** special.c.orig Thu Dec 26 01:10:54 1996 --- special.c Thu Dec 26 01:10:54 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/special.c,v 3.1 1996/05/24 22:37:52 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/special.c,v 3.2 1996/12/21 23:02:55 william Exp $"; #endif *************** *** 493,496 **** --- 493,505 ---- SetDefaultCursor (drawWindow); Msg (""); + + if (topSel != NULL && topSel == botSel && topSel->obj->type == OBJ_ICON) { + struct AttrRec *exec_attr=FindAttrWithName(topSel->obj, + "on_instantiate=", NULL); + + if (exec_attr != NULL) { + DoExecLoop(topSel->obj, exec_attr); + } + } } *** stretch.c.orig Thu Dec 26 01:10:56 1996 --- stretch.c Thu Dec 26 01:10:56 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/stretch.c,v 3.10 1996/10/30 23:01:24 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/stretch.c,v 3.11 1996/11/30 01:35:44 william Exp $"; #endif *************** *** 1349,1356 **** v = obj_ptr->detail.p->vlist; ! x_off = OFFSET_X(v[0].x); y_off = OFFSET_Y(v[0].y); ! move_first = EndPtInSelected (x_off, y_off); ! x_off = OFFSET_X(v[num_pts-1].x); y_off = OFFSET_Y(v[num_pts-1].y); ! move_last = EndPtInSelected (x_off, y_off); if (move_first || move_last) --- 1349,1373 ---- v = obj_ptr->detail.p->vlist; ! if (obj_ptr->ctm == NULL) { ! x_off = OFFSET_X(v[0].x); y_off = OFFSET_Y(v[0].y); ! move_first = EndPtInSelected (x_off, y_off); ! x_off = OFFSET_X(v[num_pts-1].x); y_off = OFFSET_Y(v[num_pts-1].y); ! move_last = EndPtInSelected (x_off, y_off); ! } else { ! int tmp_x, tmp_y; ! ! TransformPointThroughCTM(v[0].x-obj_ptr->x, v[0].y-obj_ptr->y, ! obj_ptr->ctm, &tmp_x, &tmp_y); ! tmp_x += obj_ptr->x; ! tmp_y += obj_ptr->y; ! x_off = OFFSET_X(tmp_x); y_off = OFFSET_Y(tmp_y); ! move_first = EndPtInSelected (x_off, y_off); ! TransformPointThroughCTM(v[num_pts-1].x-obj_ptr->x, ! v[num_pts-1].y-obj_ptr->y, obj_ptr->ctm, &tmp_x, &tmp_y); ! tmp_x += obj_ptr->x; ! tmp_y += obj_ptr->y; ! x_off = OFFSET_X(tmp_x); y_off = OFFSET_Y(tmp_y); ! move_last = EndPtInSelected (x_off, y_off); ! } if (move_first || move_last) *************** *** 1360,1363 **** --- 1377,1397 ---- PrepareToReplaceAnObj (obj_ptr); + + if (obj_ptr->ctm != NULL) { + /* Remove the transformations! */ + int i; + + for (i=0; i < num_pts; i++) { + int tmp_x, tmp_y; + + TransformPointThroughCTM(v[i].x-obj_ptr->x, v[i].y-obj_ptr->y, + obj_ptr->ctm, &tmp_x, &tmp_y); + v[i].x = tmp_x+obj_ptr->x; + v[i].y = tmp_y+obj_ptr->y; + } + free(obj_ptr->ctm); + obj_ptr->ctm = NULL; + UpdPolyBBox(obj_ptr, num_pts, v); + } if (something_stretched) { *************** *** 3117,3124 **** v = obj_ptr->detail.p->vlist; ! x_off = OFFSET_X(v[0].x); y_off = OFFSET_Y(v[0].y); ! move_first = EndPtInSelected (x_off, y_off); ! x_off = OFFSET_X(v[num_pts-1].x); y_off = OFFSET_Y(v[num_pts-1].y); ! move_last = EndPtInSelected (x_off, y_off); if (move_first || move_last) --- 3151,3175 ---- v = obj_ptr->detail.p->vlist; ! if (obj_ptr->ctm == NULL) { ! x_off = OFFSET_X(v[0].x); y_off = OFFSET_Y(v[0].y); ! move_first = EndPtInSelected (x_off, y_off); ! x_off = OFFSET_X(v[num_pts-1].x); y_off = OFFSET_Y(v[num_pts-1].y); ! move_last = EndPtInSelected (x_off, y_off); ! } else { ! int tmp_x, tmp_y; ! ! TransformPointThroughCTM(v[0].x-obj_ptr->x, v[0].y-obj_ptr->y, ! obj_ptr->ctm, &tmp_x, &tmp_y); ! tmp_x += obj_ptr->x; ! tmp_y += obj_ptr->y; ! x_off = OFFSET_X(tmp_x); y_off = OFFSET_Y(tmp_y); ! move_first = EndPtInSelected (x_off, y_off); ! TransformPointThroughCTM(v[num_pts-1].x-obj_ptr->x, ! v[num_pts-1].y-obj_ptr->y, obj_ptr->ctm, &tmp_x, &tmp_y); ! tmp_x += obj_ptr->x; ! tmp_y += obj_ptr->y; ! x_off = OFFSET_X(tmp_x); y_off = OFFSET_Y(tmp_y); ! move_last = EndPtInSelected (x_off, y_off); ! } if (move_first || move_last) *************** *** 3128,3131 **** --- 3179,3199 ---- PrepareToReplaceAnObj (obj_ptr); + + if (obj_ptr->ctm != NULL) { + /* Remove the transformations! */ + int i; + + for (i=0; i < num_pts; i++) { + int tmp_x, tmp_y; + + TransformPointThroughCTM(v[i].x-obj_ptr->x, v[i].y-obj_ptr->y, + obj_ptr->ctm, &tmp_x, &tmp_y); + v[i].x = tmp_x+obj_ptr->x; + v[i].y = tmp_y+obj_ptr->y; + } + free(obj_ptr->ctm); + obj_ptr->ctm = NULL; + UpdPolyBBox(obj_ptr, num_pts, v); + } if (something_stretched) { *************** *** 3710,3717 **** v = obj_ptr->detail.p->vlist; ! x_off = OFFSET_X(v[0].x); y_off = OFFSET_Y(v[0].y); ! move_first = EndPtInSelected (x_off, y_off); ! x_off = OFFSET_X(v[num_pts-1].x); y_off = OFFSET_Y(v[num_pts-1].y); ! move_last = EndPtInSelected (x_off, y_off); if (move_first || move_last) --- 3778,3802 ---- v = obj_ptr->detail.p->vlist; ! if (obj_ptr->ctm == NULL) { ! x_off = OFFSET_X(v[0].x); y_off = OFFSET_Y(v[0].y); ! move_first = EndPtInSelected (x_off, y_off); ! x_off = OFFSET_X(v[num_pts-1].x); y_off = OFFSET_Y(v[num_pts-1].y); ! move_last = EndPtInSelected (x_off, y_off); ! } else { ! int tmp_x, tmp_y; ! ! TransformPointThroughCTM(v[0].x-obj_ptr->x, v[0].y-obj_ptr->y, ! obj_ptr->ctm, &tmp_x, &tmp_y); ! tmp_x += obj_ptr->x; ! tmp_y += obj_ptr->y; ! x_off = OFFSET_X(tmp_x); y_off = OFFSET_Y(tmp_y); ! move_first = EndPtInSelected (x_off, y_off); ! TransformPointThroughCTM(v[num_pts-1].x-obj_ptr->x, ! v[num_pts-1].y-obj_ptr->y, obj_ptr->ctm, &tmp_x, &tmp_y); ! tmp_x += obj_ptr->x; ! tmp_y += obj_ptr->y; ! x_off = OFFSET_X(tmp_x); y_off = OFFSET_Y(tmp_y); ! move_last = EndPtInSelected (x_off, y_off); ! } if (move_first || move_last) *************** *** 3721,3724 **** --- 3806,3826 ---- PrepareToReplaceAnObj (obj_ptr); + + if (obj_ptr->ctm != NULL) { + /* Remove the transformations! */ + int i; + + for (i=0; i < num_pts; i++) { + int tmp_x, tmp_y; + + TransformPointThroughCTM(v[i].x-obj_ptr->x, v[i].y-obj_ptr->y, + obj_ptr->ctm, &tmp_x, &tmp_y); + v[i].x = tmp_x+obj_ptr->x; + v[i].y = tmp_y+obj_ptr->y; + } + free(obj_ptr->ctm); + obj_ptr->ctm = NULL; + UpdPolyBBox(obj_ptr, num_pts, v); + } if (something_stretched) { *** text.c.orig Thu Dec 26 01:10:59 1996 --- text.c Thu Dec 26 01:10:59 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/text.c,v 3.11 1996/10/30 23:10:37 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/text.c,v 3.15 1996/12/26 05:57:26 william Exp $"; #endif *************** *** 105,108 **** --- 105,115 ---- struct ObjRec *curTextObj=NULL; + int editTextSize=0; + int savedEditTextSize=(-1); + + static struct ObjRec *tmpCurTextObj=NULL; + static int editTextDx=0; + static int editTextDy=0; + static struct ObjRec *justDrawnTextObj=NULL; *************** *** 504,507 **** --- 511,540 ---- } + static char *gpszTextCurLongestStr=NULL; + static int gnTextCurMaxLines=0; + + static + void UpdateTextW(new_w, long_str) + int new_w; + char *long_str; + { + struct StrRec *s_ptr; + + textW = new_w; + if (gpszTextCurLongestStr != NULL) free(gpszTextCurLongestStr); + gpszTextCurLongestStr = NULL; + if (long_str != NULL && + (gpszTextCurLongestStr=UtilStrDup(long_str)) == NULL) { + FailAllocMessage(); + } + } + + static + void UpdateTextH(new_h, new_num_lines) + { + textH = new_h; + gnTextCurMaxLines = new_num_lines; + } + static int curTextIsNew=FALSE; *************** *** 510,513 **** --- 543,549 ---- struct TextRec * text_ptr; + if (tmpCurTextObj != NULL) FreeObj(tmpCurTextObj); + tmpCurTextObj = NULL; + firstStr = lastStr = curStr = NewStr (); *************** *** 519,522 **** --- 555,559 ---- ShowTextVSpace (); } + savedEditTextSize = (-1); text_ptr = (struct TextRec *)malloc(sizeof(struct TextRec)); *************** *** 571,576 **** AddObj (NULL, topObj, curTextObj); ! textW = 0; ! textH = textCursorH; textCursorShown = TRUE; --- 608,613 ---- AddObj (NULL, topObj, curTextObj); ! UpdateTextW(0, NULL); ! UpdateTextH(textCursorH, 1); textCursorShown = TRUE; *************** *** 728,733 **** --- 765,774 ---- textCurIndex = 0; curStrW = 0; + UpdateTextW(0, NULL); + UpdateTextH(0, 0); + savedEditTextSize = (-1); if (editingText) { + PopCurFont(); ShowTextRelatedInfo(); editingText = FALSE; *************** *** 737,740 **** --- 778,783 ---- textHighlight = FALSE; curTextIsNew = FALSE; + if (tmpCurTextObj != NULL) FreeObj(tmpCurTextObj); + tmpCurTextObj = NULL; return FALSE; } *************** *** 746,754 **** --- 789,822 ---- curTextObj->detail.t->cached_bitmap = None; } + if (savedEditTextSize != (-1)) { + curTextObj->detail.t->size = savedEditTextSize; + savedEditTextSize = (-1); + } curTextObj->detail.t->last = lastStr; + + if (tmpCurTextObj != NULL) { + changingFontSizeFromRead = FALSE; + SetCanvasFont(); + changingFontSizeFromRead = TRUE; + } GetTextObjSizeInfo(curTextObj->detail.t, &num_lines, &max_len, &min_lbearing, &max_rextra); curTextObj->detail.t->lines = num_lines; + if (tmpCurTextObj != NULL) { + int w, h; + + if (gpszTextCurLongestStr != NULL) { + w = XTextWidth(canvasFontPtr, gpszTextCurLongestStr, + strlen(gpszTextCurLongestStr)); + if (w > textW) { + textW = w; + } + } + h = gnTextCurMaxLines*textCursorH+(gnTextCurMaxLines-1)*textVSpace; + if (h > textH) { + textH = h; + } + } curTextObj->x = textAbsX-tmpAdjX; curTextObj->y = textAbsY-tmpAdjY; *************** *** 966,970 **** textAbsMinLBearing = textAbsMaxRExtra = 0; curStrW = 0; ! textW = textH = 0; textAbsX = textOrigX + drawOrigX; textAbsY = textOrigY + drawOrigY; --- 1034,1039 ---- textAbsMinLBearing = textAbsMaxRExtra = 0; curStrW = 0; ! UpdateTextW(0, NULL); ! UpdateTextH(0, 0); textAbsX = textOrigX + drawOrigX; textAbsY = textOrigY + drawOrigY; *************** *** 994,997 **** --- 1063,1069 ---- curTextIsNew = FALSE; + if (tmpCurTextObj != NULL) FreeObj(tmpCurTextObj); + tmpCurTextObj = NULL; + return TRUE; } *************** *** 1006,1025 **** static ! void SetTextCurX () /* set textCurX according to textCurIndex */ { ! register int left = 0, w; ! char s[MAXSTRING+1]; ! strcpy (s, curStr->dyn_str.s); ! s[textCurIndex] = '\0'; ! w = XTextWidth (canvasFontPtr, s, strlen (s)); ! switch (textJust) ! { ! case JUST_L: left = textOrigX; break; ! case JUST_C: left = textOrigX-curStrW/2; break; ! case JUST_R: left = textOrigX-curStrW; break; } textCurX = left + w; --- 1078,1097 ---- static ! void SetTextCurX() /* set textCurX according to textCurIndex */ { ! int left=0, w; ! char *tmp_str=UtilStrDup(curStr->dyn_str.s); ! if (tmp_str == NULL) FailAllocMessage(); ! tmp_str[textCurIndex] = '\0'; ! w = XTextWidth(canvasFontPtr, tmp_str, strlen(tmp_str)); ! UtilFree(tmp_str); ! switch (textJust) { ! case JUST_L: left = textOrigX; break; ! case JUST_C: left = textOrigX-curStrW/2; break; ! case JUST_R: left = textOrigX-curStrW; break; } textCurX = left + w; *************** *** 1098,1103 **** int abs_x, abs_y, *x_off, *y_off; { ! int dx, dy; curTextObj = obj_ptr; savedTextLtX = obj_ptr->bbox.ltx; --- 1170,1182 ---- int abs_x, abs_y, *x_off, *y_off; { ! int h, dx, dy, orig_text_w=0, orig_text_h=0, num_lines=0; ! struct StrRec *s_ptr; ! ! if (tmpCurTextObj != NULL) FreeObj(tmpCurTextObj); ! tmpCurTextObj = NULL; + if (editTextSize != 0 && (tmpCurTextObj=DupObj(obj_ptr)) == NULL) { + return FailAllocMessage(); + } curTextObj = obj_ptr; savedTextLtX = obj_ptr->bbox.ltx; *************** *** 1109,1112 **** --- 1188,1193 ---- editingText = TRUE; + savedEditTextSize = (-1); + curFont = obj_ptr->detail.t->font; curSize = obj_ptr->detail.t->size; *************** *** 1130,1133 **** --- 1211,1216 ---- editingText = FALSE; curTextModified = FALSE; + if (tmpCurTextObj != NULL) FreeObj(tmpCurTextObj); + tmpCurTextObj = NULL; return FALSE; } *************** *** 1136,1142 **** --- 1219,1267 ---- CurFontMsg(); + if (tmpCurTextObj != NULL) { + int tmp_w1, tmp_h1, tmp_w2, tmp_h2; + + savedEditTextSize = obj_ptr->detail.t->size; + tmpCurTextObj->detail.t->size = editTextSize; + + UpdTextBBox(tmpCurTextObj); + + tmp_w1 = obj_ptr->obbox.rbx - obj_ptr->obbox.ltx; + tmp_h1 = obj_ptr->obbox.rby - obj_ptr->obbox.lty; + tmp_w2 = tmpCurTextObj->obbox.rbx - tmpCurTextObj->obbox.ltx; + tmp_h2 = tmpCurTextObj->obbox.rby - tmpCurTextObj->obbox.lty; + editTextDx = obj_ptr->obbox.ltx + ((tmp_w1-tmp_w2)>>1) - + tmpCurTextObj->obbox.ltx; + editTextDy = obj_ptr->obbox.lty + ((tmp_h1-tmp_h2)>>1) - + tmpCurTextObj->obbox.lty; + MoveObj(tmpCurTextObj, editTextDx, editTextDy); + } + firstStr = curStr = obj_ptr->detail.t->first; lastStr = obj_ptr->detail.t->last; + if (tmpCurTextObj == NULL) { + textAbsX = obj_ptr->x; + textAbsY = obj_ptr->y; + if (obj_ptr->ctm != NULL) { + textAbsX += obj_ptr->ctm->m[CTM_TX]; + textAbsY += obj_ptr->ctm->m[CTM_TY]; + } + textOrigX = OFFSET_X(textAbsX); + textOrigY = OFFSET_Y(textAbsY); + textAbsMinLBearing = obj_ptr->detail.t->min_lbearing; + textAbsMaxRExtra = obj_ptr->detail.t->max_rextra; + } else { + textAbsX = tmpCurTextObj->x; + textAbsY = tmpCurTextObj->y; + if (obj_ptr->ctm != NULL) { + textAbsX += obj_ptr->ctm->m[CTM_TX]; + textAbsY += obj_ptr->ctm->m[CTM_TY]; + } + textOrigX = OFFSET_X(textAbsX); + textOrigY = OFFSET_Y(textAbsY); + textAbsMinLBearing = tmpCurTextObj->detail.t->min_lbearing; + textAbsMaxRExtra = tmpCurTextObj->detail.t->max_rextra; + } textAbsX = obj_ptr->x; textAbsY = obj_ptr->y; *************** *** 1147,1184 **** textOrigX = OFFSET_X(textAbsX); textOrigY = OFFSET_Y(textAbsY); - textAbsMinLBearing = obj_ptr->detail.t->min_lbearing; - textAbsMaxRExtra = obj_ptr->detail.t->max_rextra; switch (curRotate) { case ROTATE0: if (obj_ptr->ctm == NULL) { ! textW = obj_ptr->obbox.rbx - obj_ptr->obbox.ltx; ! textH = obj_ptr->obbox.rby - obj_ptr->obbox.lty; ! switch (textJust) { ! case JUST_L: tmpAdjX = ((textW-ABS_SIZE(textW))>>1); break; ! case JUST_C: tmpAdjX = 0; break; ! case JUST_R: tmpAdjX = ((ABS_SIZE(textW)-textW)>>1); break; } - tmpAdjY = ((textH-ABS_SIZE(textH))>>1); } else { ! textW = obj_ptr->orig_obbox.rbx - obj_ptr->orig_obbox.ltx; ! textH = obj_ptr->orig_obbox.rby - obj_ptr->orig_obbox.lty; ! switch (textJust) { ! case JUST_L: ! tmpAdjX = ((obj_ptr->obbox.ltx + obj_ptr->obbox.rbx - ! ABS_SIZE(textW))>>1) - textAbsX; ! break; ! case JUST_C: ! tmpAdjX = 0; ! tmpAdjX = ((obj_ptr->obbox.ltx + obj_ptr->obbox.rbx)>>1) - ! textAbsX; ! break; ! case JUST_R: ! tmpAdjX = ((obj_ptr->obbox.ltx + obj_ptr->obbox.rbx + ! ABS_SIZE(textW))>>1) - textAbsX; ! break; } - tmpAdjY = ((obj_ptr->obbox.lty + obj_ptr->obbox.rby - - ABS_SIZE(textH))>>1) - textAbsY; } break; --- 1272,1344 ---- textOrigX = OFFSET_X(textAbsX); textOrigY = OFFSET_Y(textAbsY); switch (curRotate) { case ROTATE0: if (obj_ptr->ctm == NULL) { ! if (tmpCurTextObj == NULL) { ! textW = obj_ptr->obbox.rbx - obj_ptr->obbox.ltx; ! textH = obj_ptr->obbox.rby - obj_ptr->obbox.lty; ! switch (textJust) { ! case JUST_L: tmpAdjX = ((textW-ABS_SIZE(textW))>>1); break; ! case JUST_C: tmpAdjX = 0; break; ! case JUST_R: tmpAdjX = ((ABS_SIZE(textW)-textW)>>1); break; ! } ! tmpAdjY = ((textH-ABS_SIZE(textH))>>1); ! } else { ! orig_text_w = obj_ptr->obbox.rbx - obj_ptr->obbox.ltx; ! orig_text_h = obj_ptr->obbox.rby - obj_ptr->obbox.lty; ! textW = tmpCurTextObj->obbox.rbx - tmpCurTextObj->obbox.ltx; ! textH = tmpCurTextObj->obbox.rby - tmpCurTextObj->obbox.lty; ! switch (textJust) { ! case JUST_L: tmpAdjX = ((orig_text_w-ABS_SIZE(textW))>>1); break; ! case JUST_C: tmpAdjX = 0; break; ! case JUST_R: tmpAdjX = ((ABS_SIZE(textW)-orig_text_w)>>1); break; ! } ! tmpAdjY = ((orig_text_h-ABS_SIZE(textH))>>1); } } else { ! if (tmpCurTextObj == NULL) { ! textW = obj_ptr->orig_obbox.rbx - obj_ptr->orig_obbox.ltx; ! textH = obj_ptr->orig_obbox.rby - obj_ptr->orig_obbox.lty; ! switch (textJust) { ! case JUST_L: ! tmpAdjX = ((obj_ptr->obbox.ltx + obj_ptr->obbox.rbx - ! ABS_SIZE(textW))>>1) - textAbsX; ! break; ! case JUST_C: ! tmpAdjX = ((obj_ptr->obbox.ltx + obj_ptr->obbox.rbx)>>1) - ! textAbsX; ! break; ! case JUST_R: ! tmpAdjX = ((obj_ptr->obbox.ltx + obj_ptr->obbox.rbx + ! ABS_SIZE(textW))>>1) - textAbsX; ! break; ! } ! tmpAdjY = ((obj_ptr->obbox.lty + obj_ptr->obbox.rby - ! ABS_SIZE(textH))>>1) - textAbsY; ! } else { ! orig_text_w = obj_ptr->obbox.rbx - obj_ptr->obbox.ltx; ! orig_text_h = obj_ptr->obbox.rby - obj_ptr->obbox.lty; ! textW = tmpCurTextObj->orig_obbox.rbx - ! tmpCurTextObj->orig_obbox.ltx; ! textH = tmpCurTextObj->orig_obbox.rby - ! tmpCurTextObj->orig_obbox.lty; ! switch (textJust) { ! case JUST_L: ! tmpAdjX = ((obj_ptr->obbox.ltx + obj_ptr->obbox.rbx - ! ABS_SIZE(textW))>>1) - textAbsX; ! break; ! case JUST_C: ! tmpAdjX = ((obj_ptr->obbox.ltx + obj_ptr->obbox.rbx)>>1) - ! textAbsX; ! break; ! case JUST_R: ! tmpAdjX = ((obj_ptr->obbox.ltx + obj_ptr->obbox.rbx + ! ABS_SIZE(textW))>>1) - textAbsX; ! break; ! } ! tmpAdjY = ((obj_ptr->obbox.lty + obj_ptr->obbox.rby - ! ABS_SIZE(textH))>>1) - textAbsY; } } break; *************** *** 1240,1263 **** break; } textAbsX += tmpAdjX; textOrigX = OFFSET_X(textAbsX); textAbsY += tmpAdjY; textOrigY = OFFSET_Y(textAbsY); if (obj_ptr->ctm == NULL) { ! abs_x += tmpAdjX; *x_off = OFFSET_X(abs_x); ! abs_y += tmpAdjY; *y_off = OFFSET_Y(abs_y); } else { ! int x, y, ltx; ! ReverseTransformPointThroughCTM(abs_x-obj_ptr->x, abs_y-obj_ptr->y, ! obj_ptr->ctm, &x, &y); ! ltx = textOrigX; ! switch (textJust) { ! case JUST_L: break; ! case JUST_C: ltx -= (textW>>1); break; ! case JUST_R: ltx -= textW; break; } - abs_x = ltx + obj_ptr->x + x - obj_ptr->orig_obbox.ltx; - abs_y = textOrigY + obj_ptr->y + y - obj_ptr->orig_obbox.lty; - *x_off = OFFSET_X(abs_x); - *y_off = OFFSET_Y(abs_y); } if (outerSel != NULL) { --- 1400,1484 ---- break; } + textAbsX += tmpAdjX; textOrigX = OFFSET_X(textAbsX); textAbsY += tmpAdjY; textOrigY = OFFSET_Y(textAbsY); + if (obj_ptr->ctm == NULL) { ! if (tmpCurTextObj == NULL) { ! abs_x += tmpAdjX; *x_off = OFFSET_X(abs_x); ! abs_y += tmpAdjY; *y_off = OFFSET_Y(abs_y); ! } else { ! int tmp_w1, tmp_h1, tmp_w2, tmp_h2; ! double w_perc=((double)0.0), h_perc=((double)0.0); ! double new_abs_x, new_abs_y; ! ! tmp_w1 = obj_ptr->obbox.rbx - obj_ptr->obbox.ltx; ! tmp_h1 = obj_ptr->obbox.rby - obj_ptr->obbox.lty; ! tmp_w2 = tmpCurTextObj->obbox.rbx - tmpCurTextObj->obbox.ltx; ! tmp_h2 = tmpCurTextObj->obbox.rby - tmpCurTextObj->obbox.lty; ! w_perc = (tmp_w1 == 0) ? ((double)0.0) : ! ((double)(abs_x-obj_ptr->obbox.ltx)) / ((double)tmp_w1); ! h_perc = (tmp_h1 == 0) ? ((double)0.0) : ! ((double)(abs_y-obj_ptr->obbox.lty)) / ((double)tmp_h1); ! new_abs_x = tmp_w2*w_perc + ((double)textAbsX); ! new_abs_y = tmp_h2*h_perc + ((double)textAbsY); ! *x_off = OFFSET_X(round(new_abs_x)); ! *y_off = OFFSET_Y(round(new_abs_y)); ! } } else { ! if (tmpCurTextObj == NULL) { ! int x, y, dx=0; ! ReverseTransformPointThroughCTM(abs_x-obj_ptr->x, abs_y-obj_ptr->y, ! obj_ptr->ctm, &x, &y); ! abs_x = obj_ptr->x + x; ! abs_y = obj_ptr->y + y; ! ! switch (textJust) { ! case JUST_L: break; ! case JUST_C: dx = (textW>>1); break; ! case JUST_R: dx = textW; break; ! } ! abs_x += textAbsX - obj_ptr->orig_obbox.ltx + dx; ! abs_y += textAbsY - obj_ptr->orig_obbox.lty; ! ! *x_off = OFFSET_X(abs_x); ! *y_off = OFFSET_Y(abs_y); ! } else { ! int x, y, dx=0, tmp_w1, tmp_h1, tmp_w2, tmp_h2; ! double w_perc=((double)0.0), h_perc=((double)0.0); ! double new_abs_x, new_abs_y; ! ! orig_text_w = obj_ptr->orig_obbox.rbx - obj_ptr->orig_obbox.ltx; ! orig_text_h = obj_ptr->orig_obbox.rby - obj_ptr->orig_obbox.lty; ! textW = tmpCurTextObj->orig_obbox.rbx - tmpCurTextObj->orig_obbox.ltx; ! textH = tmpCurTextObj->orig_obbox.rby - tmpCurTextObj->orig_obbox.lty; ! ! ReverseTransformPointThroughCTM(abs_x-obj_ptr->x, abs_y-obj_ptr->y, ! obj_ptr->ctm, &x, &y); ! abs_x = obj_ptr->x + x; ! abs_y = obj_ptr->y + y; ! ! switch (textJust) { ! case JUST_L: break; ! case JUST_C: dx = (orig_text_w>>1); break; ! case JUST_R: dx = orig_text_w; break; ! } ! abs_x += dx; ! ! tmp_w1 = obj_ptr->orig_obbox.rbx - obj_ptr->orig_obbox.ltx; ! tmp_h1 = obj_ptr->orig_obbox.rby - obj_ptr->orig_obbox.lty; ! tmp_w2 = tmpCurTextObj->orig_obbox.rbx - tmpCurTextObj->orig_obbox.ltx; ! tmp_h2 = tmpCurTextObj->orig_obbox.rby - tmpCurTextObj->orig_obbox.lty; ! w_perc = (tmp_w1 == 0) ? ((double)0.0) : ! ((double)(abs_x-obj_ptr->orig_obbox.ltx)) / ((double)tmp_w1); ! h_perc = (tmp_h1 == 0) ? ((double)0.0) : ! ((double)(abs_y-obj_ptr->orig_obbox.lty)) / ((double)tmp_h1); ! new_abs_x = tmp_w2*w_perc + ((double)textAbsX); ! new_abs_y = tmp_h2*h_perc + ((double)textAbsY); ! ! *x_off = OFFSET_X(round(new_abs_x)); ! *y_off = OFFSET_Y(round(new_abs_y)); } } if (outerSel != NULL) { *************** *** 1268,1271 **** --- 1489,1514 ---- PrepareToReplaceAnObj(obj_ptr->detail.t->attr->owner); } + if (tmpCurTextObj != NULL && curSize != tmpCurTextObj->detail.t->size) { + int saved_size=curSize; + + curSize = tmpCurTextObj->detail.t->size; + changingFontSizeFromRead = FALSE; + SetCanvasFont(); + changingFontSizeFromRead = TRUE; + curSize = saved_size; + } + UpdateTextW(0, NULL); + UpdateTextH(0, 0); + for (s_ptr=firstStr; s_ptr != NULL; s_ptr=s_ptr->next, num_lines++) { + int w=XTextWidth(canvasFontPtr, s_ptr->dyn_str.s, s_ptr->dyn_str.sz-1); + + if (w > textW) { + UpdateTextW(w, s_ptr->dyn_str.s); + } + } + h = textCursorH*num_lines + textVSpace*(num_lines-1); + if (h > textH) { + UpdateTextH(h, num_lines); + } return TRUE; } *************** *** 1873,1877 **** curStrW = XTextWidth (canvasFontPtr, curStr->dyn_str.s, curStr->dyn_str.sz-1); ! if (curStrW > textW) textW = curStrW; textCurY = new_cur_y; SetTextCurX (); --- 2116,2122 ---- curStrW = XTextWidth (canvasFontPtr, curStr->dyn_str.s, curStr->dyn_str.sz-1); ! if (curStrW > textW) { ! UpdateTextW(curStrW, curStr->dyn_str.s); ! } textCurY = new_cur_y; SetTextCurX (); *************** *** 1955,1959 **** if (i > textH) { ! textH = i; RedrawCurText (); } --- 2200,2204 ---- if (i > textH) { ! UpdateTextH(i, NumLines()); RedrawCurText (); } *************** *** 2107,2111 **** SetCurStrExtraInfo(); if (curStrW > textW) { ! textW = curStrW; RedrawCurText(); } --- 2352,2356 ---- SetCurStrExtraInfo(); if (curStrW > textW) { ! UpdateTextW(curStrW, curStr->dyn_str.s); RedrawCurText(); } *************** *** 2126,2205 **** static ! void HandleChar (Str, ColorIndex) ! char * Str; ! int ColorIndex; { ! register int amount; ! int need_redraw=textHighlight; ! int need_to_calc_extra_info=FALSE; ! char msg[80], buf[MAXSTRING+1], tmp_char; ! XEvent ev; ! if (escPressed) ! { Str[0] |= 0x80; escPressed = FALSE; } ! if (((*Str)&0x80) && curFont != FONT_SYM && !ValidCharCode (Str)) return; ! if (textHighlight) ! { curTextModified = TRUE; ! JustDeleteHighlightedText (&need_to_calc_extra_info); } ! if (textCurIndex+((int) strlen (&(curStr->dyn_str.s[textCurIndex]))) >= ! MAXSTRING) ! { ! sprintf (msg, "String length exceeds %1d. Character ignored.",MAXSTRING); ! Msg (msg); ! RedrawCurText (); ! while (XCheckWindowEvent (mainDisplay, drawWindow, KeyPressMask, &ev)) ; return; } curTextModified = TRUE; ! amount = XTextWidth (canvasFontPtr, Str, 1); ! if (textJust != JUST_L || textCurIndex != curStr->dyn_str.sz-1) ! PaintCurText (drawWindow, drawGC, curStr->dyn_str.s, textJust, textOrigX, textCurY, canvasFontPtr, ColorIndex, penPat, ERASE, INVALID, INVALID); ! if (!need_to_calc_extra_info && (textCurIndex==0 || ! textCurIndex==curStr->dyn_str.sz-1)) need_to_calc_extra_info = TRUE; tmp_char = curStr->dyn_str.s[textCurIndex]; curStr->dyn_str.s[textCurIndex] = '\0'; ! sprintf (buf, "%s%c%c%s", curStr->dyn_str.s, *Str, tmp_char, &curStr->dyn_str.s[++textCurIndex]); ! DynStrSet (&curStr->dyn_str, buf); curStrW += amount; ! if (!need_redraw) ! PaintCurText (drawWindow, drawGC, curStr->dyn_str.s, textJust, textOrigX, textCurY, canvasFontPtr, ColorIndex, penPat, PAINT_NORM, INVALID, INVALID); - SetTextCurX (); - if (need_to_calc_extra_info) SetCurStrExtraInfo (); - if (curStrW > textW) - { - textW = curStrW; - RedrawCurText (); } ! else if (need_redraw) ! RedrawCurText (); ! ! if (curTextObj->detail.t->cached_bitmap != None) ! XFreePixmap (mainDisplay, curTextObj->detail.t->cached_bitmap); ! curTextObj->detail.t->cached_zoom = 0; curTextObj->detail.t->cached_bitmap = None; ! if (zoomScale != 0 || curTextObj->detail.t->rotate != ROTATE0) ! GetCurStrSizeInfo (); ! ! ScrollTo (textCurX, textCurY); } --- 2371,2446 ---- static ! void HandleChar(Str, ColorIndex) ! char *Str; ! int ColorIndex; { ! register int amount; ! int need_redraw=textHighlight, need_to_calc_extra_info=FALSE; ! char msg[80], buf[MAXSTRING+1], tmp_char; ! XEvent ev; ! if (escPressed) { Str[0] |= 0x80; escPressed = FALSE; } ! if (((*Str)&0x80) && curFont != FONT_SYM && !ValidCharCode(Str)) return; ! if (textHighlight) { curTextModified = TRUE; ! JustDeleteHighlightedText(&need_to_calc_extra_info); } ! if (textCurIndex+((int)strlen(&(curStr->dyn_str.s[textCurIndex]))) >= ! MAXSTRING) { ! sprintf(msg, "String length exceeds %1d. Character ignored.",MAXSTRING); ! Msg(msg); ! RedrawCurText(); ! while (XCheckWindowEvent(mainDisplay, drawWindow, KeyPressMask, &ev)) ; return; } curTextModified = TRUE; ! amount = XTextWidth(canvasFontPtr, Str, 1); ! if (textJust != JUST_L || textCurIndex != curStr->dyn_str.sz-1) { ! PaintCurText(drawWindow, drawGC, curStr->dyn_str.s, textJust, textOrigX, textCurY, canvasFontPtr, ColorIndex, penPat, ERASE, INVALID, INVALID); ! } if (!need_to_calc_extra_info && (textCurIndex==0 || ! textCurIndex==curStr->dyn_str.sz-1)) { need_to_calc_extra_info = TRUE; + } tmp_char = curStr->dyn_str.s[textCurIndex]; curStr->dyn_str.s[textCurIndex] = '\0'; ! sprintf(buf, "%s%c%c%s", curStr->dyn_str.s, *Str, tmp_char, &curStr->dyn_str.s[++textCurIndex]); ! DynStrSet(&curStr->dyn_str, buf); curStrW += amount; ! if (!need_redraw) { ! PaintCurText(drawWindow, drawGC, curStr->dyn_str.s, textJust, textOrigX, textCurY, canvasFontPtr, ColorIndex, penPat, PAINT_NORM, INVALID, INVALID); } ! SetTextCurX(); ! if (need_to_calc_extra_info) SetCurStrExtraInfo(); ! if (curStrW > textW) { ! UpdateTextW(curStrW, curStr->dyn_str.s); ! RedrawCurText(); ! } else if (need_redraw) { ! RedrawCurText(); ! } ! if (curTextObj->detail.t->cached_bitmap != None) { ! XFreePixmap(mainDisplay, curTextObj->detail.t->cached_bitmap); ! } curTextObj->detail.t->cached_zoom = 0; curTextObj->detail.t->cached_bitmap = None; ! if (zoomScale != 0 || curTextObj->detail.t->rotate != ROTATE0) { ! GetCurStrSizeInfo(); ! } ! ScrollTo(textCurX, textCurY); } *************** *** 2217,2221 **** if ((attr_ptr = curTextObj->detail.t->attr) == NULL) { ! Msg ("Can not TAB out of a non-attribute text."); return; } --- 2458,2462 ---- if ((attr_ptr = curTextObj->detail.t->attr) == NULL) { ! MsgBox("Can not TAB out of a non-attribute text.", TOOL_NAME, INFO_MB); return; } *************** *** 2956,2960 **** if (!draw_it) return; ! SaveCurFont(); curFont = text_ptr->font; curStyle = text_ptr->style; --- 3197,3201 ---- if (!draw_it) return; ! PushCurFont(); curFont = text_ptr->font; curStyle = text_ptr->style; *************** *** 3051,3055 **** } } ! RestoreCurFont(); } --- 3292,3296 ---- } } ! PopCurFont(); } *************** *** 3756,3761 **** textW-textAbsMinLBearing+textAbsMaxRExtra+4, textH+4); ! y = textOrigY; for (s_ptr=curTextObj->detail.t->first; s_ptr != NULL; s_ptr=s_ptr->next) { if (textHighlight) { --- 3997,4010 ---- textW-textAbsMinLBearing+textAbsMaxRExtra+4, textH+4); ! if (tmpCurTextObj != NULL && curSize != tmpCurTextObj->detail.t->size) { ! int saved_size=curSize; + curSize = tmpCurTextObj->detail.t->size; + changingFontSizeFromRead = FALSE; + SetCanvasFont(); + changingFontSizeFromRead = TRUE; + curSize = saved_size; + } + y = textOrigY; for (s_ptr=curTextObj->detail.t->first; s_ptr != NULL; s_ptr=s_ptr->next) { if (textHighlight) { *************** *** 3800,3808 **** if (!textCursorShown) return; textCurY = textOrigY; for (s_ptr=firstStr; s_ptr != NULL; s_ptr=s_ptr->next, num++) { int w=XTextWidth(canvasFontPtr, s_ptr->dyn_str.s, s_ptr->dyn_str.sz-1); ! if (w > textW) textW = w; if (!freeze_cur_y) { if (curStr == s_ptr) { --- 4049,4068 ---- if (!textCursorShown) return; + if (tmpCurTextObj != NULL && curSize != tmpCurTextObj->detail.t->size) { + int saved_size=curSize; + + curSize = tmpCurTextObj->detail.t->size; + changingFontSizeFromRead = FALSE; + SetCanvasFont(); + changingFontSizeFromRead = TRUE; + curSize = saved_size; + } textCurY = textOrigY; for (s_ptr=firstStr; s_ptr != NULL; s_ptr=s_ptr->next, num++) { int w=XTextWidth(canvasFontPtr, s_ptr->dyn_str.s, s_ptr->dyn_str.sz-1); ! if (w > textW) { ! UpdateTextW(w, s_ptr->dyn_str.s); ! } if (!freeze_cur_y) { if (curStr == s_ptr) { *************** *** 3815,3819 **** } h = textCursorH*num + textVSpace*(num-1); ! if (h > textH) textH = h; SetTextCurX(); } --- 4075,4081 ---- } h = textCursorH*num + textVSpace*(num-1); ! if (h > textH) { ! UpdateTextH(h, num); ! } SetTextCurX(); } *************** *** 3907,3908 **** --- 4169,4322 ---- RedrawCurText(); } + + void HighLightText(obj_ptr, str_obj_index, start_index, str_len) + struct ObjRec *obj_ptr; + int str_obj_index, start_index, str_len; + { + struct AttrRec *attr_ptr; + int index=0, abs_x, abs_y, x_off, y_off, left, amount; + + if (curChoice == DRAWTEXT) { + escPressed = FALSE; + CreateTextObj(); + curTextModified = FALSE; + } + abs_x = obj_ptr->x; x_off = OFFSET_X(abs_x); + abs_y = obj_ptr->y; y_off = OFFSET_Y(abs_y); + + if (!PrepareEditExistingText(obj_ptr, abs_x, abs_y, &x_off, &y_off)) { + return; + } + textCurY = textOrigY; + curStr = obj_ptr->detail.t->first; + for (index=0; index != str_obj_index && curStr->next != NULL; + index++, curStr=curStr->next) { + textCurY += textCursorH+textVSpace; + } + endStr = curStr; + textEndY = textCurY; + + textCurIndex = start_index; + textCurX = textOrigX; + curStrW = endStrW = amount = XTextWidth(canvasFontPtr, curStr->dyn_str.s, + curStr->dyn_str.sz-1); + + switch (textJust) { + case JUST_L: break; + case JUST_C: textCurX -= (amount>>1); break; + case JUST_R: textCurX -= amount; break; + } + left = textCurX; + + attr_ptr = obj_ptr->detail.t->attr; + if (attr_ptr != NULL && attr_ptr->inherited && textCurY == textOrigY && + attr_ptr->shown && attr_ptr->nameshown && + textCurIndex < attr_ptr->attr_name.sz-1) { + /* clicked in the name of an inherited attribute */ + textCurIndex = attr_ptr->attr_name.sz-1; + textCurX = left + XTextWidth(canvasFontPtr, attr_ptr->attr_name.s, + textCurIndex); + if (start_index+str_len < attr_ptr->attr_name.sz-1) { + textEndIndex = textCurIndex; + textEndX = textCurX; + } else { + textEndIndex = start_index + str_len; + textEndX = left + XTextWidth(canvasFontPtr, curStr->dyn_str.s, + start_index+str_len); + } + } else { + if (start_index > 0) { + textCurX += XTextWidth(canvasFontPtr, curStr->dyn_str.s, start_index); + } + textEndIndex = start_index + str_len; + textEndX = left + XTextWidth(canvasFontPtr, curStr->dyn_str.s, + start_index+str_len); + } + textCursorShown = TRUE; + + highlightStartStr = endStr; + highlightStartIndex = textEndIndex; + highlightEndStr = curStr; + highlightEndIndex = textCurIndex; + highlightStartY = textEndY; + + textHighlight = !(endStr==curStr && textEndIndex==textCurIndex); + + RedrawCurText(); + ScrollTo(textCurX, textCurY); + } + + static + int FindTextInString(buf, str_to_match, str_len, case_sensitive, pn_start_index) + char *buf, *str_to_match; + int str_len, case_sensitive, *pn_start_index; + { + if (case_sensitive) { + char *c_ptr=strstr(buf, str_to_match); + + if (c_ptr != NULL) { + *pn_start_index = (int)(c_ptr-buf); + return TRUE; + } + } else { + char *c_ptr; + + for (c_ptr=buf; *c_ptr != '\0'; c_ptr++) { + if (UtilStrNCaseCmp(c_ptr, str_to_match, str_len) == 0) { + *pn_start_index = (int)(c_ptr-buf); + return TRUE; + } + } + } + return FALSE; + } + + int FindTextInCurTextObj(str_to_match, str_len, case_sensitive, + pn_str_obj_index, pn_start_index) + char *str_to_match; + int str_len, case_sensitive, *pn_str_obj_index, *pn_start_index; + { + int str_obj_index=0, start_index=0; + int found_starting_point=FALSE; + struct StrRec *str_ptr; + + for (str_ptr=firstStr; str_ptr != NULL; + str_ptr=str_ptr->next, str_obj_index++) { + int start_index=0; + + if (found_starting_point) { + start_index = 0; + if (FindTextInString(str_ptr->dyn_str.s, str_to_match, str_len, + case_sensitive, &start_index)) { + *pn_start_index = start_index;; + *pn_str_obj_index = str_obj_index; + return TRUE; + } + } else { + if (str_ptr == curStr) { + if (textHighlight) { + if (curStr->dyn_str.s[textCurIndex] != '\0') { + start_index = 0; + if (FindTextInString(&str_ptr->dyn_str.s[textCurIndex+1], + str_to_match, str_len, case_sensitive, &start_index)) { + *pn_start_index = textCurIndex+1+start_index;; + *pn_str_obj_index = str_obj_index; + return TRUE; + } + } + } else { + start_index = 0; + if (FindTextInString(&str_ptr->dyn_str.s[textCurIndex], + str_to_match, str_len, case_sensitive, &start_index)) { + *pn_start_index = textCurIndex+start_index;; + *pn_str_obj_index = str_obj_index; + return TRUE; + } + } + found_starting_point = TRUE; + } + } + } + return FALSE; + } + *** tgif.c.orig Thu Dec 26 01:11:01 1996 --- tgif.c Thu Dec 26 01:11:01 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/tgif.c,v 3.3 1996/10/30 03:08:12 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/tgif.c,v 3.4 1996/11/29 22:58:37 william Exp $"; #endif *************** *** 234,238 **** if (len > 0) { if (inbuf[--len] == '\n') inbuf[len] = '\0'; ! if (PrTgifLoad(inbuf)) { colorDump = cmdLineColor; if (cmdLineOneFilePerPage) { --- 234,240 ---- if (len > 0) { if (inbuf[--len] == '\n') inbuf[len] = '\0'; ! if (cmdLineDumpURL) { ! UrlDump(inbuf); ! } else if (PrTgifLoad(inbuf)) { colorDump = cmdLineColor; if (cmdLineOneFilePerPage) { *************** *** 272,276 **** for ( ; argc > 0; argc--, argv++) { lastFile = (argc == 1); ! if (PrTgifLoad(*argv)) { colorDump = cmdLineColor; if (cmdLineOneFilePerPage) { --- 274,280 ---- for ( ; argc > 0; argc--, argv++) { lastFile = (argc == 1); ! if (cmdLineDumpURL) { ! UrlDump(*argv); ! } else if (PrTgifLoad(*argv)) { colorDump = cmdLineColor; if (cmdLineOneFilePerPage) { *** xbitmap.c.orig Thu Dec 26 01:11:03 1996 --- xbitmap.c Thu Dec 26 01:11:03 1996 *************** *** 30,34 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/xbitmap.c,v 3.12 1996/10/30 23:27:50 william Exp $"; #endif --- 30,34 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/xbitmap.c,v 3.13 1996/12/17 22:16:22 william Exp $"; #endif *************** *** 1571,1603 **** /* data in value_str is not supposed to be touched on return */ { ! char *href=NULL; if (generateHtmlHref && imageMapFileFormat==IMF_FORMAT_SPYG) { ! char *name=UtilStrRChr(value_str, '/'), *dot, *pound; ! ! if (name == NULL) { ! name = value_str; } else { ! name++; ! } ! pound = strchr(name, '#'); ! if (pound != NULL) *pound = '\0'; ! dot = UtilStrRChr(name, '.'); ! if (dot != NULL && (UtilStrICmp(&dot[1], "obj")==0 || ! UtilStrICmp(&dot[1], OBJ_FILE_EXT) == 0)) { ! int len=strlen(value_str)+strlen(htmlFileExtension)+2; ! ! *dot = '\0'; ! if (pound != NULL) len += strlen(£[1])+1; ! href = (char*)malloc((len+1)*sizeof(char)); ! if (href == NULL) FailAllocMessage(); ! if (pound != NULL) { ! sprintf(href, "%s.%s#%s", value_str, htmlFileExtension, £[1]); } else { ! sprintf(href, "%s.%s", value_str, htmlFileExtension); } ! *dot = '.'; } - if (pound != NULL) *pound = '#'; } return href; --- 1571,1634 ---- /* data in value_str is not supposed to be touched on return */ { ! char *href=NULL, *name=NULL, *pound=NULL, *dot=NULL; ! int len=0; if (generateHtmlHref && imageMapFileFormat==IMF_FORMAT_SPYG) { ! if (value_str[0] == '#' && strchr(value_str, '/') == NULL && ! ((!PRTGIF && dumpOneFilePerPage) || ! (PRTGIF && cmdLineOneFilePerPage))) { ! char page_spec[MAXSTRING]; ! int page_num=0; ! ! if (GetPageNumFromPageSpec(&value_str[1], &page_num)) { ! sprintf(page_spec, "%1d", page_num); ! ! if ((name=UtilStrRChr(curFileName, '/')) == NULL) { ! name = curFileName; ! } else { ! name++; ! } ! pound = strchr(name, '#'); ! if (pound != NULL) *pound = '\0'; ! dot = UtilStrRChr(name, '.'); ! if (dot != NULL) { ! *dot = '\0'; ! len = strlen(page_spec)+strlen(htmlFileExtension)+2; ! href = (char*)malloc((len+1)*sizeof(char)); ! if (href == NULL) FailAllocMessage(); ! sprintf(href, "%s-%1d.%s", name, page_num, htmlFileExtension); ! *dot = '.'; ! } ! if (pound != NULL) *pound = '#'; ! } else { ! /* Cannot get page number information, may be it's okay! */ ! } } else { ! if ((name=UtilStrRChr(value_str, '/')) == NULL) { ! name = value_str; } else { ! name++; ! } ! pound = strchr(name, '#'); ! if (pound != NULL) *pound = '\0'; ! dot = UtilStrRChr(name, '.'); ! if (dot != NULL && ((UtilStrICmp(&dot[1], "obj")==0 || ! UtilStrICmp(&dot[1], OBJ_FILE_EXT)==0) || ! UtilStrICmp(&dot[1], "sym")==0 || ! UtilStrICmp(&dot[1], SYM_FILE_EXT)==0)) { ! *dot = '\0'; ! len = strlen(value_str)+strlen(htmlFileExtension)+2; ! if (pound != NULL) len += strlen(£[1])+1; ! href = (char*)malloc((len+1)*sizeof(char)); ! if (href == NULL) FailAllocMessage(); ! if (pound != NULL) { ! sprintf(href, "%s.%s#%s", value_str, htmlFileExtension, £[1]); ! } else { ! sprintf(href, "%s.%s", value_str, htmlFileExtension); ! } ! *dot = '.'; } ! if (pound != NULL) *pound = '#'; } } return href; *** choose.e.orig Thu Dec 26 01:11:05 1996 --- choose.e Thu Dec 26 01:11:05 1996 *************** *** 28,45 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/choose.e,v 3.1 1996/10/28 00:38:18 william Exp $ */ #ifndef _CHOOSE_E_ #define _CHOOSE_E_ - - #define NAMES_SIMPLE_SELECT_NAME 0 - #define NAMES_COMPLEX_SELECT_NAME 1 - #define NAMES_SELECT_FILE 2 - #define NAMES_EDIT_ATTR 3 - #define NAMES_EDIT_NAME 4 - - #define NAMES_LOOP_MANY 0 - #define NAMES_LOOP_ONCE 1 extern void NamesSetTitle ARGS_DECL((char*)); --- 28,36 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/choose.e,v 3.2 1996/11/30 00:10:05 william Exp $ */ #ifndef _CHOOSE_E_ #define _CHOOSE_E_ extern void NamesSetTitle ARGS_DECL((char*)); *** edit.e.orig Thu Dec 26 01:11:07 1996 --- edit.e Thu Dec 26 01:11:07 1996 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/edit.e,v 3.2 1996/06/17 21:18:04 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/edit.e,v 3.5 1996/12/25 17:12:48 william Exp $ */ *************** *** 51,54 **** --- 51,58 ---- extern void RotateAllSelObj ARGS_DECL((double degrees)); extern void NoTransform ARGS_DECL((void)); + extern void SetEditTextSize ARGS_DECL((void)); + extern void FindCaseSensitive ARGS_DECL((void)); + extern void FindNoCase ARGS_DECL((void)); + extern void FindAgain ARGS_DECL((void)); extern void EditSubMenu ARGS_DECL((int Index)); extern int EditMenu ARGS_DECL((int X, int Y, int TrackMenubar)); *************** *** 66,69 **** --- 70,74 ---- extern int ArrangeMenu ARGS_DECL((int X, int Y, int TrackMenubar)); extern void UpdateSymbols ARGS_DECL((void)); + extern void CleanUpEdit ARGS_DECL((void)); #endif /*_EDIT_E_*/ *** file.e.orig Thu Dec 26 01:11:08 1996 --- file.e Thu Dec 26 01:11:08 1996 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/file.e,v 3.7 1996/10/30 03:30:09 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/file.e,v 3.10 1996/12/17 21:25:41 william Exp $ */ *************** *** 78,81 **** --- 78,84 ---- extern int cmdLineRequestedColor; + extern int cmdLineDumpURL; + extern int cmdLineDumpURLWithHeader; + extern int showPageInEPS; *************** *** 89,92 **** --- 92,97 ---- extern Pixmap myFileBgPixmap; extern char *myFileBgGifURL; + + extern int dumpOneFilePerPage; extern void UpdateDocumentFonts ARGS_DECL((char*)); *** ftp.e.orig Thu Dec 26 01:11:10 1996 --- ftp.e Thu Dec 26 01:11:10 1996 *************** *** 28,36 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/ftp.e,v 3.0 1996/05/06 16:05:19 william Exp $ */ #ifndef _TGIF_FTP_E_ #define _TGIF_FTP_E_ extern void FtpFreeBuf ARGS_DECL((char *buf)); --- 28,38 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/ftp.e,v 3.3 1996/11/29 23:06:51 william Exp $ */ #ifndef _TGIF_FTP_E_ #define _TGIF_FTP_E_ + + extern int debugFtp; extern void FtpFreeBuf ARGS_DECL((char *buf)); *** grid.e.orig Thu Dec 26 01:11:12 1996 --- grid.e Thu Dec 26 01:11:12 1996 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/grid.e,v 3.0 1996/05/06 16:05:23 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/grid.e,v 3.1 1996/11/02 23:18:27 william Exp $ */ *************** *** 78,81 **** --- 78,82 ---- extern void ZoomWayOut ARGS_DECL((void)); extern void ZoomOut ARGS_DECL((void)); + extern void CenterAtCursor ARGS_DECL((int AbsX, int AbsY)); extern void PreciseZoom ARGS_DECL((int ZoomedIn, int ZoomScale, int Force)); extern void SetPSPageWidthHeight ARGS_DECL((void)); *** http.e.orig Thu Dec 26 01:11:13 1996 --- http.e Thu Dec 26 01:11:13 1996 *************** *** 28,36 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/http.e,v 3.0 1996/05/06 16:05:33 william Exp $ */ #ifndef _TGIF_HTTP_E_ #define _TGIF_HTTP_E_ extern void HttpFreeBuf ARGS_DECL((char *buf)); --- 28,38 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/http.e,v 3.4 1996/11/29 23:54:26 william Exp $ */ #ifndef _TGIF_HTTP_E_ #define _TGIF_HTTP_E_ + + extern int debugHttp; extern void HttpFreeBuf ARGS_DECL((char *buf)); *** mainloop.e.orig Thu Dec 26 01:11:14 1996 --- mainloop.e Thu Dec 26 01:11:14 1996 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/mainloop.e,v 3.0 1996/05/06 16:05:52 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/mainloop.e,v 3.1 1996/11/29 19:42:21 william Exp $ */ *************** *** 66,69 **** --- 66,70 ---- char **Str2, char **Menu2, char **Str3, char **Menu3)); + extern void UrlDump ARGS_DECL((char *FileName)); extern void Animate ARGS_DECL((char *Type, char *PolyId, char *Speed, char *Color, char **ReturnStr)); *** ruler.e.orig Thu Dec 26 01:11:15 1996 --- ruler.e Thu Dec 26 01:11:15 1996 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/ruler.e,v 3.0 1996/05/06 16:07:20 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/ruler.e,v 3.1 1996/11/30 00:12:26 william Exp $ */ *************** *** 42,45 **** --- 42,46 ---- extern void InitRuler ARGS_DECL((void)); extern void CleanUpRuler ARGS_DECL((void)); + extern void PixelToMeasurementUnit ARGS_DECL((char *Buf, int NumPixels)); extern void RedrawHRuler ARGS_DECL((void)); extern void RedrawVRuler ARGS_DECL((void)); *************** *** 58,62 **** int RbY)); extern void EndIntervalRulers ARGS_DECL((int X, int Y)); - extern void PixelToMeasurementUnit ARGS_DECL((char *Buf, int NumPixels)); extern void StartShowMeasureCursor ARGS_DECL((int XOff, int YOff, char *Str, int ExtraSpace)); --- 59,62 ---- *** text.e.orig Thu Dec 26 01:11:16 1996 --- text.e Thu Dec 26 01:11:16 1996 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/text.e,v 3.0 1996/05/06 16:12:17 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/text.e,v 3.4 1996/12/25 21:02:43 william Exp $ */ *************** *** 44,47 **** --- 44,50 ---- extern struct ObjRec * curTextObj; + extern int editTextSize; + extern int savedEditTextSize; + /* DynStr routines */ extern void FreeDynStr ARGS_DECL((struct DynStrRec *)); *************** *** 85,88 **** extern void PrepareZoomCurText ARGS_DECL((int *AbsXc, int *AbsYc)); extern void PostZoomCurText ARGS_DECL((int AbsXc, int AbsYc)); ! #endif /*_TEXT_E_*/ --- 88,99 ---- extern void PrepareZoomCurText ARGS_DECL((int *AbsXc, int *AbsYc)); extern void PostZoomCurText ARGS_DECL((int AbsXc, int AbsYc)); ! extern void HighLightText ARGS_DECL((struct ObjRec *ObjPtr, ! int str_obj_index, ! int start_index, int str_len)); ! ! extern int FindTextInCurTextObj ARGS_DECL((char *str_to_match, ! int str_len, ! int case_sensitive, ! int *pn_str_obj_index, ! int *pn_start_index)); #endif /*_TEXT_E_*/ *** const.h.orig Thu Dec 26 01:11:17 1996 --- const.h Thu Dec 26 01:11:17 1996 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/const.h,v 3.4 1996/10/17 18:51:33 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/const.h,v 3.7 1996/12/25 16:56:12 william Exp $ */ *************** *** 474,479 **** #define EDIT_SET_SHAPE_SHADOW 35 #define EDIT_NO_TRANSFORM 36 ! #define MAXEDITMENUS 37 /* layout menu */ --- 474,483 ---- #define EDIT_SET_SHAPE_SHADOW 35 #define EDIT_NO_TRANSFORM 36 + #define EDIT_SET_EDIT_TEXT_SIZE 37 + #define EDIT_FIND_CASE 38 + #define EDIT_FIND_NOCASE 39 + #define EDIT_FIND_AGAIN 40 ! #define MAXEDITMENUS 41 /* layout menu */ *************** *** 812,815 **** --- 816,830 ---- #define TGO_DATE 3 #define TGO_USER 4 + + /* choose a file stuff */ + + #define NAMES_SIMPLE_SELECT_NAME 0 + #define NAMES_COMPLEX_SELECT_NAME 1 + #define NAMES_SELECT_FILE 2 + #define NAMES_EDIT_ATTR 3 + #define NAMES_EDIT_NAME 4 + + #define NAMES_LOOP_MANY 0 + #define NAMES_LOOP_ONCE 1 #endif /*_TGIF_CONST_H_*/ *** patchlvl.h.orig Thu Dec 26 01:11:19 1996 --- patchlvl.h Thu Dec 26 01:11:19 1996 *************** *** 28,32 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/patchlvl.h,v 3.10 1996/10/02 16:10:30 william Exp $ */ --- 28,32 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ! * @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/patchlvl.h,v 3.11 1996/10/31 16:08:08 william Exp $ */ *************** *** 34,38 **** #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 10 #endif /*_TGIF_PATCHLEVEL_H_*/ --- 34,38 ---- #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 11 #endif /*_TGIF_PATCHLEVEL_H_*/ *** Makefile.noimake.orig Thu Dec 26 01:11:20 1996 --- Makefile.noimake Thu Dec 26 01:11:20 1996 *************** *** 24,28 **** # PERFORMANCE OF THIS SOFTWARE. # ! # @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/Makefile.noimake,v 3.7 1996/10/31 06:41:31 william Exp $ # --- 24,28 ---- # PERFORMANCE OF THIS SOFTWARE. # ! # @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/Makefile.noimake,v 3.9 1996/12/26 05:30:37 william Exp $ # *************** *** 370,375 **** help.o: const.h tgif_dbg.h types.h patchlvl.h color.e dialog.e help.e \ menu.e msg.e setup.e util.e version.e ! http.o: const.h tgif_dbg.h types.h patchlvl.h http.e msg.e remote.e \ ! tcp.e util.e version.e imgproc.o: const.h tgif_dbg.h types.h auxtext.e choice.e cmd.e color.e \ cursor.e dialog.e drawing.e dup.e file.e grid.e imgproc.e \ --- 370,375 ---- help.o: const.h tgif_dbg.h types.h patchlvl.h color.e dialog.e help.e \ menu.e msg.e setup.e util.e version.e ! http.o: const.h tgif_dbg.h types.h patchlvl.h file.e http.e msg.e \ ! remote.e tcp.e util.e version.e imgproc.o: const.h tgif_dbg.h types.h auxtext.e choice.e cmd.e color.e \ cursor.e dialog.e drawing.e dup.e file.e grid.e imgproc.e \ *************** *** 384,392 **** mainloop.o: const.h tgif_dbg.h patchlvl.h types.h animate.e auxtext.e \ choice.e cmd.e color.e cutpaste.e cursor.e dialog.e drawing.e \ ! exec.e expr.e file.e font.e grid.e help.e imgproc.e import.e \ ! mainloop.e mainmenu.e menu.e msg.e names.e navigate.e obj.e \ ! page.e ps.e raster.e remote.e ruler.e scroll.e select.e \ ! setup.e shape.e shortcut.e stk.e text.e util.e version.e \ ! wb1.e xbitmap.e xpixmap.e mainmenu.o: const.h tgif_dbg.h types.h align.e choice.e color.e cursor.e \ edit.e file.e font.e grid.e help.e imgproc.e mainloop.e \ --- 384,392 ---- mainloop.o: const.h tgif_dbg.h patchlvl.h types.h animate.e auxtext.e \ choice.e cmd.e color.e cutpaste.e cursor.e dialog.e drawing.e \ ! edit.e exec.e expr.e file.e font.e ftp.e grid.e help.e http.e \ ! imgproc.e import.e mainloop.e mainmenu.e menu.e msg.e names.e \ ! navigate.e obj.e page.e ps.e raster.e remote.e ruler.e \ ! scroll.e select.e setup.e shape.e shortcut.e stk.e text.e \ ! util.e version.e wb1.e xbitmap.e xpixmap.e mainmenu.o: const.h tgif_dbg.h types.h align.e choice.e color.e cursor.e \ edit.e file.e font.e grid.e help.e imgproc.e mainloop.e \ *** tgif.man.orig Thu Dec 26 01:11:22 1996 --- tgif.man Thu Dec 26 01:11:22 1996 *************** *** 1,4 **** ! .\"@(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/tgif.man,v 3.3 1996/10/27 23:54:50 william Exp $ ! .TH TGIF n "Version 3.0 Patchlevel 10 and Above" "Tgif" .\" .SH NAME --- 1,9 ---- ! .\" Tgif's man pages. ! .\" ! .\" @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/tgif.man,v 3.7 1996/12/26 06:00:39 william Exp $ ! .\" ! .\" ! .\" ! .TH TGIF n "Version 3.0 Patchlevel 11 and Above" "Tgif" .\" .SH NAME *************** *** 35,38 **** --- 40,44 ---- [\fB-f\fR] [\fB-text\fR] + [\fB-raw[+h]\fR] [\fB-gray\fR] [\fB-color | -reqcolor\fR] *************** *** 104,107 **** --- 110,116 ---- \fB-f\fR, or \fB-text\fR options are specified, any other command line options are ignored.) + Using the \fI-raw\fR causes the content of the files to be dumped to stdout. + If \fI-raw+h\fR is used and if the file is an HTTP URL, the HTTP header is also + dumped to stdout. Using the \fI-gray\fR option has the same effect as setting the Tgif.UseGrayScale X default to true (see the X DEFAULTS section below). *************** *** 1650,1653 **** --- 1659,1676 ---- and pass to it. Please see the SHORTCUTS section for a description of shortcuts. + .TP + .I substitute_attr(,,,) + This command replaces occurrances of in the value part of the + attribute specified by by the value of the attribute + specified by and write the result into the attribute + specified by . + .TP + .I get_file_size(,) + This command puts the size of file specified by in the + attribute specified by . + .TP + .I is_file(,) + This command puts a "1" in the attribute specified by if the + file specified by exists. It puts a "0" otherwise. .\" .SH ARITHMETIC EXPRESSIONS *************** *** 3292,3295 **** --- 3315,3324 ---- If set to ``true'', stretchable text mode is the initial mode. The default is false. + .TP + .I Tgif.EditTextSize: NUMBER + This specifies the initial text size to be used in editing existing text + objects. NUMBER should either be 0 or a value between 4 and 34 (inclusive). + If NUMBER is 0, the actual text size is used in editing existing text objects. + The default is 0. .\" .SH ENVIRONMENT VARIABLE *** descrip.mms.orig Thu Dec 26 01:11:24 1996 --- descrip.mms Thu Dec 26 01:11:24 1996 *************** *** 6,10 **** ! $ DEFINE SYS SYS$LIBRARY ! ! ! @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/descrip.mms,v 3.6 1996/10/31 06:41:31 william Exp $ ! --- 6,10 ---- ! $ DEFINE SYS SYS$LIBRARY ! ! ! @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/descrip.mms,v 3.8 1996/12/26 05:31:15 william Exp $ ! *************** *** 264,269 **** help.obj depends_on help.c,const.h,tgif_dbg.h,types.h,patchlvl.h,color.e,- dialog.e,help.e,menu.e,msg.e,setup.e,util.e,version.e ! http.obj depends_on http.c,const.h,tgif_dbg.h,types.h,patchlvl.h,http.e,msg.e,- ! remote.e,tcp.e,util.e,version.e imgproc.obj depends_on imgproc.c,const.h,tgif_dbg.h,types.h,auxtext.e,choice.e,- cmd.e,color.e,cursor.e,dialog.e,drawing.e,dup.e,file.e,grid.e,- --- 264,269 ---- help.obj depends_on help.c,const.h,tgif_dbg.h,types.h,patchlvl.h,color.e,- dialog.e,help.e,menu.e,msg.e,setup.e,util.e,version.e ! http.obj depends_on http.c,const.h,tgif_dbg.h,types.h,patchlvl.h,file.e,http.e,- ! msg.e,remote.e,tcp.e,util.e,version.e imgproc.obj depends_on imgproc.c,const.h,tgif_dbg.h,types.h,auxtext.e,choice.e,- cmd.e,color.e,cursor.e,dialog.e,drawing.e,dup.e,file.e,grid.e,- *************** *** 278,286 **** mainloop.obj depends_on mainloop.c,const.h,tgif_dbg.h,patchlvl.h,types.h,- animate.e,auxtext.e,choice.e,cmd.e,color.e,cutpaste.e,cursor.e,- ! dialog.e,drawing.e,exec.e,expr.e,file.e,font.e,grid.e,help.e,- ! imgproc.e,import.e,mainloop.e,mainmenu.e,menu.e,msg.e,names.e,- ! navigate.e,obj.e,page.e,ps.e,raster.e,remote.e,ruler.e,- ! scroll.e,select.e,setup.e,shape.e,shortcut.e,stk.e,text.e,- ! util.e,version.e,wb1.e,xbitmap.e,xpixmap.e mainmenu.obj depends_on mainmenu.c,const.h,tgif_dbg.h,types.h,align.e,choice.e,- color.e,cursor.e,edit.e,file.e,font.e,grid.e,help.e,imgproc.e,- --- 278,286 ---- mainloop.obj depends_on mainloop.c,const.h,tgif_dbg.h,patchlvl.h,types.h,- animate.e,auxtext.e,choice.e,cmd.e,color.e,cutpaste.e,cursor.e,- ! dialog.e,drawing.e,edit.e,exec.e,expr.e,file.e,font.e,ftp.e,- ! grid.e,help.e,http.e,imgproc.e,import.e,mainloop.e,mainmenu.e,- ! menu.e,msg.e,names.e,navigate.e,obj.e,page.e,ps.e,raster.e,- ! remote.e,ruler.e,scroll.e,select.e,setup.e,shape.e,shortcut.e,- ! stk.e,text.e,util.e,version.e,wb1.e,xbitmap.e,xpixmap.e mainmenu.obj depends_on mainmenu.c,const.h,tgif_dbg.h,types.h,align.e,choice.e,- color.e,cursor.e,edit.e,file.e,font.e,grid.e,help.e,imgproc.e,- *** tgif.Xdefaults.orig Thu Dec 26 01:11:25 1996 --- tgif.Xdefaults Thu Dec 26 01:11:25 1996 *************** *** 7,11 **** ! identical to the default values used in tgif. ! ! ! @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/tgif.Xdefaults,v 3.3 1996/09/15 05:04:51 william Exp $ ! Tgif.Geometry: 640x512-40+20 --- 7,11 ---- ! identical to the default values used in tgif. ! ! ! @(#)$Header: /u/halfmoon/home/william/src/tgif/v3/RCS/tgif.Xdefaults,v 3.4 1996/12/18 20:27:04 william Exp $ ! Tgif.Geometry: 640x512-40+20 *************** *** 305,306 **** --- 305,308 ---- Tgif.ShapeShadowSpec: 2,2 Tgif.StretchableText: false + Tgif.EditTextSize: 0 + !Tgif.EditTextSize: 14