william@oahu.cs.ucla.edu (William Cheng) (08/18/90)
I've just put tgif-1.13 in the following places for anonymous ftp: expo.lcs.mit.edu contrib/tgif-1.13.tar.Z cs.ucla.edu pub/tgif-1.13.tar.Z Here's a short list of added features/bug fixes. 1) Fix a bug to set the font of the active cursor correctly when adding or deleting points. 2) Fix a bug for ``prtgif'' so that it works correctly when the page style is not portrait. 3) Every object can have attributes, and attribute's name field can be empty. 4) Add copy and paste operations. Support copy and paste between multiple tgifs. Thanks to Kouichi Matsuda@NEC in Japan for his contribution to the code. The following is the patch to take tgif from version 1.12 to 1.13. ---------------------------------> cut here <--------------------------------- *** attr.c.orig Fri Aug 17 13:45:27 1990 --- attr.c Fri Aug 17 13:45:29 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/attr.c,v 1.6 90/07/30 11:09:21 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/attr.c,v 1.9 90/08/13 09:23:13 william Exp $"; #endif *************** *** 75,93 **** own_ptr = AttrPtr->owner; ! if (own_ptr->type == OBJ_POLY) ! { ! top_attr_ad = &(own_ptr->detail.p->fattr); ! bot_attr_ad = &(own_ptr->detail.p->lattr); ! } ! else ! { ! top_attr_ad = &(own_ptr->detail.r->fattr); ! bot_attr_ad = &(own_ptr->detail.r->lattr); ! } if (*top_attr_ad == AttrPtr) ! *top_attr_ad = AttrPtr->next; ! else ! AttrPtr->prev->next = AttrPtr->next; if (*bot_attr_ad == AttrPtr) --- 75,85 ---- own_ptr = AttrPtr->owner; ! top_attr_ad = &(own_ptr->fattr); ! bot_attr_ad = &(own_ptr->lattr); if (*top_attr_ad == AttrPtr) ! *top_attr_ad = AttrPtr->next; ! else ! AttrPtr->prev->next = AttrPtr->next; if (*bot_attr_ad == AttrPtr) *************** *** 106,110 **** static ! short ParseAttrStr(Str, name, s) char * Str, * name, * s; { --- 98,102 ---- static ! void ParseAttrStr(Str, name, s) char * Str, * name, * s; { *************** *** 134,142 **** *ptr = '\0'; - - return (TRUE); } else ! return (FALSE); } --- 126,135 ---- *ptr = '\0'; } else ! { ! *name = '\0'; ! strcpy (s, Str); ! } } *************** *** 267,278 **** topAttr = botAttr = NULL; ! switch (ToObjPtr->type) ! { ! case OBJ_POLY: from_attr_ptr = FromObjPtr->detail.p->fattr; break; ! ! case OBJ_SYM: ! case OBJ_GROUP: ! case OBJ_ICON: from_attr_ptr = FromObjPtr->detail.r->fattr; break; ! } for ( ; from_attr_ptr != NULL; from_attr_ptr = from_attr_ptr->next) { --- 260,264 ---- topAttr = botAttr = NULL; ! from_attr_ptr = FromObjPtr->fattr; for ( ; from_attr_ptr != NULL; from_attr_ptr = from_attr_ptr->next) { *************** *** 282,302 **** LinkInAttr (NULL, topAttr, to_attr_ptr); } ! switch (ToObjPtr->type) ! { ! case OBJ_POLY: ! ToObjPtr->detail.p->fattr = topAttr; ! ToObjPtr->detail.p->lattr = botAttr; ! break; ! case OBJ_SYM: ! case OBJ_GROUP: ! case OBJ_ICON: ! ToObjPtr->detail.r->fattr = topAttr; ! ToObjPtr->detail.r->lattr = botAttr; ! break; ! } } static ! int AddAttr(ObjPtr, TextObjPtr) struct ObjRec * ObjPtr, * TextObjPtr; { --- 268,277 ---- LinkInAttr (NULL, topAttr, to_attr_ptr); } ! ToObjPtr->fattr = topAttr; ! ToObjPtr->lattr = botAttr; } static ! void AddAttr(ObjPtr, TextObjPtr) struct ObjRec * ObjPtr, * TextObjPtr; { *************** *** 309,351 **** text_ptr = TextObjPtr->detail.t; ! if (ParseAttrStr(text_ptr->first->s, name, value)) ! { ! switch (ObjPtr->type) ! { ! case OBJ_POLY: ! topAttr = ObjPtr->detail.p->fattr; ! botAttr = ObjPtr->detail.p->lattr; ! break; ! case OBJ_SYM: ! case OBJ_GROUP: ! case OBJ_ICON: ! topAttr = ObjPtr->detail.r->fattr; ! botAttr = ObjPtr->detail.r->lattr; ! break; ! } ! UnlinkObj (TextObjPtr); ! TextObjPtr->next = TextObjPtr->prev = NULL; ! attr_ptr = NewAttr (ObjPtr, TextObjPtr, FALSE); ! UpdateAttr (text_ptr, attr_ptr); ! LinkInAttr (NULL, topAttr, attr_ptr); ! switch (ObjPtr->type) ! { ! case OBJ_POLY: ! ObjPtr->detail.p->fattr = topAttr; ! ObjPtr->detail.p->lattr = botAttr; ! break; ! case OBJ_SYM: ! case OBJ_GROUP: ! case OBJ_ICON: ! ObjPtr->detail.r->fattr = topAttr; ! ObjPtr->detail.r->lattr = botAttr; ! break; ! } ! return (TRUE); ! } ! else ! return (FALSE); } --- 284,299 ---- text_ptr = TextObjPtr->detail.t; ! ParseAttrStr(text_ptr->first->s, name, value); ! topAttr = ObjPtr->fattr; ! botAttr = ObjPtr->lattr; ! UnlinkObj (TextObjPtr); ! TextObjPtr->next = TextObjPtr->prev = NULL; ! attr_ptr = NewAttr (ObjPtr, TextObjPtr, FALSE); ! UpdateAttr (text_ptr, attr_ptr); ! LinkInAttr (NULL, topAttr, attr_ptr); ! ObjPtr->fattr = topAttr; ! ObjPtr->lattr = botAttr; } *************** *** 354,367 **** struct AttrRec * attr_ptr; struct ObjRec * owner_ptr = NULL, * attr_obj_ptr; ! struct SelRec * sel_ptr, * tmp_top_sel = NULL, * tmp_bot_sel = NULL; ! struct SelRec * new_sel_ptr; ! int still_valid = TRUE, text_count = 0; ! int sel_ltx, sel_lty, sel_rbx, sel_rby; ! for (sel_ptr = topSel; (sel_ptr!=NULL) && (still_valid); ! sel_ptr = sel_ptr->next) switch (sel_ptr->obj->type) { case OBJ_TEXT: text_count++; break; case OBJ_POLY: case OBJ_SYM: --- 302,316 ---- struct AttrRec * attr_ptr; struct ObjRec * owner_ptr = NULL, * attr_obj_ptr; ! struct SelRec * sel_ptr, * new_sel_ptr; ! int text_count = 0, sel_ltx, sel_lty, sel_rbx, sel_rby; ! for (sel_ptr = topSel; sel_ptr != NULL; sel_ptr = sel_ptr->next) switch (sel_ptr->obj->type) { case OBJ_TEXT: text_count++; break; + + case OBJ_BOX: + case OBJ_OVAL: + case OBJ_POLYGON: case OBJ_POLY: case OBJ_SYM: *************** *** 368,442 **** case OBJ_GROUP: case OBJ_ICON: ! if (owner_ptr == NULL) ! owner_ptr = sel_ptr->obj; ! else { ! still_valid = FALSE; ! Msg("Too many icon, group, symbol, or poly objects selected."); } break; - case OBJ_BOX: - case OBJ_OVAL: - case OBJ_POLYGON: - still_valid = FALSE; - Msg("Only icons, groups, symbols, and polys can have attributes"); - break; } ! if (still_valid) { ! if (text_count == 0) ! Msg("No text objects selected to add as attributes."); ! else ! { ! if (owner_ptr != NULL) ! { ! HighLightReverse (); ! sel_ltx = selLtX; sel_lty = selLtY; ! sel_rbx = selRbX; sel_rby = selRbY; ! for (sel_ptr = botSel; sel_ptr != NULL; sel_ptr = sel_ptr->prev) ! if (sel_ptr->obj->type == OBJ_TEXT) ! if (!AddAttr(owner_ptr, sel_ptr->obj)) ! { /* bad format for the text to be an attribute */ ! new_sel_ptr = (struct SelRec *) calloc (1, ! sizeof(struct SelRec)); ! new_sel_ptr->obj = sel_ptr->obj; ! new_sel_ptr->prev = NULL; ! new_sel_ptr->next = tmp_top_sel; ! if (tmp_top_sel == NULL) ! tmp_bot_sel = new_sel_ptr; ! else ! tmp_top_sel->prev = new_sel_ptr; ! tmp_top_sel = new_sel_ptr; ! } ! RemoveAllSel (); ! UnlinkObj (owner_ptr); ! AddObj (NULL, topObj, owner_ptr); ! topSel = botSel = (struct SelRec *) calloc (1, ! sizeof(struct SelRec)); ! topSel->obj = owner_ptr; ! topSel->prev = NULL; ! botSel->next = tmp_top_sel; ! if (tmp_top_sel != NULL) ! { ! tmp_top_sel->prev = topSel; ! botSel = tmp_bot_sel; ! } ! AdjObjBBox (owner_ptr); ! UpdSelBBox (); ! RedrawAreas (botObj, sel_ltx-(1<<zoomScale), sel_lty-(1<<zoomScale), ! sel_rbx+(1<<zoomScale), sel_rby+(1<<zoomScale), ! selLtX-(1<<zoomScale), selLtY-(1<<zoomScale), ! selRbX+(1<<zoomScale), selRbY+(1<<zoomScale)); ! HighLightForward (); ! justDupped = FALSE; ! } ! else ! Msg("No icon, group, symbol, poly objects selected."); ! } ! } } --- 317,363 ---- case OBJ_GROUP: case OBJ_ICON: ! if (owner_ptr != NULL) { ! Msg("Too non-text objects selected."); ! return; } + owner_ptr = sel_ptr->obj; break; } ! if (text_count == 0) { ! Msg("No text objects selected to add as attributes."); ! return; ! } ! if (owner_ptr == NULL) ! { ! Msg("No objects (other than TEXT objects) selected."); ! return; ! } ! HighLightReverse (); ! sel_ltx = selLtX; sel_lty = selLtY; ! sel_rbx = selRbX; sel_rby = selRbY; ! for (sel_ptr = botSel; sel_ptr != NULL; sel_ptr = sel_ptr->prev) ! if (sel_ptr->obj->type == OBJ_TEXT) ! AddAttr(owner_ptr, sel_ptr->obj); ! RemoveAllSel (); ! UnlinkObj (owner_ptr); ! AddObj (NULL, topObj, owner_ptr); ! topSel = botSel = (struct SelRec *) calloc (1, sizeof(struct SelRec)); ! topSel->obj = owner_ptr; ! topSel->prev = NULL; ! botSel->next = NULL; ! AdjObjBBox (owner_ptr); ! UpdSelBBox (); ! RedrawAreas (botObj, sel_ltx-(1<<zoomScale), sel_lty-(1<<zoomScale), ! sel_rbx+(1<<zoomScale), sel_rby+(1<<zoomScale), ! selLtX-(1<<zoomScale), selLtY-(1<<zoomScale), ! selRbX+(1<<zoomScale), selRbY+(1<<zoomScale)); ! HighLightForward (); ! justDupped = FALSE; } *************** *** 446,452 **** struct AttrRec * AttrPtr; { - /* fprintf (FP, "attr(\"%s\", \"%s\", %1d, %1d, %1d,\n", */ - /* AttrPtr->name, AttrPtr->s, AttrPtr->shown, */ - /* AttrPtr->nameshown, AttrPtr->inherited); */ fprintf (FP, "attr(\""); SaveString (FP, AttrPtr->name); --- 367,370 ---- *************** *** 542,547 **** static ! int ShowAndUpdAttrNames () ! /* returns TRUE if any attribute names are updated */ /* This routine concatinate the 'name' and 's' first of every */ /* attribute of the selected object and assign that to the */ --- 460,468 ---- static ! int ShowAndUpdAttrNames (Force) ! int Force; ! /* Force will force attribute name to be shown whether the attribute */ ! /* is inherited or not. */ ! /* returns TRUE if any attribute names are updated */ /* This routine concatinate the 'name' and 's' first of every */ /* attribute of the selected object and assign that to the */ *************** *** 551,555 **** struct ObjRec * obj_ptr; struct AttrRec * attr_ptr; ! int has_attr, picture_changed = FALSE, obj_changed; int len1, len2; char * s, msg[80]; --- 472,476 ---- struct ObjRec * obj_ptr; struct AttrRec * attr_ptr; ! int picture_changed = FALSE, obj_changed; int len1, len2; char * s, msg[80]; *************** *** 558,576 **** { obj_ptr = sel_ptr->obj; ! has_attr = TRUE; ! switch (obj_ptr->type) { - case OBJ_POLY: attr_ptr = obj_ptr->detail.p->fattr; break; - case OBJ_GROUP: - case OBJ_SYM: - case OBJ_ICON: attr_ptr = obj_ptr->detail.r->fattr; break; - default: has_attr = FALSE; - } - if (has_attr && attr_ptr != NULL) - { obj_changed = FALSE; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) { ! if (!(attr_ptr->nameshown)) { s = attr_ptr->obj->detail.t->first->s; --- 479,489 ---- { obj_ptr = sel_ptr->obj; ! attr_ptr = obj_ptr->fattr; ! if (attr_ptr != NULL) { obj_changed = FALSE; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) { ! if (!(attr_ptr->nameshown) && (Force || !(attr_ptr->inherited))) { s = attr_ptr->obj->detail.t->first->s; *************** *** 601,605 **** void ShowAllAttrNames () { ! if (ShowAndUpdAttrNames ()) { HighLightReverse (); --- 514,518 ---- void ShowAllAttrNames () { ! if (ShowAndUpdAttrNames (TRUE)) { HighLightReverse (); *************** *** 621,625 **** struct ObjRec * obj_ptr; struct AttrRec * attr_ptr; ! int has_attr, picture_changed = FALSE, obj_changed; char * s; --- 534,538 ---- struct ObjRec * obj_ptr; struct AttrRec * attr_ptr; ! int picture_changed = FALSE, obj_changed; char * s; *************** *** 627,649 **** { obj_ptr = sel_ptr->obj; ! has_attr = TRUE; ! switch (obj_ptr->type) { - case OBJ_POLY: attr_ptr = obj_ptr->detail.p->fattr; break; - case OBJ_GROUP: - case OBJ_SYM: - case OBJ_ICON: attr_ptr = obj_ptr->detail.r->fattr; break; - default: has_attr = FALSE; - } - if (has_attr && attr_ptr != NULL) - { obj_changed = FALSE; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) { ! if (attr_ptr->nameshown) { s = attr_ptr->obj->detail.t->first->s; strcpy (s, attr_ptr->s); - attr_ptr->nameshown = FALSE; UpdTextBBox (attr_ptr->obj); if (attr_ptr->shown) obj_changed = picture_changed = TRUE; --- 540,554 ---- { obj_ptr = sel_ptr->obj; ! attr_ptr = obj_ptr->fattr; ! if (attr_ptr != NULL) { obj_changed = FALSE; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) { ! if (attr_ptr->nameshown && *(attr_ptr->name) != '\0') { + attr_ptr->nameshown = FALSE; s = attr_ptr->obj->detail.t->first->s; strcpy (s, attr_ptr->s); UpdTextBBox (attr_ptr->obj); if (attr_ptr->shown) obj_changed = picture_changed = TRUE; *************** *** 677,681 **** struct SelRec * * TopSelPtr, * * BotSelPtr; { ! struct AttrRec * attr_ptr = ObjPtr->detail.r->fattr; struct SelRec * new_sel_ptr; int len1, len2; --- 582,586 ---- struct SelRec * * TopSelPtr, * * BotSelPtr; { ! struct AttrRec * attr_ptr = ObjPtr->fattr; struct SelRec * new_sel_ptr; int len1, len2; *************** *** 735,743 **** struct ObjRec * obj_ptr; struct AttrRec * attr_ptr, * attr_ptr_next; ! int has_attr, picture_changed, obj_changed; char * s; HighLightReverse (); ! picture_changed = ShowAndUpdAttrNames (); for (sel_ptr = topSel; sel_ptr != NULL; sel_ptr = sel_ptr->next) --- 640,648 ---- struct ObjRec * obj_ptr; struct AttrRec * attr_ptr, * attr_ptr_next; ! int picture_changed, obj_changed; char * s; HighLightReverse (); ! picture_changed = ShowAndUpdAttrNames (FALSE); for (sel_ptr = topSel; sel_ptr != NULL; sel_ptr = sel_ptr->next) *************** *** 744,758 **** { obj_ptr = sel_ptr->obj; ! has_attr = TRUE; ! switch (obj_ptr->type) { - case OBJ_POLY: attr_ptr = obj_ptr->detail.p->fattr; break; - case OBJ_GROUP: - case OBJ_SYM: - case OBJ_ICON: attr_ptr = obj_ptr->detail.r->fattr; break; - default: has_attr = FALSE; - } - if (has_attr && attr_ptr != NULL) - { topAttr = botAttr = NULL; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr_next) --- 649,655 ---- { obj_ptr = sel_ptr->obj; ! attr_ptr = obj_ptr->fattr; ! if (attr_ptr != NULL) { topAttr = botAttr = NULL; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr_next) *************** *** 773,789 **** cfree (attr_ptr); } ! switch (obj_ptr->type) ! { ! case OBJ_POLY: ! obj_ptr->detail.p->fattr = topAttr; ! obj_ptr->detail.p->lattr = botAttr; ! break; ! case OBJ_GROUP: ! case OBJ_SYM: ! case OBJ_ICON: ! obj_ptr->detail.r->fattr = topAttr; ! obj_ptr->detail.r->lattr = botAttr; ! break; ! } AdjObjBBox (obj_ptr); } --- 670,675 ---- cfree (attr_ptr); } ! obj_ptr->fattr = topAttr; ! obj_ptr->lattr = botAttr; AdjObjBBox (obj_ptr); } *************** *** 906,910 **** break; case Button2: ! AttrPtr->nameshown = !AttrPtr->nameshown; UpdAttr (AttrPtr); if (AttrPtr->shown) --- 792,797 ---- break; case Button2: ! if (!(AttrPtr->nameshown) || *(AttrPtr->name) != '\0') ! AttrPtr->nameshown = !AttrPtr->nameshown; UpdAttr (AttrPtr); if (AttrPtr->shown) *************** *** 1012,1016 **** struct ObjRec * obj_ptr; struct AttrRec * attr_ptr, * attr_ptr1; ! int has_attr = TRUE, num_attrs = 0, i, index, x, y; int picture_changed, sel_ltx, sel_lty, sel_rbx, sel_rby; int * fore_colors, * pixel_ptr, * valid, * flag_ptr; --- 899,903 ---- struct ObjRec * obj_ptr; struct AttrRec * attr_ptr, * attr_ptr1; ! int num_attrs = 0, i, index, x, y; int picture_changed, sel_ltx, sel_lty, sel_rbx, sel_rby; int * fore_colors, * pixel_ptr, * valid, * flag_ptr; *************** *** 1023,1037 **** obj_ptr = topSel->obj; ! has_attr = TRUE; ! switch (obj_ptr->type) ! { ! case OBJ_POLY: attr_ptr1 = attr_ptr = obj_ptr->detail.p->fattr; break; ! case OBJ_GROUP: ! case OBJ_SYM: ! case OBJ_ICON: attr_ptr1 = attr_ptr = obj_ptr->detail.r->fattr; break; ! default: has_attr = FALSE; ! } ! if (!has_attr) ! { Msg ("Please select one poly, group, symbol, or icon object."); return; } for ( ; attr_ptr1 != NULL; attr_ptr1 = attr_ptr1->next, num_attrs++) ; --- 910,914 ---- obj_ptr = topSel->obj; ! attr_ptr1 = attr_ptr = obj_ptr->fattr; for ( ; attr_ptr1 != NULL; attr_ptr1 = attr_ptr1->next, num_attrs++) ; *** box.c.orig Fri Aug 17 13:45:37 1990 --- box.c Fri Aug 17 13:45:38 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/box.c,v 1.5 90/07/16 10:29:15 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/box.c,v 1.7 90/08/13 09:23:32 william Exp $"; #endif *************** *** 247,251 **** --- 247,254 ---- obj_ptr->type = OBJ_BOX; obj_ptr->color = colorIndex; + obj_ptr->id = objId++; + obj_ptr->dirty = FALSE; obj_ptr->detail.b = box_ptr; + obj_ptr->fattr = obj_ptr->lattr = NULL; AddObj (NULL, topObj, obj_ptr); } *************** *** 339,345 **** { fprintf (FP, "box(%s,", colorMenuItems[ObjPtr->color]); ! fprintf (FP, "%1d,%1d,%1d,%1d,%1d,%1d,%1d)", ObjPtr->obbox.ltx, ObjPtr->obbox.lty, ObjPtr->obbox.rbx, ObjPtr->obbox.rby, ! ObjPtr->detail.b->fill, ObjPtr->detail.b->width, ObjPtr->detail.b->pen); } --- 342,351 ---- { fprintf (FP, "box(%s,", colorMenuItems[ObjPtr->color]); ! fprintf (FP, "%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,", ObjPtr->obbox.ltx, ObjPtr->obbox.lty, ObjPtr->obbox.rbx, ObjPtr->obbox.rby, ! ObjPtr->detail.b->fill, ObjPtr->detail.b->width, ! ObjPtr->detail.b->pen, ObjPtr->id); ! SaveAttrs (FP, ObjPtr->lattr); ! fprintf (FP, ")"); } *************** *** 366,373 **** case 2: width = 6; break; } } ! else sscanf (s, "%d , %d , %d , %d , %d , %d , %d", <x, <y, &rbx, &rby, &fill, &width, &pen); box_ptr->fill = fill; --- 372,389 ---- case 2: width = 6; break; } + (*ObjPtr)->id = objId++; } ! else if (fileVersion <= 7) ! { sscanf (s, "%d , %d , %d , %d , %d , %d , %d", <x, <y, &rbx, &rby, &fill, &width, &pen); + (*ObjPtr)->id = objId++; + } + else + { + sscanf (s, "%d , %d , %d , %d , %d , %d , %d , %d", + <x, <y, &rbx, &rby, &fill, &width, &pen, &((*ObjPtr)->id)); + if ((*ObjPtr)->id >= objId) objId = (*ObjPtr)->id + 1; + } box_ptr->fill = fill; *************** *** 377,380 **** --- 393,397 ---- (*ObjPtr)->y = lty; (*ObjPtr)->color = FindColorIndex (color_str); + (*ObjPtr)->dirty = FALSE; (*ObjPtr)->type = OBJ_BOX; (*ObjPtr)->obbox.ltx = ltx; *** choice.c.orig Fri Aug 17 13:45:45 1990 --- choice.c Fri Aug 17 13:45:46 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/choice.c,v 1.5 90/06/26 15:22:27 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/choice.c,v 1.6 90/08/15 16:01:40 william Exp $"; #endif *** copypaste.c.orig Fri Aug 17 13:45:49 1990 --- copypaste.c Fri Aug 17 13:45:51 1990 *************** *** 0 **** --- 1,298 ---- + /* + * Author: Kou1 Ma2da (matsuda@ccs.mt.nec.co.jp) + * Modified By: William Chia-Wei Cheng (william@cs.ucla.edu) + * + * Copyright (C) 1990, William Cheng. + */ + #ifndef lint + static char RCSid[] = + "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/copypaste.c,v 1.7 90/08/16 13:32:44 william Exp $"; + #endif + + #include <sys/types.h> + #include <sys/stat.h> + #include <stdio.h> + #include <X11/Xlib.h> + #include "const.h" + #include "types.h" + + #include "choice.e" + #include "color.e" + #include "dup.e" + #include "file.e" + #include "font.e" + #include "obj.e" + #include "pattern.e" + #include "select.e" + #include "setup.e" + #include "special.e" + #include "text.e" + + #define TGIF_HEADER 0x80 + + extern char * mktemp(); + + static char * cutBuffer = NULL; + + void CopyToCutBuffer () + { + FILE * fp; + register struct SelRec * sel_ptr; + struct ObjRec * obj_ptr, * top_obj, * bot_obj; + char * tmpfile, message[MAXSTRING]; + struct stat stat; + unsigned char header = TGIF_HEADER; + int level; + + if (topSel == NULL) + { + Msg ("No object selected for the COPY operation."); + return; + } + tmpfile = mktemp ("/tmp/TgifXXXXXX"); + if ((fp = fopen (tmpfile, "w+")) == NULL) + { + sprintf (message, "Can not open %s.", tmpfile); + Msg (message); + return; + } + + write (fileno(fp), &header, 1); + + top_obj = bot_obj = NULL; + for (sel_ptr = botSel; sel_ptr != NULL; sel_ptr = sel_ptr->prev) + { + obj_ptr = DupObj (sel_ptr->obj); + + obj_ptr->prev = NULL; + obj_ptr->next = top_obj; + + if (top_obj == NULL) + bot_obj = obj_ptr; + else + top_obj->prev = obj_ptr; + top_obj = obj_ptr; + } + Save (fp, bot_obj, 0); + + fflush (fp); + if (fstat (fileno(fp), &stat) < 0) + { + fclose (fp); + unlink (tmpfile); + sprintf (message, "FSTAT error in %s. Copy aborted!", tmpfile); + Msg (message); + return; + } + + if (cutBuffer != NULL) cfree (cutBuffer); + cutBuffer = (char *) calloc (stat.st_size, sizeof(char)); + + if (rewind (fp) < 0) + { + sprintf (message, "Error in rewinding %s. Copy aborted!", tmpfile); + Msg (message); + } + else if (read (fileno(fp), cutBuffer, stat.st_size) < stat.st_size) + { + sprintf (message, "READ error in %s. Copy aborted!", tmpfile); + Msg (message); + } + else + { + XStoreBytes (mainDisplay, cutBuffer, stat.st_size); + Msg ("Copy buffer updated."); + } + fclose (fp); + unlink (tmpfile); + } + + static + void PasteString (CutBuffer) + char * CutBuffer; + { + register char * c_ptr, * dest_c_ptr; + int x, y, w, num_lines, char_count, max_len = 0; + int root_x, root_y, grid_x, grid_y; + unsigned int status; + char line[MAXSTRING], msg[MAXSTRING]; + struct StrRec * first_str, * last_str, *str_ptr; + struct ObjRec * obj_ptr; + struct TextRec * text_ptr; + Window root_win, child_win; + + if (*CutBuffer == '\0') { Msg ("Cut buffer is empty"); return; } + + TieLooseEnds (); + SetCurChoice (NOTHING); + if (topSel != NULL) { HighLightReverse (); RemoveAllSel (); } + + Msg ("Paste from a non-tgif tool."); + + XQueryPointer (mainDisplay, drawWindow, &root_win, &child_win, + &root_x, &root_y, &x, &y, &status); + GridXY (x, y, &grid_x, &grid_y); + + text_ptr = (struct TextRec *) calloc (1, sizeof(struct TextRec)); + text_ptr->font = curFont; + text_ptr->dpi = curFontDPI; + text_ptr->style = curStyle; + text_ptr->attr = NULL; + text_ptr->size = curSize; + text_ptr->just = textJust; + text_ptr->rotate = curRotate; + text_ptr->pen = penPat; + + first_str = last_str = NULL; + for (c_ptr = CutBuffer, num_lines = 0; *c_ptr != '\0'; num_lines++) + { + str_ptr = (struct StrRec *) calloc (1, sizeof(struct StrRec)); + + char_count = 0; + dest_c_ptr = str_ptr->s; + while (*c_ptr != '\0' && *c_ptr != '\n' && *c_ptr != '\r') + { + *dest_c_ptr++ = *c_ptr++; + if (++char_count == MAXSTRING) + { + sprintf (msg, "String length exceeds $1d. String truncated.", + MAXSTRING); + Msg (msg); + while (*c_ptr != '\0' && *c_ptr != '\n' && *c_ptr != '\r') c_ptr++; + break; + } + } + *dest_c_ptr = '\0'; + + str_ptr->prev = last_str; + str_ptr->next = NULL; + if (last_str == NULL) + first_str = str_ptr; + else + last_str->next = str_ptr; + last_str = str_ptr; + + w = XTextWidth (canvasFontPtr, str_ptr->s, strlen (str_ptr->s)); + if (w > max_len) max_len = w; + + if (*c_ptr == '\n' || *c_ptr == '\r') c_ptr++; + } + + text_ptr->lines = num_lines; + text_ptr->first = first_str; + text_ptr->last = last_str; + + obj_ptr = (struct ObjRec *) calloc (1, sizeof(struct ObjRec)); + obj_ptr->x = grid_x; + obj_ptr->y = grid_y; + obj_ptr->type = OBJ_TEXT; + obj_ptr->color = colorIndex; + obj_ptr->id = objId++;; + obj_ptr->dirty = FALSE; + obj_ptr->detail.t = text_ptr; + obj_ptr->fattr = obj_ptr->lattr = NULL; + + SetTextBBox (obj_ptr, textJust, max_len, num_lines*textCursorH, curRotate); + + AddObj (NULL, topObj, obj_ptr); + AdjObjBBox (obj_ptr); + PlaceTopObj (); + if (topObj != NULL) SelectTopObj (); + SetFileModified (TRUE); + justDupped = FALSE; + } + + void PasteFromCutBuffer () + { + FILE * fp; + int len; + register char * d; + char * tmpfile, * cut_buffer, message[MAXSTRING]; + unsigned char header = TGIF_HEADER; + struct ObjRec * obj_ptr, * saved_top_obj, * saved_bot_obj; + + cut_buffer = (char *) XFetchBytes (mainDisplay, &len); + if (len == 0) + { + Msg ("Cut buffer is empty"); + return; + } + if (((unsigned char)(*cut_buffer)) != header) + { + PasteString (cut_buffer); + return; + } + #ifdef KANJI + myPasteKanji (cut_buffer, len); + #endif + cut_buffer++; + len--; + + tmpfile = mktemp ("/tmp/TgifXXXXXX"); + if ((fp = fopen (tmpfile, "w+")) == NULL) + { + sprintf (message, "Can not open %s for write.", tmpfile); + Msg (message); + return; + } + if (write (fileno(fp), cut_buffer, len) < len) + { + fclose (fp); + unlink (tmpfile); + sprintf (message, "FWRITE error in writing to %s. Paste aborted!", + tmpfile); + Msg (message); + return; + } + fflush (fp); + if (rewind (fp) < 0) + { + fclose (fp); + unlink (tmpfile); + sprintf (message, "Error in rewinding %s. Paste aborted!", tmpfile); + Msg (message); + return; + } + + TieLooseEnds (); + SetCurChoice (NOTHING); + + saved_top_obj = topObj; + saved_bot_obj = botObj; + topObj = botObj = NULL; + + importingFile = TRUE; + while (ReadObj (fp, &obj_ptr, FALSE)) + if (obj_ptr != NULL) + AddObj (NULL, topObj, obj_ptr); + + fclose (fp); + importingFile = FALSE; + if (topObj != NULL) SetFileModified (TRUE); + + RedrawDrawWindow (botObj); + SelAllObj (); + + if (botObj != NULL) + botObj->next = saved_top_obj; + else + topObj = saved_top_obj; + + if (saved_top_obj != NULL) + { + saved_top_obj->prev = botObj; + botObj = saved_bot_obj; + } + unlink (tmpfile); + Msg ("Objects pasted from tgif."); + } + + void CleanUpCutBuffer () + { + if (cutBuffer != NULL) + { + *cutBuffer = '\0'; + cfree (cutBuffer); + cutBuffer = NULL; + } + } *** drawing.c.orig Fri Aug 17 13:46:02 1990 --- drawing.c Fri Aug 17 13:46:04 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/drawing.c,v 1.8 90/07/29 15:34:38 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/drawing.c,v 1.11 90/08/16 09:34:54 william Exp $"; #endif *************** *** 19,22 **** --- 19,23 ---- #include "box.e" #include "choice.e" + #include "copypaste.e" #include "cursor.e" #include "dialog.e" *************** *** 143,152 **** case OBJ_POLY: DrawPolyObj (Win, drawOrigX, drawOrigY, ObjPtr); ! DrawAttrs(Win, drawOrigX, drawOrigY, ObjPtr->detail.p->fattr); break; ! case OBJ_BOX: DrawBoxObj (Win, drawOrigX, drawOrigY, ObjPtr); break; ! case OBJ_OVAL: DrawOvalObj (Win, drawOrigX, drawOrigY, ObjPtr); break; case OBJ_TEXT: DrawTextObj (Win, drawOrigX, drawOrigY, ObjPtr); break; ! case OBJ_POLYGON: DrawPolygonObj (Win, drawOrigX, drawOrigY, ObjPtr); break; --- 144,161 ---- case OBJ_POLY: DrawPolyObj (Win, drawOrigX, drawOrigY, ObjPtr); ! DrawAttrs(Win, drawOrigX, drawOrigY, ObjPtr->fattr); break; ! case OBJ_BOX: ! DrawBoxObj (Win, drawOrigX, drawOrigY, ObjPtr); ! DrawAttrs(Win, drawOrigX, drawOrigY, ObjPtr->fattr); ! break; ! case OBJ_OVAL: ! DrawOvalObj (Win, drawOrigX, drawOrigY, ObjPtr); ! DrawAttrs(Win, drawOrigX, drawOrigY, ObjPtr->fattr); ! break; case OBJ_TEXT: DrawTextObj (Win, drawOrigX, drawOrigY, ObjPtr); break; ! case OBJ_POLYGON: ! DrawPolygonObj (Win, drawOrigX, drawOrigY, ObjPtr); ! DrawAttrs(Win, drawOrigX, drawOrigY, ObjPtr->fattr); break; *************** *** 158,164 **** if (BBoxIntersect (obj_ptr->bbox, drawWinBBox)) DrawObj (Win, obj_ptr); ! if (ObjPtr->type == OBJ_ICON && ObjPtr->detail.r->dirty) { ! attr_ptr = ObjPtr->detail.r->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) UpdTextBBox (attr_ptr->obj); --- 167,173 ---- if (BBoxIntersect (obj_ptr->bbox, drawWinBBox)) DrawObj (Win, obj_ptr); ! if (ObjPtr->type == OBJ_ICON && ObjPtr->dirty) { ! attr_ptr = ObjPtr->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) UpdTextBBox (attr_ptr->obj); *************** *** 165,171 **** AdjObjBBox (ObjPtr); UpdSelBBox (); ! ObjPtr->detail.r->dirty = FALSE; } ! DrawAttrs(Win, drawOrigX, drawOrigY, ObjPtr->detail.r->fattr); if (ObjPtr->type == OBJ_SYM) DrawSymOutline (Win, drawOrigX, drawOrigY, ObjPtr); --- 174,180 ---- AdjObjBBox (ObjPtr); UpdSelBBox (); ! ObjPtr->dirty = FALSE; } ! DrawAttrs(Win, drawOrigX, drawOrigY, ObjPtr->fattr); if (ObjPtr->type == OBJ_SYM) DrawSymOutline (Win, drawOrigX, drawOrigY, ObjPtr); *************** *** 480,484 **** case '\027': /*^W*/ SetCurChoice (DRAWTEXT); break; case '\030': /*^X*/ DelAllSelObj (); break; ! case '\031': /*^Y*/ break; case '\032': /*^Z*/ return (AnimateProc ()); break; case ',': /*^,*/ ScrollLeft (); break; --- 489,493 ---- case '\027': /*^W*/ SetCurChoice (DRAWTEXT); break; case '\030': /*^X*/ DelAllSelObj (); break; ! case '\031': /*^Y*/ CopyToCutBuffer (); break; case '\032': /*^Z*/ return (AnimateProc ()); break; case ',': /*^,*/ ScrollLeft (); break; *************** *** 554,558 **** case '\027': /*^#W*/ ToggleAllSelLineType (); break; case '\030': /*^#X*/ break; ! case '\031': /*^#Y*/ break; case '\032': /*^#Z*/ break; } --- 563,567 ---- case '\027': /*^#W*/ ToggleAllSelLineType (); break; case '\030': /*^#X*/ break; ! case '\031': /*^#Y*/ PasteFromCutBuffer (); break; case '\032': /*^#Z*/ break; } *************** *** 569,573 **** for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) ! if (obj_ptr->type == OBJ_ICON && obj_ptr->detail.r->dirty) return (TRUE); return (FALSE); --- 578,582 ---- for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) ! if (obj_ptr->type == OBJ_ICON && obj_ptr->dirty) return (TRUE); return (FALSE); *** dup.c.orig Fri Aug 17 13:46:11 1990 --- dup.c Fri Aug 17 13:46:12 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/dup.c,v 1.3 90/07/08 00:29:43 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/dup.c,v 1.6 90/08/16 09:35:11 william Exp $"; #endif *************** *** 20,23 **** --- 20,25 ---- #include "setup.e" + extern struct ObjRec * DupObj (); + int justDupped = FALSE; int dupDx = INVALID, dupDy = INVALID; *************** *** 29,32 **** --- 31,36 ---- ToObjPtr->y = FromObjPtr->y; ToObjPtr->color = FromObjPtr->color; + ToObjPtr->id = objId++; + ToObjPtr->dirty = FALSE; ToObjPtr->type = FromObjPtr->type; ToObjPtr->bbox.ltx = FromObjPtr->bbox.ltx; *************** *** 62,66 **** poly_ptr->pen = PolyPtr->pen; poly_ptr->fill = PolyPtr->fill; - poly_ptr->id = objId++; if ((poly_ptr->curved = PolyPtr->curved) == LT_SPLINE) { --- 66,69 ---- *************** *** 173,176 **** --- 176,180 ---- text_ptr->font = TextPtr->font; + text_ptr->dpi = TextPtr->dpi; text_ptr->style = TextPtr->style; text_ptr->size = TextPtr->size; *************** *** 190,194 **** struct ObjRec * top_obj, * bot_obj; struct ObjRec * from_obj_ptr, * to_obj_ptr; - static struct ObjRec * DupObj (); group_ptr = (struct GroupRec *) calloc (1, sizeof(struct GroupRec)); --- 194,197 ---- *************** *** 211,215 **** } - static struct ObjRec * DupObj (ObjPtr) struct ObjRec * ObjPtr; --- 214,217 ---- *************** *** 226,233 **** DupAttrs (ObjPtr, obj_ptr); break; ! case OBJ_BOX: DupBoxObj (ObjPtr->detail.b, obj_ptr); break; ! case OBJ_OVAL: DupOvalObj (ObjPtr->detail.o, obj_ptr); break; case OBJ_TEXT: DupTextObj (ObjPtr->detail.t, obj_ptr); break; ! case OBJ_POLYGON: DupPolygonObj (ObjPtr->detail.g, obj_ptr); break; case OBJ_SYM: case OBJ_GROUP: --- 228,244 ---- DupAttrs (ObjPtr, obj_ptr); break; ! case OBJ_BOX: ! DupBoxObj (ObjPtr->detail.b, obj_ptr); ! DupAttrs (ObjPtr, obj_ptr); ! break; ! case OBJ_OVAL: ! DupOvalObj (ObjPtr->detail.o, obj_ptr); ! DupAttrs (ObjPtr, obj_ptr); ! break; case OBJ_TEXT: DupTextObj (ObjPtr->detail.t, obj_ptr); break; ! case OBJ_POLYGON: ! DupPolygonObj (ObjPtr->detail.g, obj_ptr); ! DupAttrs (ObjPtr, obj_ptr); ! break; case OBJ_SYM: case OBJ_GROUP: *************** *** 234,242 **** case OBJ_ICON: DupGroupObj (ObjPtr->detail.r, obj_ptr); - if (ObjPtr->type == OBJ_ICON) - { - obj_ptr->detail.r->id = objId++; - obj_ptr->detail.r->dirty = FALSE; - } DupAttrs (ObjPtr, obj_ptr); if (obj_ptr->type == OBJ_ICON) --- 245,248 ---- *** edit.c.orig Fri Aug 17 13:46:32 1990 --- edit.c Fri Aug 17 13:46:34 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/edit.c,v 1.6 90/07/13 12:51:58 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/edit.c,v 1.9 90/08/16 09:35:06 william Exp $"; #endif *************** *** 17,20 **** --- 17,21 ---- #include "align.e" #include "color.e" + #include "copypaste.e" #include "cursor.e" #include "drawing.e" *************** *** 45,50 **** #define EDIT_DEL_POINT 5 #define EDIT_ADD_POINT 6 ! #define MAXEDITMENUS 7 static char * editMenuStr[] = --- 46,53 ---- #define EDIT_DEL_POINT 5 #define EDIT_ADD_POINT 6 + #define EDIT_COPY 7 + #define EDIT_PASTE 8 ! #define MAXEDITMENUS 9 static char * editMenuStr[] = *************** *** 55,59 **** "UndoDelete #U", "DeletePoint ^#D", ! "AddPoint ^#A" }; --- 58,64 ---- "UndoDelete #U", "DeletePoint ^#D", ! "AddPoint ^#A", ! "Copy ^Y", ! "Paste ^#Y" }; *************** *** 91,94 **** --- 96,100 ---- XQueryPointer (mainDisplay, drawWindow, &root_win, &child_win, &root_x, &root_y, &old_x, &old_y, &status); + XSetFont (mainDisplay, revDefaultGC, defaultFontPtr->fid); XDrawString (mainDisplay, drawWindow, revDefaultGC, old_x+4, old_y+defaultFontAsc, "DEL", 3); *************** *** 613,616 **** --- 619,623 ---- XQueryPointer (mainDisplay, drawWindow, &root_win, &child_win, &root_x, &root_y, &old_x, &old_y, &status); + XSetFont (mainDisplay, revDefaultGC, defaultFontPtr->fid); XDrawString (mainDisplay, drawWindow, revDefaultGC, old_x+4, old_y+defaultFontAsc, "ADD", 3); *************** *** 679,682 **** --- 686,691 ---- case EDIT_DEL_POINT: DeletePoint (); break; case EDIT_ADD_POINT: AddPoint (); break; + case EDIT_COPY: CopyToCutBuffer (); break; + case EDIT_PASTE: PasteFromCutBuffer (); break; } } *** file.c.orig Fri Aug 17 13:47:13 1990 --- file.c Fri Aug 17 13:47:14 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.c,v 1.28 90/07/30 16:08:30 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.c,v 1.32 90/08/15 16:00:43 william Exp $"; #endif *************** *** 46,50 **** #include "text.e" ! #define CUR_VERSION 7 char curFileName[MAXPATHLENGTH]; --- 46,51 ---- #include "text.e" ! #define CUR_VERSION 8 ! #define START_HAVING_ATTRS 8 char curFileName[MAXPATHLENGTH]; *************** *** 102,107 **** fprintf (FP, "%1d,%1d,%1d,", horiAlign, vertAlign, lineWidth); fprintf (FP, "%1d,%1d,%1d,%1d,", curSpline, lineStyle, objFill, penPat); ! fprintf (FP, "%1d,%1d,%1d,%1d", textJust, curFont, curStyle, curSize); ! fprintf (FP, ").\n"); } --- 103,108 ---- fprintf (FP, "%1d,%1d,%1d,", horiAlign, vertAlign, lineWidth); fprintf (FP, "%1d,%1d,%1d,%1d,", curSpline, lineStyle, objFill, penPat); ! fprintf (FP, "%1d,%1d,%1d,%1d,", textJust, curFont, curStyle, curSize); ! fprintf (FP, "%1d).\n", curFontDPI); } *************** *** 374,378 **** sscanf (s, "%d", &fileVersion); ! if (PRTGIF) return; if (!importingFile) --- 375,383 ---- sscanf (s, "%d", &fileVersion); ! if (PRTGIF) ! { ! pageStyle = page_style; ! return; ! } if (!importingFile) *************** *** 396,401 **** else curSpline = LT_STRAIGHT; } ! else { sscanf (s, "%d , %d , %d , %d , %d , %d , %d , %d , %d , \ --- 401,407 ---- else curSpline = LT_STRAIGHT; + curFontDPI = FONT_DPI_75; } ! else if (fileVersion <= 7) { sscanf (s, "%d , %d , %d , %d , %d , %d , %d , %d , %d , \ *************** *** 405,409 **** --- 411,425 ---- &lineStyle, &objFill, &penPat, &textJust, &curFont, &curStyle, &curSize); + curFontDPI = FONT_DPI_75; } + else + { + sscanf (s, "%d , %d , %d , %d , %d , %d , %d , %d , %d , \ + %d , %d , %d , %d , %d , %d , %d , %d , %d", + &drawOrigX, &drawOrigY, &zoomScale, &xyGrid, &gridOn, + &colorIndex, &horiAlign, &vertAlign, &lineWidth, &curSpline, + &lineStyle, &objFill, &penPat, &textJust, &curFont, + &curStyle, &curSize, &curFontDPI); + } if (colorIndex >= maxColors) { *************** *** 426,429 **** --- 442,470 ---- } + void ReadObjAttrs (MinFileVersion, FP, ObjPtr, PRTGIF) + FILE * FP; + struct ObjRec * * ObjPtr; + int PRTGIF; + { + struct AttrRec * top_attr = NULL, * bot_attr = NULL, * attr_ptr; + + if (fileVersion <= MinFileVersion) return; + + while (ReadAttr (FP, &attr_ptr, PRTGIF)) + { + attr_ptr->owner = *ObjPtr; + attr_ptr->prev = NULL; + attr_ptr->next = top_attr; + if (top_attr == NULL) + bot_attr = attr_ptr; + else + top_attr->prev = attr_ptr; + top_attr = attr_ptr; + } + if (bot_attr != NULL) bot_attr->next = NULL; + (*ObjPtr)->fattr = top_attr; + (*ObjPtr)->lattr = bot_attr; + } + int ReadObj (FP, ObjPtr, PRTGIF) FILE * FP; *************** *** 434,438 **** char * line = NULL, * c_ptr, * s, * s1; int len, id, cur_size, done = FALSE, allocated = FALSE; - struct AttrRec * top_attr = NULL, * bot_attr = NULL, * attr_ptr; while (fgets (inbuf, MAXSTRING, FP) != NULL) --- 475,478 ---- *************** *** 482,500 **** { ReadPolyObj (line, ObjPtr); ! if (fileVersion != INVALID) ! while (ReadAttr (FP, &attr_ptr, PRTGIF)) ! { ! attr_ptr->owner = *ObjPtr; ! attr_ptr->prev = NULL; ! attr_ptr->next = top_attr; ! if (top_attr == NULL) ! bot_attr = attr_ptr; ! else ! top_attr->prev = attr_ptr; ! top_attr = attr_ptr; ! } ! if (bot_attr != NULL) bot_attr->next = NULL; ! (*ObjPtr)->detail.p->fattr = top_attr; ! (*ObjPtr)->detail.p->lattr = bot_attr; AdjObjBBox (*ObjPtr); if (allocated) cfree (line); --- 522,526 ---- { ReadPolyObj (line, ObjPtr); ! ReadObjAttrs (INVALID, FP, ObjPtr, PRTGIF); AdjObjBBox (*ObjPtr); if (allocated) cfree (line); *************** *** 504,507 **** --- 530,535 ---- { ReadBoxObj (line, ObjPtr); + ReadObjAttrs (START_HAVING_ATTRS-1, FP, ObjPtr, PRTGIF); + AdjObjBBox (*ObjPtr); if (allocated) cfree (line); return (TRUE); *************** *** 510,513 **** --- 538,543 ---- { ReadOvalObj (line, ObjPtr); + ReadObjAttrs (START_HAVING_ATTRS-1, FP, ObjPtr, PRTGIF); + AdjObjBBox (*ObjPtr); if (allocated) cfree (line); return (TRUE); *************** *** 522,525 **** --- 552,557 ---- { ReadPolygonObj (line, ObjPtr); + ReadObjAttrs (START_HAVING_ATTRS-1, FP, ObjPtr, PRTGIF); + AdjObjBBox (*ObjPtr); if (allocated) cfree (line); return (TRUE); *************** *** 528,546 **** { ReadGroupObj (FP, ObjPtr, PRTGIF); ! if (fileVersion != INVALID) ! while (ReadAttr (FP, &attr_ptr, PRTGIF)) ! { ! attr_ptr->owner = *ObjPtr; ! attr_ptr->prev = NULL; ! attr_ptr->next = top_attr; ! if (top_attr == NULL) ! bot_attr = attr_ptr; ! else ! top_attr->prev = attr_ptr; ! top_attr = attr_ptr; ! } ! if (bot_attr != NULL) bot_attr->next = NULL; ! (*ObjPtr)->detail.r->fattr = top_attr; ! (*ObjPtr)->detail.r->lattr = bot_attr; AdjObjBBox (*ObjPtr); if (allocated) cfree (line); --- 560,564 ---- { ReadGroupObj (FP, ObjPtr, PRTGIF); ! ReadObjAttrs (INVALID, FP, ObjPtr, PRTGIF); AdjObjBBox (*ObjPtr); if (allocated) cfree (line); *************** *** 551,569 **** ReadGroupObj (FP, ObjPtr, PRTGIF); (*ObjPtr)->type = OBJ_SYM; ! if (fileVersion != INVALID) ! while (ReadAttr (FP, &attr_ptr, PRTGIF)) ! { ! attr_ptr->owner = *ObjPtr; ! attr_ptr->prev = NULL; ! attr_ptr->next = top_attr; ! if (top_attr == NULL) ! bot_attr = attr_ptr; ! else ! top_attr->prev = attr_ptr; ! top_attr = attr_ptr; ! } ! if (bot_attr != NULL) bot_attr->next = NULL; ! (*ObjPtr)->detail.r->fattr = top_attr; ! (*ObjPtr)->detail.r->lattr = bot_attr; AdjObjBBox (*ObjPtr); if (allocated) cfree (line); --- 569,573 ---- ReadGroupObj (FP, ObjPtr, PRTGIF); (*ObjPtr)->type = OBJ_SYM; ! ReadObjAttrs (INVALID, FP, ObjPtr, PRTGIF); AdjObjBBox (*ObjPtr); if (allocated) cfree (line); *************** *** 587,610 **** sscanf (s1, "%d", &id); if (id >= objId) objId = id+1; ! (*ObjPtr)->detail.r->id = id; } ! (*ObjPtr)->detail.r->dirty = FALSE; *(--s) = '\0'; strcpy ((*ObjPtr)->detail.r->s, tmp_str); ! if (fileVersion != INVALID) ! while (ReadAttr (FP, &attr_ptr, PRTGIF)) ! { ! attr_ptr->owner = *ObjPtr; ! attr_ptr->prev = NULL; ! attr_ptr->next = top_attr; ! if (top_attr == NULL) ! bot_attr = attr_ptr; ! else ! top_attr->prev = attr_ptr; ! top_attr = attr_ptr; ! } ! if (bot_attr != NULL) bot_attr->next = NULL; ! (*ObjPtr)->detail.r->fattr = top_attr; ! (*ObjPtr)->detail.r->lattr = bot_attr; AdjObjBBox (*ObjPtr); if (allocated) cfree (line); --- 591,600 ---- sscanf (s1, "%d", &id); if (id >= objId) objId = id+1; ! (*ObjPtr)->id = id; } ! (*ObjPtr)->dirty = FALSE; *(--s) = '\0'; strcpy ((*ObjPtr)->detail.r->s, tmp_str); ! ReadObjAttrs (INVALID, FP, ObjPtr, PRTGIF); AdjObjBBox (*ObjPtr); if (allocated) cfree (line); *************** *** 820,829 **** case OBJ_POLY: DumpPolyObj (FP, ObjPtr); ! DumpAttrs (FP, ObjPtr->detail.p->lattr, PRTGIF); break; ! case OBJ_BOX: DumpBoxObj (FP, ObjPtr); break; ! case OBJ_OVAL: DumpOvalObj (FP, ObjPtr); break; case OBJ_TEXT: DumpTextObj (FP, ObjPtr, PRTGIF); break; ! case OBJ_POLYGON: DumpPolygonObj (FP, ObjPtr); break; case OBJ_SYM: case OBJ_ICON: --- 810,828 ---- case OBJ_POLY: DumpPolyObj (FP, ObjPtr); ! DumpAttrs (FP, ObjPtr->lattr, PRTGIF); break; ! case OBJ_BOX: ! DumpBoxObj (FP, ObjPtr); ! DumpAttrs (FP, ObjPtr->lattr, PRTGIF); ! break; ! case OBJ_OVAL: ! DumpOvalObj (FP, ObjPtr); ! DumpAttrs (FP, ObjPtr->lattr, PRTGIF); ! break; case OBJ_TEXT: DumpTextObj (FP, ObjPtr, PRTGIF); break; ! case OBJ_POLYGON: ! DumpPolygonObj (FP, ObjPtr); ! DumpAttrs (FP, ObjPtr->lattr, PRTGIF); ! break; case OBJ_SYM: case OBJ_ICON: *************** *** 832,836 **** for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->prev) DumpAllObj (FP, obj_ptr, PRTGIF); ! DumpAttrs (FP, ObjPtr->detail.r->lattr, PRTGIF); if (ObjPtr->type == OBJ_SYM) DumpSymOutline (FP, ObjPtr); break; --- 831,835 ---- for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->prev) DumpAllObj (FP, obj_ptr, PRTGIF); ! DumpAttrs (FP, ObjPtr->lattr, PRTGIF); if (ObjPtr->type == OBJ_SYM) DumpSymOutline (FP, ObjPtr); break; *** font.c.orig Fri Aug 17 13:47:28 1990 --- font.c Fri Aug 17 13:47:29 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.c,v 1.5 90/07/30 15:54:02 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.c,v 1.9 90/08/16 15:44:24 william Exp $"; #endif *************** *** 32,37 **** #define COUR24R 29 ! #define FIndex(FONT,SIZE,STYLE) (SIZE+MAXFONTSIZES*(STYLE+MAXFONTSTYLES*FONT)) ! #define FONTTABLESIZE (MAXFONTSIZES*MAXFONTSTYLES*MAXFONTS) struct MyFontRec { --- 32,39 ---- #define COUR24R 29 ! #define FONTS_PER_DPI (((MAXFONTS-1)*MAXFONTSTYLES+1)*MAXFONTSIZES) ! #define FONTTABLESIZE (MAXFONTDPIS*FONTS_PER_DPI) ! /* #define FIndex(FONT,SIZE,STYLE) (SIZE+MAXFONTSIZES*(STYLE+MAXFONTSTYLES*FONT)) */ ! /* #define FONTTABLESIZE (MAXFONTSIZES*MAXFONTSTYLES*MAXFONTS) */ struct MyFontRec { *************** *** 59,68 **** int defaultFontDes; ! int pointSize[] = { 8, 10, 12, 14, 18, 24 }; int curFont = FONT_COU; int curSize = 4; int curStyle = STYLE_NR; int curRotate = ROTATE0; static struct MyFontRec myFontInfo[FONTTABLESIZE]; --- 61,74 ---- int defaultFontDes; ! int * pointSize; int curFont = FONT_COU; int curSize = 4; int curStyle = STYLE_NR; + int curFontDPI = FONT_DPI_75; int curRotate = ROTATE0; + int pointSize75[] = { 8, 10, 12, 14, 18, 24 }; + int pointSize100[] = { 11, 14, 17, 20, 25, 34 }; + static struct MyFontRec myFontInfo[FONTTABLESIZE]; *************** *** 71,75 **** "Times", "Courier", "Helvetica", "NewCentury", "Symbol" }; ! static char * sizeMenuStr[] = { "8 #0", --- 77,83 ---- "Times", "Courier", "Helvetica", "NewCentury", "Symbol" }; ! static char * fontDPIMenuStr[] = { "75dpi", "100dpi" }; ! static char * * sizeMenuStr; ! static char * sizeMenuStr75[] = { "8 #0", *************** *** 80,83 **** --- 88,100 ---- "24 #5" }; + static char * sizeMenuStr100[] = + { + "11 #0", + "14 #1", + "17 #2", + "20 #3", + "25 #4", + "34 #5" + }; static char * styleMenuStr[] = { *************** *** 94,203 **** static char * fontNameStr[] = { ! "-adobe-times-medium-r-normal--8-80-75-75-p-44-iso8859-1", ! "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", ! "-adobe-times-medium-r-normal--12-120-75-75-p-64-iso8859-1", ! "-adobe-times-medium-r-normal--14-140-75-75-p-74-iso8859-1", ! "-adobe-times-medium-r-normal--18-180-75-75-p-94-iso8859-1", ! "-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", ! "-adobe-times-bold-r-normal--8-80-75-75-p-47-iso8859-1", ! "-adobe-times-bold-r-normal--10-100-75-75-p-57-iso8859-1", ! "-adobe-times-bold-r-normal--12-120-75-75-p-67-iso8859-1", ! "-adobe-times-bold-r-normal--14-140-75-75-p-77-iso8859-1", ! "-adobe-times-bold-r-normal--18-180-75-75-p-99-iso8859-1", ! "-adobe-times-bold-r-normal--24-240-75-75-p-132-iso8859-1", ! "-adobe-times-medium-i-normal--8-80-75-75-p-42-iso8859-1", ! "-adobe-times-medium-i-normal--10-100-75-75-p-52-iso8859-1", ! "-adobe-times-medium-i-normal--12-120-75-75-p-63-iso8859-1", ! "-adobe-times-medium-i-normal--14-140-75-75-p-73-iso8859-1", ! "-adobe-times-medium-i-normal--18-180-75-75-p-94-iso8859-1", ! "-adobe-times-medium-i-normal--24-240-75-75-p-125-iso8859-1", ! "-adobe-times-bold-i-normal--8-80-75-75-p-47-iso8859-1", ! "-adobe-times-bold-i-normal--10-100-75-75-p-57-iso8859-1", ! "-adobe-times-bold-i-normal--12-120-75-75-p-68-iso8859-1", ! "-adobe-times-bold-i-normal--14-140-75-75-p-77-iso8859-1", ! "-adobe-times-bold-i-normal--18-180-75-75-p-98-iso8859-1", ! "-adobe-times-bold-i-normal--24-240-75-75-p-128-iso8859-1", ! "-adobe-courier-medium-r-normal--8-80-75-75-m-50-iso8859-1", ! "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1", ! "-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1", ! "-adobe-courier-medium-r-normal--14-140-75-75-m-90-iso8859-1", ! "-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1", ! "-adobe-courier-medium-r-normal--24-240-75-75-m-150-iso8859-1", ! "-adobe-courier-bold-r-normal--8-80-75-75-m-50-iso8859-1", ! "-adobe-courier-bold-r-normal--10-100-75-75-m-60-iso8859-1", ! "-adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1", ! "-adobe-courier-bold-r-normal--14-140-75-75-m-90-iso8859-1", ! "-adobe-courier-bold-r-normal--18-180-75-75-m-110-iso8859-1", ! "-adobe-courier-bold-r-normal--24-240-75-75-m-150-iso8859-1", ! "-adobe-courier-medium-o-normal--8-80-75-75-m-50-iso8859-1", ! "-adobe-courier-medium-o-normal--10-100-75-75-m-60-iso8859-1", ! "-adobe-courier-medium-o-normal--12-120-75-75-m-70-iso8859-1", ! "-adobe-courier-medium-o-normal--14-140-75-75-m-90-iso8859-1", ! "-adobe-courier-medium-o-normal--18-180-75-75-m-110-iso8859-1", ! "-adobe-courier-medium-o-normal--24-240-75-75-m-150-iso8859-1", ! "-adobe-courier-bold-o-normal--8-80-75-75-m-50-iso8859-1", ! "-adobe-courier-bold-o-normal--10-100-75-75-m-60-iso8859-1", ! "-adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1", ! "-adobe-courier-bold-o-normal--14-140-75-75-m-90-iso8859-1", ! "-adobe-courier-bold-o-normal--18-180-75-75-m-110-iso8859-1", ! "-adobe-courier-bold-o-normal--24-240-75-75-m-150-iso8859-1", ! "-adobe-helvetica-medium-r-normal--8-80-75-75-p-46-iso8859-1", ! "-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1", ! "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1", ! "-adobe-helvetica-medium-r-normal--14-140-75-75-p-77-iso8859-1", ! "-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1", ! "-adobe-helvetica-medium-r-normal--24-240-75-75-p-130-iso8859-1", ! "-adobe-helvetica-bold-r-normal--8-80-75-75-p-50-iso8859-1", ! "-adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso8859-1", ! "-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1", ! "-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1", ! "-adobe-helvetica-bold-r-normal--18-180-75-75-p-103-iso8859-1", ! "-adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso8859-1", ! "-adobe-helvetica-medium-o-normal--8-80-75-75-p-47-iso8859-1", ! "-adobe-helvetica-medium-o-normal--10-100-75-75-p-57-iso8859-1", ! "-adobe-helvetica-medium-o-normal--12-120-75-75-p-67-iso8859-1", ! "-adobe-helvetica-medium-o-normal--14-140-75-75-p-78-iso8859-1", ! "-adobe-helvetica-medium-o-normal--18-180-75-75-p-98-iso8859-1", ! "-adobe-helvetica-medium-o-normal--24-240-75-75-p-130-iso8859-1", ! "-adobe-helvetica-bold-o-normal--8-80-75-75-p-50-iso8859-1", ! "-adobe-helvetica-bold-o-normal--10-100-75-75-p-60-iso8859-1", ! "-adobe-helvetica-bold-o-normal--12-120-75-75-p-69-iso8859-1", ! "-adobe-helvetica-bold-o-normal--14-140-75-75-p-82-iso8859-1", ! "-adobe-helvetica-bold-o-normal--18-180-75-75-p-104-iso8859-1", ! "-adobe-helvetica-bold-o-normal--24-240-75-75-p-138-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--8-80-75-75-p-50-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--10-100-75-75-p-60-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--12-120-75-75-p-70-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--14-140-75-75-p-82-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--18-180-75-75-p-103-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--24-240-75-75-p-137-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--8-80-75-75-p-56-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--10-100-75-75-p-66-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--12-120-75-75-p-77-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--14-140-75-75-p-87-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--18-180-75-75-p-113-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--24-240-75-75-p-149-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--8-80-75-75-p-50-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--10-100-75-75-p-60-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--12-120-75-75-p-70-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--14-140-75-75-p-81-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--18-180-75-75-p-104-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--24-240-75-75-p-136-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--8-80-75-75-p-56-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--10-100-75-75-p-66-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--12-120-75-75-p-76-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--14-140-75-75-p-88-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--18-180-75-75-p-111-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--24-240-75-75-p-148-iso8859-1", ! "-adobe-symbol-medium-r-normal--8-80-75-75-p-51-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--10-100-75-75-p-61-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--12-120-75-75-p-74-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--14-140-75-75-p-85-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--18-180-75-75-p-107-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--24-240-75-75-p-142-adobe-fontspecific" }; --- 111,329 ---- static char * fontNameStr[] = { ! /* 75 dpi fonts */ ! "-adobe-times-medium-r-normal--8-80-75-75-p-44-iso8859-1", ! "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", ! "-adobe-times-medium-r-normal--12-120-75-75-p-64-iso8859-1", ! "-adobe-times-medium-r-normal--14-140-75-75-p-74-iso8859-1", ! "-adobe-times-medium-r-normal--18-180-75-75-p-94-iso8859-1", ! "-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", ! "-adobe-times-bold-r-normal--8-80-75-75-p-47-iso8859-1", ! "-adobe-times-bold-r-normal--10-100-75-75-p-57-iso8859-1", ! "-adobe-times-bold-r-normal--12-120-75-75-p-67-iso8859-1", ! "-adobe-times-bold-r-normal--14-140-75-75-p-77-iso8859-1", ! "-adobe-times-bold-r-normal--18-180-75-75-p-99-iso8859-1", ! "-adobe-times-bold-r-normal--24-240-75-75-p-132-iso8859-1", ! "-adobe-times-medium-i-normal--8-80-75-75-p-42-iso8859-1", ! "-adobe-times-medium-i-normal--10-100-75-75-p-52-iso8859-1", ! "-adobe-times-medium-i-normal--12-120-75-75-p-63-iso8859-1", ! "-adobe-times-medium-i-normal--14-140-75-75-p-73-iso8859-1", ! "-adobe-times-medium-i-normal--18-180-75-75-p-94-iso8859-1", ! "-adobe-times-medium-i-normal--24-240-75-75-p-125-iso8859-1", ! "-adobe-times-bold-i-normal--8-80-75-75-p-47-iso8859-1", ! "-adobe-times-bold-i-normal--10-100-75-75-p-57-iso8859-1", ! "-adobe-times-bold-i-normal--12-120-75-75-p-68-iso8859-1", ! "-adobe-times-bold-i-normal--14-140-75-75-p-77-iso8859-1", ! "-adobe-times-bold-i-normal--18-180-75-75-p-98-iso8859-1", ! "-adobe-times-bold-i-normal--24-240-75-75-p-128-iso8859-1", ! "-adobe-courier-medium-r-normal--8-80-75-75-m-50-iso8859-1", ! "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1", ! "-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1", ! "-adobe-courier-medium-r-normal--14-140-75-75-m-90-iso8859-1", ! "-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1", ! "-adobe-courier-medium-r-normal--24-240-75-75-m-150-iso8859-1", ! "-adobe-courier-bold-r-normal--8-80-75-75-m-50-iso8859-1", ! "-adobe-courier-bold-r-normal--10-100-75-75-m-60-iso8859-1", ! "-adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1", ! "-adobe-courier-bold-r-normal--14-140-75-75-m-90-iso8859-1", ! "-adobe-courier-bold-r-normal--18-180-75-75-m-110-iso8859-1", ! "-adobe-courier-bold-r-normal--24-240-75-75-m-150-iso8859-1", ! "-adobe-courier-medium-o-normal--8-80-75-75-m-50-iso8859-1", ! "-adobe-courier-medium-o-normal--10-100-75-75-m-60-iso8859-1", ! "-adobe-courier-medium-o-normal--12-120-75-75-m-70-iso8859-1", ! "-adobe-courier-medium-o-normal--14-140-75-75-m-90-iso8859-1", ! "-adobe-courier-medium-o-normal--18-180-75-75-m-110-iso8859-1", ! "-adobe-courier-medium-o-normal--24-240-75-75-m-150-iso8859-1", ! "-adobe-courier-bold-o-normal--8-80-75-75-m-50-iso8859-1", ! "-adobe-courier-bold-o-normal--10-100-75-75-m-60-iso8859-1", ! "-adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1", ! "-adobe-courier-bold-o-normal--14-140-75-75-m-90-iso8859-1", ! "-adobe-courier-bold-o-normal--18-180-75-75-m-110-iso8859-1", ! "-adobe-courier-bold-o-normal--24-240-75-75-m-150-iso8859-1", ! "-adobe-helvetica-medium-r-normal--8-80-75-75-p-46-iso8859-1", ! "-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1", ! "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1", ! "-adobe-helvetica-medium-r-normal--14-140-75-75-p-77-iso8859-1", ! "-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1", ! "-adobe-helvetica-medium-r-normal--24-240-75-75-p-130-iso8859-1", ! "-adobe-helvetica-bold-r-normal--8-80-75-75-p-50-iso8859-1", ! "-adobe-helvetica-bold-r-normal--10-100-75-75-p-60-iso8859-1", ! "-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1", ! "-adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1", ! "-adobe-helvetica-bold-r-normal--18-180-75-75-p-103-iso8859-1", ! "-adobe-helvetica-bold-r-normal--24-240-75-75-p-138-iso8859-1", ! "-adobe-helvetica-medium-o-normal--8-80-75-75-p-47-iso8859-1", ! "-adobe-helvetica-medium-o-normal--10-100-75-75-p-57-iso8859-1", ! "-adobe-helvetica-medium-o-normal--12-120-75-75-p-67-iso8859-1", ! "-adobe-helvetica-medium-o-normal--14-140-75-75-p-78-iso8859-1", ! "-adobe-helvetica-medium-o-normal--18-180-75-75-p-98-iso8859-1", ! "-adobe-helvetica-medium-o-normal--24-240-75-75-p-130-iso8859-1", ! "-adobe-helvetica-bold-o-normal--8-80-75-75-p-50-iso8859-1", ! "-adobe-helvetica-bold-o-normal--10-100-75-75-p-60-iso8859-1", ! "-adobe-helvetica-bold-o-normal--12-120-75-75-p-69-iso8859-1", ! "-adobe-helvetica-bold-o-normal--14-140-75-75-p-82-iso8859-1", ! "-adobe-helvetica-bold-o-normal--18-180-75-75-p-104-iso8859-1", ! "-adobe-helvetica-bold-o-normal--24-240-75-75-p-138-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--8-80-75-75-p-50-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--10-100-75-75-p-60-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--12-120-75-75-p-70-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--14-140-75-75-p-82-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--18-180-75-75-p-103-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--24-240-75-75-p-137-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--8-80-75-75-p-56-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--10-100-75-75-p-66-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--12-120-75-75-p-77-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--14-140-75-75-p-87-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--18-180-75-75-p-113-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--24-240-75-75-p-149-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--8-80-75-75-p-50-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--10-100-75-75-p-60-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--12-120-75-75-p-70-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--14-140-75-75-p-81-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--18-180-75-75-p-104-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--24-240-75-75-p-136-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--8-80-75-75-p-56-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--10-100-75-75-p-66-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--12-120-75-75-p-76-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--14-140-75-75-p-88-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--18-180-75-75-p-111-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--24-240-75-75-p-148-iso8859-1", ! "-adobe-symbol-medium-r-normal--8-80-75-75-p-51-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--10-100-75-75-p-61-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--12-120-75-75-p-74-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--14-140-75-75-p-85-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--18-180-75-75-p-107-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--24-240-75-75-p-142-adobe-fontspecific", ! ! /* 100 dpi fonts */ ! "-adobe-times-medium-r-normal--11-80-100-100-p-54-iso8859-1", ! "-adobe-times-medium-r-normal--14-100-100-100-p-74-iso8859-1", ! "-adobe-times-medium-r-normal--17-120-100-100-p-84-iso8859-1", ! "-adobe-times-medium-r-normal--20-140-100-100-p-96-iso8859-1", ! "-adobe-times-medium-r-normal--25-180-100-100-p-125-iso8859-1", ! "-adobe-times-medium-r-normal--34-240-100-100-p-170-iso8859-1", ! "-adobe-times-bold-r-normal--11-80-100-100-p-57-iso8859-1", ! "-adobe-times-bold-r-normal--14-100-100-100-p-76-iso8859-1", ! "-adobe-times-bold-r-normal--17-120-100-100-p-88-iso8859-1", ! "-adobe-times-bold-r-normal--20-140-100-100-p-100-iso8859-1", ! "-adobe-times-bold-r-normal--25-180-100-100-p-132-iso8859-1", ! "-adobe-times-bold-r-normal--34-240-100-100-p-177-iso8859-1", ! "-adobe-times-medium-i-normal--11-80-100-100-p-52-iso8859-1", ! "-adobe-times-medium-i-normal--14-100-100-100-p-73-iso8859-1", ! "-adobe-times-medium-i-normal--17-120-100-100-p-84-iso8859-1", ! "-adobe-times-medium-i-normal--20-140-100-100-p-94-iso8859-1", ! "-adobe-times-medium-i-normal--25-180-100-100-p-125-iso8859-1", ! "-adobe-times-medium-i-normal--34-240-100-100-p-168-iso8859-1", ! "-adobe-times-bold-i-normal--11-80-100-100-p-57-iso8859-1", ! "-adobe-times-bold-i-normal--14-100-100-100-p-77-iso8859-1", ! "-adobe-times-bold-i-normal--17-120-100-100-p-86-iso8859-1", ! "-adobe-times-bold-i-normal--20-140-100-100-p-98-iso8859-1", ! "-adobe-times-bold-i-normal--25-180-100-100-p-128-iso8859-1", ! "-adobe-times-bold-i-normal--34-240-100-100-p-170-iso8859-1", ! ! "-adobe-courier-medium-r-normal--11-80-100-100-m-60-iso8859-1", ! "-adobe-courier-medium-r-normal--14-100-100-100-m-90-iso8859-1", ! "-adobe-courier-medium-r-normal--17-120-100-100-m-100-iso8859-1", ! "-adobe-courier-medium-r-normal--20-140-100-100-m-110-iso8859-1", ! "-adobe-courier-medium-r-normal--25-180-100-100-m-150-iso8859-1", ! "-adobe-courier-medium-r-normal--34-240-100-100-m-200-iso8859-1", ! "-adobe-courier-bold-r-normal--11-80-100-100-m-60-iso8859-1", ! "-adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1", ! "-adobe-courier-bold-r-normal--17-120-100-100-m-100-iso8859-1", ! "-adobe-courier-bold-r-normal--20-140-100-100-m-110-iso8859-1", ! "-adobe-courier-bold-r-normal--25-180-100-100-m-150-iso8859-1", ! "-adobe-courier-bold-r-normal--34-240-100-100-m-200-iso8859-1", ! "-adobe-courier-medium-o-normal--11-80-100-100-m-60-iso8859-1", ! "-adobe-courier-medium-o-normal--14-100-100-100-m-90-iso8859-1", ! "-adobe-courier-medium-o-normal--17-120-100-100-m-100-iso8859-1", ! "-adobe-courier-medium-o-normal--20-140-100-100-m-110-iso8859-1", ! "-adobe-courier-medium-o-normal--25-180-100-100-m-150-iso8859-1", ! "-adobe-courier-medium-o-normal--34-240-100-100-m-200-iso8859-1", ! "-adobe-courier-bold-o-normal--11-80-100-100-m-60-iso8859-1", ! "-adobe-courier-bold-o-normal--14-100-100-100-m-90-iso8859-1", ! "-adobe-courier-bold-o-normal--17-120-100-100-m-100-iso8859-1", ! "-adobe-courier-bold-o-normal--20-140-100-100-m-110-iso8859-1", ! "-adobe-courier-bold-o-normal--25-180-100-100-m-150-iso8859-1", ! "-adobe-courier-bold-o-normal--34-240-100-100-m-200-iso8859-1", ! ! "-adobe-helvetica-medium-r-normal--11-80-100-100-p-56-iso8859-1", ! "-adobe-helvetica-medium-r-normal--14-100-100-100-p-76-iso8859-1", ! "-adobe-helvetica-medium-r-normal--17-120-100-100-p-88-iso8859-1", ! "-adobe-helvetica-medium-r-normal--20-140-100-100-p-100-iso8859-1", ! "-adobe-helvetica-medium-r-normal--25-180-100-100-p-130-iso8859-1", ! "-adobe-helvetica-medium-r-normal--34-240-100-100-p-176-iso8859-1", ! "-adobe-helvetica-bold-r-normal--11-80-100-100-p-60-iso8859-1", ! "-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1", ! "-adobe-helvetica-bold-r-normal--17-120-100-100-p-92-iso8859-1", ! "-adobe-helvetica-bold-r-normal--20-140-100-100-p-105-iso8859-1", ! "-adobe-helvetica-bold-r-normal--25-180-100-100-p-138-iso8859-1", ! "-adobe-helvetica-bold-r-normal--34-240-100-100-p-182-iso8859-1", ! "-adobe-helvetica-medium-o-normal--11-80-100-100-p-57-iso8859-1", ! "-adobe-helvetica-medium-o-normal--14-100-100-100-p-78-iso8859-1", ! "-adobe-helvetica-medium-o-normal--17-120-100-100-p-88-iso8859-1", ! "-adobe-helvetica-medium-o-normal--20-140-100-100-p-98-iso8859-1", ! "-adobe-helvetica-medium-o-normal--25-180-100-100-p-130-iso8859-1", ! "-adobe-helvetica-medium-o-normal--34-240-100-100-p-176-iso8859-1", ! "-adobe-helvetica-bold-o-normal--11-80-100-100-p-60-iso8859-1", ! "-adobe-helvetica-bold-o-normal--14-100-100-100-p-82-iso8859-1", ! "-adobe-helvetica-bold-o-normal--17-120-100-100-p-92-iso8859-1", ! "-adobe-helvetica-bold-o-normal--20-140-100-100-p-103-iso8859-1", ! "-adobe-helvetica-bold-o-normal--25-180-100-100-p-138-iso8859-1", ! "-adobe-helvetica-bold-o-normal--34-240-100-100-p-182-iso8859-1", ! ! "-adobe-new century schoolbook-medium-r-normal--11-80-100-100-p-60-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--14-100-100-100-p-82-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--17-120-100-100-p-91-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--20-140-100-100-p-103-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--25-180-100-100-p-136-iso8859-1", ! "-adobe-new century schoolbook-medium-r-normal--34-240-100-100-p-181-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--11-80-100-100-p-66-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--14-100-100-100-p-87-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--17-120-100-100-p-99-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--20-140-100-100-p-113-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--25-180-100-100-p-149-iso8859-1", ! "-adobe-new century schoolbook-bold-r-normal--34-240-100-100-p-193-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--11-80-100-100-p-60-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--14-100-100-100-p-81-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--17-120-100-100-p-92-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--20-140-100-100-p-104-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--25-180-100-100-p-136-iso8859-1", ! "-adobe-new century schoolbook-medium-i-normal--34-240-100-100-p-182-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--11-80-100-100-p-66-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--14-100-100-100-p-88-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--17-120-100-100-p-99-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--20-140-100-100-p-111-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--25-180-100-100-p-148-iso8859-1", ! "-adobe-new century schoolbook-bold-i-normal--34-240-100-100-p-193-iso8859-1", ! ! "-adobe-symbol-medium-r-normal--11-80-100-100-p-61-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--14-100-100-100-p-85-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--17-120-100-100-p-95-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--20-140-100-100-p-107-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--25-180-100-100-p-142-adobe-fontspecific", ! "-adobe-symbol-medium-r-normal--34-240-100-100-p-191-adobe-fontspecific" }; *************** *** 208,218 **** } ! int FontIndex (font_index, size_index, style_index) ! register int font_index, size_index, style_index; { if (font_index == FONT_SYM) ! return (FIndex(font_index,size_index,0)); else ! return (FIndex(font_index,size_index,style_index)); } --- 334,351 ---- } ! int FontIndex (dpi_index, font_index, size_index, style_index) ! register int dpi_index, font_index, size_index, style_index; { + /* if (font_index == FONT_SYM) */ + /* return (FIndex(font_index,size_index,0)); */ + /* else */ + /* return (FIndex(font_index,size_index,style_index)); */ + if (font_index == FONT_SYM) ! return (size_index+MAXFONTSIZES*(MAXFONTSTYLES*font_index) + ! dpi_index*FONTS_PER_DPI); else ! return (size_index+MAXFONTSIZES*(style_index+MAXFONTSTYLES*font_index) + ! dpi_index*FONTS_PER_DPI); } *************** *** 221,225 **** register int index; ! canvasFontIndex = index = FontIndex (curFont, curSize, curStyle); if (!myFontInfo[index].valid) --- 354,358 ---- register int index; ! canvasFontIndex = index = FontIndex (curFontDPI, curFont, curSize, curStyle); if (!myFontInfo[index].valid) *************** *** 234,239 **** canvasFontPtr = myFontInfo[index].xfs; ! canvasFontAsc = canvasFontPtr->ascent; ! canvasFontDes = canvasFontPtr->descent; canvasFontHeight = canvasFontAsc + canvasFontDes; --- 367,372 ---- canvasFontPtr = myFontInfo[index].xfs; ! canvasFontAsc = canvasFontPtr->max_bounds.ascent; ! canvasFontDes = canvasFontPtr->max_bounds.descent; canvasFontHeight = canvasFontAsc + canvasFontDes; *************** *** 241,244 **** --- 374,380 ---- textCursorH = canvasFontHeight; + + pointSize = (curFontDPI==FONT_DPI_75) ? pointSize75 : pointSize100; + sizeMenuStr = (curFontDPI==FONT_DPI_75) ? sizeMenuStr75 : sizeMenuStr100; } *************** *** 247,250 **** --- 383,389 ---- register int i; + pointSize = (curFontDPI==FONT_DPI_75) ? pointSize75 : pointSize100; + sizeMenuStr = (curFontDPI==FONT_DPI_75) ? sizeMenuStr75 : sizeMenuStr100; + for (i = 0; i < FONTTABLESIZE; i++) myFontInfo[i].valid = FALSE; *************** *** 263,268 **** rulerFontPtr = myFontInfo[COUR10R].xfs; rulerFontWidth = rulerFontPtr->max_bounds.width; ! rulerFontAsc = rulerFontPtr->ascent; ! rulerFontDes = rulerFontPtr->descent; rulerFontHeight = rulerFontAsc + rulerFontDes; --- 402,407 ---- rulerFontPtr = myFontInfo[COUR10R].xfs; rulerFontWidth = rulerFontPtr->max_bounds.width; ! rulerFontAsc = rulerFontPtr->max_bounds.ascent; ! rulerFontDes = rulerFontPtr->max_bounds.descent; rulerFontHeight = rulerFontAsc + rulerFontDes; *************** *** 269,274 **** defaultFontPtr = myFontInfo[COUR18R].xfs; defaultFontWidth = defaultFontPtr->max_bounds.width; ! defaultFontAsc = defaultFontPtr->ascent; ! defaultFontDes = defaultFontPtr->descent; defaultFontHeight = defaultFontAsc + defaultFontDes; } --- 408,413 ---- defaultFontPtr = myFontInfo[COUR18R].xfs; defaultFontWidth = defaultFontPtr->max_bounds.width; ! defaultFontAsc = defaultFontPtr->max_bounds.ascent; ! defaultFontDes = defaultFontPtr->max_bounds.descent; defaultFontHeight = defaultFontAsc + defaultFontDes; } *************** *** 709,713 **** } ! static int savedFont, savedSize, savedStyle; static int savedJust, savedRotate, savedPen; --- 848,965 ---- } ! static ! int ChangeObjTextFontDPI (ObjPtr, FontDPIIndex) ! register struct ObjRec * ObjPtr; ! register int FontDPIIndex; ! { ! register struct ObjRec * obj_ptr; ! register int changed = FALSE; ! ! for (obj_ptr = ObjPtr; obj_ptr != NULL; obj_ptr = obj_ptr->prev) ! switch (obj_ptr->type) ! { ! case OBJ_TEXT: ! if (obj_ptr->detail.t->dpi != FontDPIIndex) ! { ! obj_ptr->detail.t->dpi = FontDPIIndex; ! UpdTextBBox (obj_ptr); ! changed = TRUE; ! } ! break; ! ! case OBJ_GROUP: ! case OBJ_SYM: ! if (ChangeObjTextFontDPI (obj_ptr->detail.r->last, FontDPIIndex)) ! { ! changed = TRUE; ! AdjObjBBox (obj_ptr); ! } ! break; ! } ! return (changed); ! } ! ! void ChangeFontDPI (FontDPIIndex) ! int FontDPIIndex; ! { ! register struct SelRec * sel_ptr; ! register struct ObjRec * obj_ptr; ! int changed = FALSE, text_cursor_shown; ! int ltx, lty, rbx, rby, text_obj_created; ! ! if (FontDPIIndex == INVALID) return; ! ! if (topSel != NULL) ! { ! for (sel_ptr = botSel; sel_ptr != NULL; sel_ptr = sel_ptr->prev) ! { ! obj_ptr = sel_ptr->obj; ! switch (obj_ptr->type) ! { ! case OBJ_TEXT: ! if (obj_ptr->detail.t->dpi != FontDPIIndex) ! { ! obj_ptr->detail.t->dpi = FontDPIIndex; ! UpdTextBBox (obj_ptr); ! changed = TRUE; ! } ! break; ! case OBJ_GROUP: ! case OBJ_SYM: ! if (ChangeObjTextFont (obj_ptr->detail.r->last, FontDPIIndex)) ! { ! changed = TRUE; ! AdjObjBBox (obj_ptr); ! } ! break; ! } ! } ! ! if (changed) ! { ! HighLightReverse (); ! ltx = selLtX; lty = selLtY; rbx = selRbX; rby = selRbY; ! UpdSelBBox (); ! RedrawAreas (botObj, ltx-(1<<zoomScale), lty-(1<<zoomScale), ! rbx+(1<<zoomScale), rby+(1<<zoomScale), selLtX-(1<<zoomScale), ! selLtY-(1<<zoomScale), selRbX+(1<<zoomScale), ! selRbY+(1<<zoomScale)); ! SetFileModified (TRUE); ! HighLightForward (); ! } ! } ! else ! { ! text_cursor_shown = textCursorShown; ! text_obj_created = TieLooseEnds (); ! curFontDPI = FontDPIIndex; ! SetCanvasFont (); ! if (!text_obj_created && curChoice == DRAWTEXT && text_cursor_shown) ! { ! NewCurText (); ! RedrawCurText (); ! } ! else ! textCursorShown = FALSE; ! ShowCurFont (); ! ! pointSize = (curFontDPI==FONT_DPI_75) ? pointSize75 : pointSize100; ! sizeMenuStr = (curFontDPI==FONT_DPI_75) ? sizeMenuStr75 : sizeMenuStr100; ! } ! } ! ! void FontDPIMenu (X, Y) ! int X, Y; ! { ! register int index; ! int * fore_colors, * valid; ! ! DefaultColorArrays (MAXFONTDPIS, &fore_colors, &valid); ! index = TextMenuLoop (X, Y, fontDPIMenuStr, MAXFONTDPIS, fore_colors, valid, ! SINGLECOLOR); ! ChangeFontDPI (index); ! } ! ! static int savedFont, savedSize, savedStyle, savedDPI; static int savedJust, savedRotate, savedPen; *************** *** 717,720 **** --- 969,973 ---- savedSize = curSize; savedStyle = curStyle; + savedDPI = curFontDPI; savedJust = textJust; savedRotate = curRotate; *************** *** 727,730 **** --- 980,984 ---- curSize = savedSize; curStyle = savedStyle; + curFontDPI = savedDPI; textJust = savedJust; curRotate = savedRotate; *************** *** 734,738 **** } ! static int pushedFont, pushedSize, pushedStyle, pushedJust; static int pushedColorIndex, pushedRotate, pushedPen; --- 988,992 ---- } ! static int pushedFont, pushedSize, pushedStyle, pushedDPI, pushedJust; static int pushedColorIndex, pushedRotate, pushedPen; *************** *** 742,745 **** --- 996,1000 ---- pushedSize = curSize; pushedStyle = curStyle; + pushedDPI = curFontDPI; pushedJust = textJust; pushedRotate = curRotate; *************** *** 753,756 **** --- 1008,1012 ---- curSize = pushedSize; curStyle = pushedStyle; + curFontDPI = pushedDPI; textJust = pushedJust; curRotate = pushedRotate; *************** *** 771,773 **** --- 1027,1081 ---- myFontInfo[i].valid = FALSE; } + } + + static + void GenerateFontInfo () + /* This procedure is used to generate pdrawFontAsc[] and */ + /* pDrawFontDes[], to be used in ``prtgif.c''. It is */ + /* supposed to be called within dbx and not tgif. */ + { + register int i, j, num_rows; + + for (i = 0; i < FONTTABLESIZE; i++) + if (!myFontInfo[i].valid) + { + if ((myFontInfo[i].xfs = + XLoadQueryFont (mainDisplay, fontNameStr[i])) == NULL) + { + printf ("Can not open %s. Abort.\n\n", fontNameStr[i]); + exit (-1); + } + myFontInfo[i].valid = TRUE; + } + + num_rows = FONTTABLESIZE / MAXFONTSIZES; + printf ("short\tpDrawFontAsc[] =\n{\n"); + for (i = 0; i < num_rows; i++) + { + printf (" "); + for (j = 0; j < MAXFONTSIZES; j++) + if (i == num_rows-1 && j == MAXFONTSIZES-1) + printf ("%2d ", + (myFontInfo[i*MAXFONTSIZES+j].xfs)->max_bounds.ascent); + else + printf ("%2d, ", + (myFontInfo[i*MAXFONTSIZES+j].xfs)->max_bounds.ascent); + printf ("\n"); + } + printf ("};\n\n"); + + printf ("short\tpDrawFontDes[] =\n{\n"); + for (i = 0; i < num_rows; i++) + { + printf (" "); + for (j = 0; j < MAXFONTSIZES; j++) + if (i == num_rows-1 && j == MAXFONTSIZES-1) + printf ("%2d ", + (myFontInfo[i*MAXFONTSIZES+j].xfs)->max_bounds.descent); + else + printf ("%2d, ", + (myFontInfo[i*MAXFONTSIZES+j].xfs)->max_bounds.descent); + printf ("\n"); + } + printf ("};\n"); } *** group.c.orig Fri Aug 17 13:47:37 1990 --- group.c Fri Aug 17 13:47:38 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/group.c,v 1.3 90/07/30 11:10:25 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/group.c,v 1.6 90/08/13 09:23:41 william Exp $"; #endif *************** *** 32,36 **** group_ptr->first = TopObjPtr; group_ptr->last = BotObjPtr; - group_ptr->fattr = group_ptr->lattr = NULL; obj_ptr = (struct ObjRec *) calloc (1, sizeof(struct ObjRec)); obj_ptr->x = selObjLtX; /* note: selLtX, selLtY are absolute */ --- 32,35 ---- *************** *** 46,49 **** --- 45,49 ---- obj_ptr->obbox.rby = selObjRbY; obj_ptr->detail.r = group_ptr; + obj_ptr->fattr = obj_ptr->lattr = NULL; AddObj (NULL, topObj, obj_ptr); } *************** *** 57,61 **** Save (FP, ObjPtr->detail.r->last, Level+1); fprintf (FP, "],"); ! SaveAttrs (FP, ObjPtr->detail.r->lattr); fprintf (FP, ")"); } --- 57,61 ---- Save (FP, ObjPtr->detail.r->last, Level+1); fprintf (FP, "],"); ! SaveAttrs (FP, ObjPtr->lattr); fprintf (FP, ")"); } *************** *** 69,73 **** Save (FP, ObjPtr->detail.r->last, Level+1); fprintf (FP, "],"); ! SaveAttrs (FP, ObjPtr->detail.r->lattr); fprintf (FP, ")"); } --- 69,73 ---- Save (FP, ObjPtr->detail.r->last, Level+1); fprintf (FP, "],"); ! SaveAttrs (FP, ObjPtr->lattr); fprintf (FP, ")"); } *************** *** 81,86 **** Save (FP, ObjPtr->detail.r->last, Level+1); fprintf (FP, "],\n"); ! fprintf (FP, "\"%s\",%1d,", ObjPtr->detail.r->s,ObjPtr->detail.r->id); ! SaveAttrs (FP, ObjPtr->detail.r->lattr); fprintf (FP, ")"); } --- 81,86 ---- Save (FP, ObjPtr->detail.r->last, Level+1); fprintf (FP, "],\n"); ! fprintf (FP, "\"%s\",%1d,", ObjPtr->detail.r->s,ObjPtr->id); ! SaveAttrs (FP, ObjPtr->lattr); fprintf (FP, ")"); } *** mainloop.c.orig Fri Aug 17 13:47:44 1990 --- mainloop.c Fri Aug 17 13:47:45 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/mainloop.c,v 1.12 90/07/30 11:01:17 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/mainloop.c,v 1.15 90/08/16 09:35:09 william Exp $"; #endif *************** *** 18,21 **** --- 18,22 ---- #include "choice.e" #include "color.e" + #include "copypaste.e" #include "cursor.e" #include "dialog.e" *************** *** 131,134 **** --- 132,136 ---- CleanUpFiles (); CleanUpGrids (); + CleanUpCutBuffer (); DelAllCutSel (); *************** *** 412,416 **** poly_id = atoi (PolyId); for (obj_ptr = topObj; obj_ptr != NULL; obj_ptr = obj_ptr->next) ! if (obj_ptr->type == OBJ_POLY && obj_ptr->detail.p->id == poly_id) break; --- 414,418 ---- poly_id = atoi (PolyId); for (obj_ptr = topObj; obj_ptr != NULL; obj_ptr = obj_ptr->next) ! if (obj_ptr->type == OBJ_POLY && obj_ptr->id == poly_id) break; *************** *** 511,515 **** for (obj_ptr = topObj; obj_ptr != NULL; obj_ptr = obj_ptr->next) ! if (obj_ptr->type == OBJ_ICON && obj_ptr->detail.r->id == obj_id) break; --- 513,520 ---- for (obj_ptr = topObj; obj_ptr != NULL; obj_ptr = obj_ptr->next) ! if ((obj_ptr->type == OBJ_ICON || obj_ptr->type == OBJ_POLY || ! obj_ptr->type == OBJ_BOX || obj_ptr->type == OBJ_OVAL || ! obj_ptr->type == OBJ_POLYGON) && ! obj_ptr->id == obj_id) break; *************** *** 521,525 **** else { ! attr_ptr = obj_ptr->detail.r->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) { --- 526,530 ---- else { ! attr_ptr = obj_ptr->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) { *** menu.c.orig Fri Aug 17 13:47:56 1990 --- menu.c Fri Aug 17 13:47:58 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/menu.c,v 1.11 90/07/30 11:00:59 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/menu.c,v 1.12 90/08/15 16:00:27 william Exp $"; #endif *************** *** 388,394 **** } static char * mainMenuStr[MAXMENUS] = { ! "Mode", "File", "Edit", "TextStyle", "TextSize", "Font", "Layout", "Arrange", "Fill", "LineStyle", "Pen", "Color", "Special" }; --- 388,411 ---- } + #define MENU_MODE 0 + #define MENU_FILE 1 + #define MENU_EDIT 2 + #define MENU_STYLE 3 + #define MENU_SIZE 4 + #define MENU_FONT 5 + #define MENU_FONTDPI 6 + #define MENU_LAYOUT 7 + #define MENU_ARRANGE 8 + #define MENU_FILL 9 + #define MENU_LINESTYLE 10 + #define MENU_PEN 11 + #define MENU_COLOR 12 + #define MENU_SPECIAL 13 + + #define MAXMENUS 14 + static char * mainMenuStr[MAXMENUS] = { ! "Mode", "File", "Edit", "TextStyle", "TextSize", "Font", "FontDPI", "Layout", "Arrange", "Fill", "LineStyle", "Pen", "Color", "Special" }; *************** *** 427,430 **** --- 444,448 ---- case MENU_SIZE: SizeMenu (x, y); break; case MENU_FONT: FontMenu (x, y); break; + case MENU_FONTDPI: FontDPIMenu (x, y); break; case MENU_LAYOUT: LayoutMenu (x, y); break; case MENU_ARRANGE: ArrangeMenu (x, y); break; *** move.c.orig Fri Aug 17 13:48:04 1990 --- move.c Fri Aug 17 13:48:05 1990 *************** *** 7,11 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/move.c,v 1.6 90/07/07 23:57:07 william Exp $"; #endif #include <stdio.h> --- 7,11 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/move.c,v 1.7 90/08/11 00:14:18 william Exp $"; #endif #include <stdio.h> *************** *** 88,102 **** { case OBJ_POLY: ! MoveAttrs(ObjPtr->detail.p->fattr, Dx,Dy); MovePoly (ObjPtr, Dx, Dy); break; ! case OBJ_BOX : break; ! case OBJ_OVAL: break; case OBJ_TEXT: break; ! case OBJ_POLYGON: MovePolygon (ObjPtr, Dx, Dy); break; case OBJ_SYM: case OBJ_ICON: case OBJ_GROUP: ! MoveAttrs(ObjPtr->detail.r->fattr, Dx,Dy); for (ptr = ObjPtr->detail.r->first; ptr != NULL; ptr = ptr->next) MoveObj (ptr, Dx, Dy); --- 88,105 ---- { case OBJ_POLY: ! MoveAttrs(ObjPtr->fattr, Dx,Dy); MovePoly (ObjPtr, Dx, Dy); break; ! case OBJ_BOX : MoveAttrs(ObjPtr->fattr, Dx,Dy); break; ! case OBJ_OVAL: MoveAttrs(ObjPtr->fattr, Dx,Dy); break; case OBJ_TEXT: break; ! case OBJ_POLYGON: ! MoveAttrs(ObjPtr->fattr, Dx,Dy); ! MovePolygon (ObjPtr, Dx, Dy); ! break; case OBJ_SYM: case OBJ_ICON: case OBJ_GROUP: ! MoveAttrs(ObjPtr->fattr, Dx,Dy); for (ptr = ObjPtr->detail.r->first; ptr != NULL; ptr = ptr->next) MoveObj (ptr, Dx, Dy); *** obj.c.orig Fri Aug 17 13:48:11 1990 --- obj.c Fri Aug 17 13:48:12 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/obj.c,v 1.1 90/04/01 22:16:27 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/obj.c,v 1.2 90/08/11 00:14:20 william Exp $"; #endif *************** *** 62,79 **** switch (ObjPtr->type) { ! case OBJ_POLY: ! DelAllAttrs(ObjPtr->detail.p->fattr); ! FreePolyObj (ObjPtr); ! break; ! case OBJ_BOX: FreeBoxObj (ObjPtr); break; ! case OBJ_OVAL: FreeOvalObj (ObjPtr); break; case OBJ_TEXT: FreeTextObj (ObjPtr); break; ! case OBJ_POLYGON: FreePolygonObj (ObjPtr); break; case OBJ_SYM: case OBJ_ICON: ! case OBJ_GROUP: ! DelAllAttrs(ObjPtr->detail.r->fattr); ! FreeGroupObj (ObjPtr); ! break; } } --- 62,74 ---- switch (ObjPtr->type) { ! case OBJ_POLY: DelAllAttrs(ObjPtr->fattr); FreePolyObj (ObjPtr); break; ! case OBJ_BOX: DelAllAttrs(ObjPtr->fattr); FreeBoxObj (ObjPtr); break; ! case OBJ_OVAL: DelAllAttrs(ObjPtr->fattr); FreeOvalObj (ObjPtr); break; case OBJ_TEXT: FreeTextObj (ObjPtr); break; ! case OBJ_POLYGON: DelAllAttrs(ObjPtr->fattr); FreePolygonObj (ObjPtr); ! break; case OBJ_SYM: case OBJ_ICON: ! case OBJ_GROUP: DelAllAttrs(ObjPtr->fattr); FreeGroupObj (ObjPtr); break; } } *************** *** 166,177 **** break; } ! switch (ObjPtr->type) ! { ! case OBJ_POLY: attr_ptr = ObjPtr->detail.p->fattr; break; ! case OBJ_SYM: ! case OBJ_GROUP: ! case OBJ_ICON: attr_ptr = ObjPtr->detail.r->fattr; break; ! default: return; /* only the above 4 types can have attributes */ ! } ltx = ObjPtr->bbox.ltx; --- 161,166 ---- break; } ! ! attr_ptr = ObjPtr->fattr; ltx = ObjPtr->bbox.ltx; *** oval.c.orig Fri Aug 17 13:48:17 1990 --- oval.c Fri Aug 17 13:48:19 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/oval.c,v 1.5 90/06/26 08:52:36 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/oval.c,v 1.7 90/08/13 09:23:35 william Exp $"; #endif *************** *** 227,231 **** --- 227,234 ---- obj_ptr->type = OBJ_OVAL; obj_ptr->color = colorIndex; + obj_ptr->id = objId++; + obj_ptr->dirty = FALSE; obj_ptr->detail.o = oval_ptr; + obj_ptr->fattr = obj_ptr->lattr = NULL; AddObj (NULL, topObj, obj_ptr); } *************** *** 331,337 **** { fprintf (FP, "oval(%s,", colorMenuItems[ObjPtr->color]); ! fprintf (FP, "%1d,%1d,%1d,%1d,%1d,%1d,%1d)", ObjPtr->obbox.ltx, ObjPtr->obbox.lty, ObjPtr->obbox.rbx, ObjPtr->obbox.rby, ! ObjPtr->detail.o->fill, ObjPtr->detail.o->width, ObjPtr->detail.o->pen); } --- 334,343 ---- { fprintf (FP, "oval(%s,", colorMenuItems[ObjPtr->color]); ! fprintf (FP, "%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,", ObjPtr->obbox.ltx, ObjPtr->obbox.lty, ObjPtr->obbox.rbx, ObjPtr->obbox.rby, ! ObjPtr->detail.o->fill, ObjPtr->detail.o->width, ! ObjPtr->detail.o->pen, ObjPtr->id); ! SaveAttrs (FP, ObjPtr->lattr); ! fprintf (FP, ")"); } *************** *** 358,365 **** case 2: width = 6; break; } } ! else sscanf (s, "%d , %d, %d , %d , %d , %d , %d", <x, <y, &rbx, &rby, &fill, &width, &pen); oval_ptr->fill = fill; --- 364,381 ---- case 2: width = 6; break; } + (*ObjPtr)->id = objId++; } ! else if (fileVersion <= 7) ! { sscanf (s, "%d , %d, %d , %d , %d , %d , %d", <x, <y, &rbx, &rby, &fill, &width, &pen); + (*ObjPtr)->id = objId++; + } + else + { + sscanf (s, "%d , %d, %d , %d , %d , %d , %d , %d", + <x, <y, &rbx, &rby, &fill, &width, &pen, &((*ObjPtr)->id)); + if ((*ObjPtr)->id >= objId) objId = (*ObjPtr)->id + 1; + } oval_ptr->fill = fill; *************** *** 369,372 **** --- 385,389 ---- (*ObjPtr)->y = lty; (*ObjPtr)->color = FindColorIndex (color_str); + (*ObjPtr)->dirty = FALSE; (*ObjPtr)->type = OBJ_OVAL; (*ObjPtr)->obbox.ltx = ltx; *** poly.c.orig Fri Aug 17 13:48:29 1990 --- poly.c Fri Aug 17 13:48:31 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/poly.c,v 1.4 90/06/26 00:11:18 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/poly.c,v 1.6 90/08/13 09:23:49 william Exp $"; #endif *************** *** 115,120 **** poly_ptr->width = lineWidth; poly_ptr->pen = penPat; - poly_ptr->fattr = poly_ptr->lattr = NULL; - poly_ptr->id = objId++; poly_ptr->curved = curSpline; poly_ptr->fill = objFill; --- 115,118 ---- *************** *** 133,137 **** --- 131,138 ---- obj_ptr->bbox.rbx += w; obj_ptr->bbox.rby += w; + obj_ptr->id = objId++; + obj_ptr->dirty = FALSE; obj_ptr->detail.p = poly_ptr; + obj_ptr->fattr = obj_ptr->lattr = NULL; AddObj (NULL, topObj, obj_ptr); } *************** *** 697,702 **** fprintf (FP, "%1d,%1d", poly_ptr->vlist[n-1].x, poly_ptr->vlist[n-1].y); fprintf (FP, "],%1d,%1d,%1d,%1d,%1d,%1d,", poly_ptr->style, poly_ptr->width, ! poly_ptr->pen, poly_ptr->id, poly_ptr->curved, poly_ptr->fill); ! SaveAttrs (FP, ObjPtr->detail.p->lattr); fprintf (FP, ")"); } --- 698,703 ---- fprintf (FP, "%1d,%1d", poly_ptr->vlist[n-1].x, poly_ptr->vlist[n-1].y); fprintf (FP, "],%1d,%1d,%1d,%1d,%1d,%1d,", poly_ptr->style, poly_ptr->width, ! poly_ptr->pen, ObjPtr->id, poly_ptr->curved, poly_ptr->fill); ! SaveAttrs (FP, ObjPtr->lattr); fprintf (FP, ")"); } *************** *** 739,743 **** sscanf (s, "%d , %d , %d", &(poly_ptr->style), &(poly_ptr->width), &(poly_ptr->pen)); ! poly_ptr->id = objId++; poly_ptr->fill = NONEPAT; if (poly_ptr->width == LINE_CURVED) --- 740,744 ---- sscanf (s, "%d , %d , %d", &(poly_ptr->style), &(poly_ptr->width), &(poly_ptr->pen)); ! (*ObjPtr)->id = objId++; poly_ptr->fill = NONEPAT; if (poly_ptr->width == LINE_CURVED) *************** *** 757,762 **** { sscanf (s, "%d , %d , %d , %d", &(poly_ptr->style), &(poly_ptr->width), ! &(poly_ptr->pen), &(poly_ptr->id)); ! if (poly_ptr->id >= objId) objId = poly_ptr->id + 1; poly_ptr->fill = NONEPAT; if (poly_ptr->width == LINE_CURVED) --- 758,763 ---- { sscanf (s, "%d , %d , %d , %d", &(poly_ptr->style), &(poly_ptr->width), ! &(poly_ptr->pen), &((*ObjPtr)->id)); ! if ((*ObjPtr)->id >= objId) objId = (*ObjPtr)->id + 1; poly_ptr->fill = NONEPAT; if (poly_ptr->width == LINE_CURVED) *************** *** 776,782 **** { sscanf (s, "%d , %d , %d , %d, %d", &(poly_ptr->style), ! &(poly_ptr->width), &(poly_ptr->pen), &(poly_ptr->id), &(poly_ptr->curved)); ! if (poly_ptr->id >= objId) objId = poly_ptr->id + 1; poly_ptr->fill = NONEPAT; switch (poly_ptr->width) --- 777,783 ---- { sscanf (s, "%d , %d , %d , %d, %d", &(poly_ptr->style), ! &(poly_ptr->width), &(poly_ptr->pen), &((*ObjPtr)->id), &(poly_ptr->curved)); ! if ((*ObjPtr)->id >= objId) objId = (*ObjPtr)->id + 1; poly_ptr->fill = NONEPAT; switch (poly_ptr->width) *************** *** 789,795 **** { sscanf (s, "%d , %d , %d , %d, %d, %d", &(poly_ptr->style), ! &(poly_ptr->width), &(poly_ptr->pen), &(poly_ptr->id), &(poly_ptr->curved), &(poly_ptr->fill)); ! if (poly_ptr->id >= objId) objId = poly_ptr->id + 1; switch (poly_ptr->width) { --- 790,796 ---- { sscanf (s, "%d , %d , %d , %d, %d, %d", &(poly_ptr->style), ! &(poly_ptr->width), &(poly_ptr->pen), &((*ObjPtr)->id), &(poly_ptr->curved), &(poly_ptr->fill)); ! if ((*ObjPtr)->id >= objId) objId = (*ObjPtr)->id + 1; switch (poly_ptr->width) { *************** *** 801,807 **** { sscanf (s, "%d , %d , %d , %d, %d, %d", &(poly_ptr->style), ! &(poly_ptr->width), &(poly_ptr->pen), &(poly_ptr->id), &(poly_ptr->curved), &(poly_ptr->fill)); ! if (poly_ptr->id >= objId) objId = poly_ptr->id + 1; } --- 802,808 ---- { sscanf (s, "%d , %d , %d , %d, %d, %d", &(poly_ptr->style), ! &(poly_ptr->width), &(poly_ptr->pen), &((*ObjPtr)->id), &(poly_ptr->curved), &(poly_ptr->fill)); ! if ((*ObjPtr)->id >= objId) objId = (*ObjPtr)->id + 1; } *** polygon.c.orig Fri Aug 17 13:48:42 1990 --- polygon.c Fri Aug 17 13:48:44 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/polygon.c,v 1.3 90/06/26 00:11:22 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/polygon.c,v 1.5 90/08/13 09:23:36 william Exp $"; #endif *************** *** 288,292 **** --- 288,295 ---- obj_ptr->bbox.rbx += w; obj_ptr->bbox.rby += w; + obj_ptr->id = objId++; + obj_ptr->dirty = FALSE; obj_ptr->detail.g = polygon_ptr; + obj_ptr->fattr = obj_ptr->lattr = NULL; AddObj (NULL, topObj, obj_ptr); } *************** *** 499,505 **** fprintf (FP, "%1d,%1d,", polygon_ptr->vlist[i].x, polygon_ptr->vlist[i].y); ! fprintf (FP, "%1d,%1d],%1d,%1d,%1d,%1d)", polygon_ptr->vlist[n-1].x, polygon_ptr->vlist[n-1].y, polygon_ptr->fill, polygon_ptr->width, ! polygon_ptr->pen, polygon_ptr->curved); } --- 502,510 ---- fprintf (FP, "%1d,%1d,", polygon_ptr->vlist[i].x, polygon_ptr->vlist[i].y); ! fprintf (FP, "%1d,%1d],%1d,%1d,%1d,%1d,%1d,", polygon_ptr->vlist[n-1].x, polygon_ptr->vlist[n-1].y, polygon_ptr->fill, polygon_ptr->width, ! polygon_ptr->pen, polygon_ptr->curved, ObjPtr->id); ! SaveAttrs (FP, ObjPtr->lattr); ! fprintf (FP, ")"); } *************** *** 553,556 **** --- 558,562 ---- case 2: width = 6; break; } + (*ObjPtr)->id = objId++; } else if (fileVersion <= 5) *************** *** 562,568 **** case 2: width = 6; break; } } ! else sscanf (s, "%d , %d , %d , %d", &fill, &width, &pen, &curved); polygon_ptr->vlist = v; --- 568,584 ---- case 2: width = 6; break; } + (*ObjPtr)->id = objId++; } ! else if (fileVersion <= 7) ! { sscanf (s, "%d , %d , %d , %d", &fill, &width, &pen, &curved); + (*ObjPtr)->id = objId++; + } + else + { + sscanf (s, "%d , %d , %d , %d , %d", &fill, &width, &pen, &curved, + &((*ObjPtr)->id)); + if ((*ObjPtr)->id >= objId) objId = (*ObjPtr)->id + 1; + } polygon_ptr->vlist = v; *************** *** 577,580 **** --- 593,597 ---- (*ObjPtr)->y = lty; (*ObjPtr)->color = FindColorIndex (color_str); + (*ObjPtr)->dirty = FALSE; (*ObjPtr)->type = OBJ_POLYGON; (*ObjPtr)->obbox.ltx = ltx; *** prtgif.c.orig Fri Aug 17 13:48:50 1990 --- prtgif.c Fri Aug 17 13:48:51 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/prtgif.c,v 1.14 90/07/30 11:02:37 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/prtgif.c,v 1.16 90/08/16 15:28:30 william Exp $"; #endif *************** *** 26,90 **** int lastFile = TRUE; ! short pDrawCursorH[] = { ! 9, 11, 13, 14, 19, 26, ! 9, 11, 14, 14, 19, 26, ! 9, 11, 13, 14, 19, 25, ! 9, 12, 13, 15, 19, 25, ! 8, 10, 13, 14, 17, 22, ! 10, 10, 13, 15, 18, 23, ! 10, 10, 13, 14, 17, 22, ! 10, 10, 13, 15, 17, 28, ! 9, 12, 14, 16, 20, 27, ! 9, 12, 14, 16, 21, 27, ! 9, 12, 14, 16, 21, 27, ! 9, 12, 14, 16, 21, 27, ! 9, 11, 14, 16, 20, 26, ! 9, 11, 14, 16, 20, 26, ! 9, 11, 14, 16, 24, 26, ! 9, 11, 14, 16, 20, 26, ! 11, 10, 12, 14, 18, 24 }; ! short pDrawFontAsc[] = { ! 7, 8, 10, 11, 15, 20, ! 7, 8, 11, 11, 15, 20, ! 7, 8, 10, 11, 15, 20, ! 7, 9, 10, 12, 15, 20, ! 6, 8, 10, 11, 13, 17, ! 8, 8, 10, 11, 13, 18, ! 8, 8, 10, 11, 13, 17, ! 8, 8, 10, 11, 13, 23, ! 7, 10, 11, 13, 16, 22, ! 7, 10, 11, 13, 16, 22, ! 7, 10, 11, 13, 16, 22, ! 7, 10, 11, 13, 16, 22, ! 7, 9, 11, 13, 16, 21, ! 7, 9, 11, 13, 16, 21, ! 7, 9, 11, 13, 18, 21, ! 7, 9, 11, 13, 18, 21, ! 8, 8, 9, 11, 14, 19 ! }; ! ! short pDrawFontDes[] = ! { ! 2, 3, 3, 3, 4, 6, ! 2, 3, 3, 3, 4, 6, ! 2, 3, 3, 3, 4, 5, ! 2, 3, 3, 3, 4, 5, ! 2, 2, 3, 3, 4, 5, ! 2, 2, 3, 4, 5, 5, ! 2, 2, 3, 3, 4, 5, ! 2, 2, 3, 4, 4, 5, ! 2, 2, 3, 3, 4, 5, ! 2, 2, 3, 3, 5, 5, ! 2, 2, 3, 3, 5, 5, ! 2, 2, 3, 3, 5, 5, ! 2, 2, 3, 3, 4, 5, ! 2, 2, 3, 3, 4, 5, ! 2, 2, 3, 3, 6, 5, ! 2, 2, 3, 3, 6, 5, ! 3, 2, 3, 3, 4, 5 }; --- 26,103 ---- int lastFile = TRUE; ! short pDrawFontAsc[] = { ! 8, 10, 12, 14, 17, 22, ! 8, 10, 12, 14, 17, 22, ! 8, 10, 12, 14, 17, 23, ! 8, 10, 12, 14, 17, 22, ! 8, 9, 11, 13, 15, 19, ! 7, 9, 11, 12, 15, 20, ! 7, 9, 11, 13, 15, 19, ! 7, 9, 11, 12, 15, 20, ! 9, 11, 12, 14, 18, 24, ! 9, 11, 12, 14, 17, 24, ! 9, 11, 12, 14, 17, 24, ! 9, 11, 12, 14, 17, 24, ! 8, 11, 12, 14, 18, 23, ! 8, 11, 12, 15, 18, 24, ! 8, 11, 12, 14, 16, 23, ! 8, 11, 12, 14, 16, 24, ! 8, 10, 12, 14, 18, 24, ! 9, 14, 15, 18, 23, 30, ! 10, 14, 16, 17, 23, 30, ! 9, 13, 15, 17, 22, 30, ! 9, 13, 15, 18, 22, 30, ! 9, 12, 14, 15, 19, 26, ! 9, 12, 14, 15, 21, 26, ! 9, 12, 14, 15, 19, 26, ! 9, 12, 14, 15, 20, 26, ! 11, 14, 16, 18, 24, 31, ! 11, 14, 16, 18, 24, 31, ! 11, 14, 16, 18, 24, 31, ! 11, 14, 16, 18, 24, 31, ! 11, 14, 16, 19, 24, 32, ! 11, 15, 16, 19, 24, 33, ! 11, 14, 16, 18, 23, 32, ! 11, 15, 16, 19, 24, 32, ! 11, 12, 13, 14, 19, 27 }; ! short pDrawFontDes[] = { ! 2, 3, 3, 4, 4, 6, ! 2, 3, 3, 4, 4, 6, ! 2, 3, 3, 4, 5, 6, ! 2, 3, 3, 3, 4, 6, ! 2, 2, 3, 3, 4, 5, ! 2, 2, 3, 4, 5, 5, ! 2, 2, 3, 3, 4, 5, ! 2, 2, 3, 4, 5, 5, ! 2, 2, 3, 3, 4, 5, ! 2, 2, 3, 3, 5, 5, ! 2, 2, 3, 3, 5, 5, ! 2, 2, 3, 3, 5, 5, ! 2, 2, 3, 3, 4, 5, ! 2, 2, 3, 3, 4, 5, ! 2, 2, 3, 3, 6, 5, ! 2, 2, 3, 3, 6, 5, ! 3, 4, 4, 6, 7, 8, ! 3, 3, 4, 4, 6, 7, ! 3, 3, 4, 4, 6, 7, ! 3, 4, 4, 5, 6, 7, ! 3, 3, 4, 4, 6, 7, ! 2, 3, 3, 4, 5, 6, ! 2, 4, 3, 5, 5, 7, ! 2, 3, 4, 4, 5, 6, ! 2, 4, 4, 5, 5, 7, ! 2, 3, 4, 4, 5, 7, ! 2, 3, 4, 5, 5, 7, ! 2, 3, 4, 5, 5, 7, ! 2, 3, 4, 5, 5, 7, ! 2, 3, 3, 4, 5, 7, ! 2, 3, 3, 4, 5, 7, ! 2, 3, 3, 4, 5, 7, ! 2, 3, 3, 4, 5, 7, ! 4, 3, 4, 5, 5, 7 }; *** setup.c.orig Fri Aug 17 13:48:56 1990 --- setup.c Fri Aug 17 13:48:58 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/setup.c,v 1.10 90/07/17 16:46:52 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/setup.c,v 1.12 90/08/17 09:32:53 william Exp $"; #endif *************** *** 90,94 **** Window iconBaseWindow; ! int paperWidth = 7.5*PIX_PER_INCH; int paperHeight = 10*PIX_PER_INCH; int drawOrigX = 0; --- 90,94 ---- Window iconBaseWindow; ! int paperWidth = (75*PIX_PER_INCH)/10; int paperHeight = 10*PIX_PER_INCH; int drawOrigX = 0; *** special.c.orig Fri Aug 17 13:49:04 1990 --- special.c Fri Aug 17 13:49:05 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/special.c,v 1.6 90/07/30 11:00:16 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/special.c,v 1.10 90/08/17 13:40:34 william Exp $"; #endif *************** *** 72,79 **** FILE * FP; { ! struct ObjRec * obj_ptr; ! struct AttrRec * attr_ptr, * top_attr = NULL, * bot_attr = NULL; ! char inbuf[MAXPATHLENGTH], obj_name[10]; ! int len; while (fgets (inbuf, MAXPATHLENGTH, FP) != NULL) --- 72,79 ---- FILE * FP; { ! register struct AttrRec * attr_ptr; ! struct ObjRec * obj_ptr; ! char inbuf[MAXPATHLENGTH], obj_name[10]; ! int len; while (fgets (inbuf, MAXPATHLENGTH, FP) != NULL) *************** *** 86,104 **** ReadGroupObj (FP, &obj_ptr, FALSE); obj_ptr->type = OBJ_ICON; ! while (ReadAttr (FP, &attr_ptr, FALSE)) ! { ! attr_ptr->owner = obj_ptr; ! attr_ptr->prev = NULL; ! attr_ptr->next = top_attr; attr_ptr->inherited = TRUE; - if (top_attr == NULL) - bot_attr = attr_ptr; - else - top_attr->prev = attr_ptr; - top_attr = attr_ptr; - } - if (bot_attr != NULL) bot_attr->next = NULL; - obj_ptr->detail.r->fattr = top_attr; - obj_ptr->detail.r->lattr = bot_attr; return (obj_ptr); } --- 86,93 ---- ReadGroupObj (FP, &obj_ptr, FALSE); obj_ptr->type = OBJ_ICON; ! ReadObjAttrs (INVALID, FP, &obj_ptr, FALSE); ! attr_ptr = obj_ptr->lattr; ! for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->prev) attr_ptr->inherited = TRUE; return (obj_ptr); } *************** *** 211,216 **** SetNullCursor (drawWindow); ! obj_ptr->detail.r->id = objId++; ! obj_ptr->detail.r->dirty = FALSE; strcpy (obj_ptr->detail.r->s, sym_name); AddObj (NULL, topObj, obj_ptr); --- 200,205 ---- SetNullCursor (drawWindow); ! obj_ptr->id = objId++; ! obj_ptr->dirty = FALSE; strcpy (obj_ptr->detail.r->s, sym_name); AddObj (NULL, topObj, obj_ptr); *************** *** 353,357 **** HighLightReverse (); topSel->obj->type = OBJ_ICON; ! topSel->obj->detail.r->id = objId++; Msg ("Selected GROUP object is now ICONIC."); SetFileModified (TRUE); --- 342,346 ---- HighLightReverse (); topSel->obj->type = OBJ_ICON; ! topSel->obj->id = objId++; Msg ("Selected GROUP object is now ICONIC."); SetFileModified (TRUE); *** stk.c.orig Fri Aug 17 13:49:10 1990 --- stk.c Fri Aug 17 13:49:11 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stk.c,v 1.5 90/07/30 11:00:40 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stk.c,v 1.6 90/08/15 16:00:13 william Exp $"; #endif *************** *** 96,101 **** stk_ptr->just = textJust; stk_ptr->font = curFont; ! stk_ptr->font_s = curStyle; stk_ptr->f_size = curSize; topObj = botObj = NULL; --- 96,102 ---- stk_ptr->just = textJust; stk_ptr->font = curFont; ! stk_ptr->f_style = curStyle; stk_ptr->f_size = curSize; + stk_ptr->f_dpi = curFontDPI; topObj = botObj = NULL; *************** *** 173,178 **** textJust = topStk->just; curFont = topStk->font; ! curStyle = topStk->font_s; ! curSize = topStk->f_size; topObj = topStk->first; --- 174,179 ---- textJust = topStk->just; curFont = topStk->font; ! curStyle = topStk->f_style; ! curFontDPI = topStk->f_dpi; topObj = topStk->first; *** stretch.c.orig Fri Aug 17 13:49:30 1990 --- stretch.c Fri Aug 17 13:49:32 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stretch.c,v 1.8 90/08/02 08:57:17 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stretch.c,v 1.9 90/08/11 00:14:25 william Exp $"; #endif *************** *** 455,462 **** drawOrigY, ObjPtr->detail.p->n, ObjPtr->detail.p->vlist); } ! if ((attr_ptr = ObjPtr->detail.p->fattr) != NULL) for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) StretchObj (attr_ptr->obj, Corner); break; case OBJ_POLYGON: for (i = 0; i < ObjPtr->detail.g->n; i++) --- 455,473 ---- drawOrigY, ObjPtr->detail.p->n, ObjPtr->detail.p->vlist); } ! if ((attr_ptr = ObjPtr->fattr) != NULL) for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) StretchObj (attr_ptr->obj, Corner); break; + case OBJ_BOX: + if ((attr_ptr = ObjPtr->fattr) != NULL) + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + StretchObj (attr_ptr->obj, Corner); + break; + case OBJ_OVAL: + if ((attr_ptr = ObjPtr->fattr) != NULL) + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + StretchObj (attr_ptr->obj, Corner); + break; + case OBJ_TEXT: break; case OBJ_POLYGON: for (i = 0; i < ObjPtr->detail.g->n; i++) *************** *** 474,477 **** --- 485,491 ---- drawOrigY, ObjPtr->detail.g->n, ObjPtr->detail.g->vlist); } + if ((attr_ptr = ObjPtr->fattr) != NULL) + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + StretchObj (attr_ptr->obj, Corner); break; case OBJ_SYM: *************** *** 479,483 **** for (ptr = ObjPtr->detail.r->first; ptr != NULL; ptr = ptr->next) StretchObj (ptr, Corner); ! if ((attr_ptr = ObjPtr->detail.p->fattr) != NULL) for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) StretchObj (attr_ptr->obj, Corner); --- 493,497 ---- for (ptr = ObjPtr->detail.r->first; ptr != NULL; ptr = ptr->next) StretchObj (ptr, Corner); ! if ((attr_ptr = ObjPtr->fattr) != NULL) for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) StretchObj (attr_ptr->obj, Corner); *************** *** 484,490 **** break; case OBJ_ICON: break; - case OBJ_BOX: break; - case OBJ_OVAL: break; - case OBJ_TEXT: break; } AdjObjBBox (ObjPtr); --- 498,501 ---- *************** *** 692,698 **** switch (ObjPtr->type) { - case OBJ_BOX: break; - case OBJ_OVAL: break; - case OBJ_TEXT: break; case OBJ_POLY: num_pts = ObjPtr->detail.p->n; --- 703,706 ---- *************** *** 699,703 **** v = ObjPtr->detail.p->vlist; for (i = 0; i < num_pts; i++, v++) (*v).x = two_x_pivot - (*v).x; - attr_ptr = ObjPtr->detail.p->fattr; if (ObjPtr->detail.p->curved) { --- 707,710 ---- *************** *** 707,713 **** --- 714,732 ---- drawOrigY, ObjPtr->detail.p->n, ObjPtr->detail.p->vlist); } + attr_ptr = ObjPtr->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) FlipObjHorizontal (attr_ptr->obj); break; + case OBJ_BOX: + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + FlipObjHorizontal (attr_ptr->obj); + break; + case OBJ_OVAL: + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + FlipObjHorizontal (attr_ptr->obj); + break; + case OBJ_TEXT: break; case OBJ_POLYGON: num_pts = ObjPtr->detail.g->n; *************** *** 721,724 **** --- 740,746 ---- drawOrigY, ObjPtr->detail.g->n, ObjPtr->detail.g->vlist); } + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + FlipObjHorizontal (attr_ptr->obj); break; case OBJ_GROUP: *************** *** 728,732 **** for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) FlipObjHorizontal (obj_ptr); ! attr_ptr = ObjPtr->detail.r->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) FlipObjHorizontal (attr_ptr->obj); --- 750,754 ---- for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) FlipObjHorizontal (obj_ptr); ! attr_ptr = ObjPtr->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) FlipObjHorizontal (attr_ptr->obj); *************** *** 783,789 **** switch (ObjPtr->type) { - case OBJ_BOX: break; - case OBJ_OVAL: break; - case OBJ_TEXT: break; case OBJ_POLY: num_pts = ObjPtr->detail.p->n; --- 805,808 ---- *************** *** 790,794 **** v = ObjPtr->detail.p->vlist; for (i = 0; i < num_pts; i++, v++) (*v).y = two_x_pivot - (*v).y; - attr_ptr = ObjPtr->detail.p->fattr; if (ObjPtr->detail.p->curved) { --- 809,812 ---- *************** *** 798,804 **** --- 816,834 ---- drawOrigY, ObjPtr->detail.p->n, ObjPtr->detail.p->vlist); } + attr_ptr = ObjPtr->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) FlipObjVertical (attr_ptr->obj); break; + case OBJ_BOX: + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + FlipObjVertical (attr_ptr->obj); + break; + case OBJ_OVAL: + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + FlipObjVertical (attr_ptr->obj); + break; + case OBJ_TEXT: break; case OBJ_POLYGON: num_pts = ObjPtr->detail.g->n; *************** *** 812,815 **** --- 842,848 ---- drawOrigY, ObjPtr->detail.g->n, ObjPtr->detail.g->vlist); } + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + FlipObjVertical (attr_ptr->obj); break; case OBJ_GROUP: *************** *** 819,823 **** for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) FlipObjVertical (obj_ptr); ! attr_ptr = ObjPtr->detail.r->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) FlipObjVertical (attr_ptr->obj); --- 852,856 ---- for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) FlipObjVertical (obj_ptr); ! attr_ptr = ObjPtr->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) FlipObjVertical (attr_ptr->obj); *************** *** 897,903 **** switch (ObjPtr->type) { - case OBJ_BOX: break; - case OBJ_OVAL: break; - case OBJ_TEXT: break; case OBJ_POLY: num_pts = ObjPtr->detail.p->n; --- 930,933 ---- *************** *** 916,923 **** drawOrigY, ObjPtr->detail.p->n, ObjPtr->detail.p->vlist); } ! attr_ptr = ObjPtr->detail.p->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) RotateObjClockWise (attr_ptr->obj); break; case OBJ_POLYGON: num_pts = ObjPtr->detail.g->n; --- 946,964 ---- drawOrigY, ObjPtr->detail.p->n, ObjPtr->detail.p->vlist); } ! attr_ptr = ObjPtr->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) RotateObjClockWise (attr_ptr->obj); break; + case OBJ_BOX: + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + RotateObjClockWise (attr_ptr->obj); + break; + case OBJ_OVAL: + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + RotateObjClockWise (attr_ptr->obj); + break; + case OBJ_TEXT: break; case OBJ_POLYGON: num_pts = ObjPtr->detail.g->n; *************** *** 936,939 **** --- 977,983 ---- drawOrigY, ObjPtr->detail.g->n, ObjPtr->detail.g->vlist); } + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + RotateObjClockWise (attr_ptr->obj); break; case OBJ_GROUP: *************** *** 943,947 **** for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) RotateObjClockWise (obj_ptr); ! attr_ptr = ObjPtr->detail.r->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) RotateObjClockWise (attr_ptr->obj); --- 987,991 ---- for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) RotateObjClockWise (obj_ptr); ! attr_ptr = ObjPtr->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) RotateObjClockWise (attr_ptr->obj); *************** *** 1003,1009 **** switch (ObjPtr->type) { - case OBJ_BOX: break; - case OBJ_OVAL: break; - case OBJ_TEXT: break; case OBJ_POLY: num_pts = ObjPtr->detail.p->n; --- 1047,1050 ---- *************** *** 1022,1029 **** drawOrigY, ObjPtr->detail.p->n, ObjPtr->detail.p->vlist); } ! attr_ptr = ObjPtr->detail.p->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) RotateObjCounter (attr_ptr->obj); break; case OBJ_POLYGON: num_pts = ObjPtr->detail.g->n; --- 1063,1081 ---- drawOrigY, ObjPtr->detail.p->n, ObjPtr->detail.p->vlist); } ! attr_ptr = ObjPtr->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) RotateObjCounter (attr_ptr->obj); break; + case OBJ_BOX: + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + RotateObjCounter (attr_ptr->obj); + break; + case OBJ_OVAL: + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + RotateObjCounter (attr_ptr->obj); + break; + case OBJ_TEXT: break; case OBJ_POLYGON: num_pts = ObjPtr->detail.g->n; *************** *** 1042,1045 **** --- 1094,1100 ---- drawOrigY, ObjPtr->detail.g->n, ObjPtr->detail.g->vlist); } + attr_ptr = ObjPtr->fattr; + for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) + RotateObjCounter (attr_ptr->obj); break; case OBJ_GROUP: *************** *** 1049,1053 **** for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) RotateObjCounter (obj_ptr); ! attr_ptr = ObjPtr->detail.r->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) RotateObjCounter (attr_ptr->obj); --- 1104,1108 ---- for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->next) RotateObjCounter (obj_ptr); ! attr_ptr = ObjPtr->fattr; for ( ; attr_ptr != NULL; attr_ptr = attr_ptr->next) RotateObjCounter (attr_ptr->obj); *** text.c.orig Fri Aug 17 13:50:17 1990 --- text.c Fri Aug 17 13:50:19 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/text.c,v 1.9 90/07/30 11:02:09 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/text.c,v 1.16 90/08/16 15:44:38 william Exp $"; #endif *************** *** 147,153 **** { register int i, j; int w, h, amount, left, right, len; XGCValues values; - XImage * from_image; XOff >>= zoomScale; --- 147,153 ---- { register int i, j; + register XImage * from_image; int w, h, amount, left, right, len; XGCValues values; XOff >>= zoomScale; *************** *** 266,269 **** --- 266,273 ---- } + XSetForeground (mainDisplay, defaultGC, 0); + XFillRectangle (mainDisplay, textBackingPixmap, defaultGC, 0, 0, w, h); + XSetForeground (mainDisplay, defaultGC, myFgPixel); + XSetFont (mainDisplay, revDefaultGC, canvasFontPtr->fid); XDrawImageString (mainDisplay, textBackingPixmap, revDefaultGC, 0, *************** *** 280,289 **** GCStipple | GCLineWidth, &values); ! for (i = 0; i < w; i++) ! for (j = 0; j < h; j++) ! if (XGetPixel (from_image, i, j) == 1) ! switch (Rotate) ! { ! case ROTATE90: /* XDrawPoint (mainDisplay, Win, gc, XOff-j, YOff+i); */ /* Hack to run on RTs -- crash server on RTs */ --- 284,293 ---- GCStipple | GCLineWidth, &values); ! switch (Rotate) ! { ! case ROTATE90: ! for (i = 0; i < w; i++) ! for (j = 0; j < h; j++) ! if (XGetPixel (from_image, i, j) == 1) /* XDrawPoint (mainDisplay, Win, gc, XOff-j, YOff+i); */ /* Hack to run on RTs -- crash server on RTs */ *************** *** 290,295 **** XDrawLine (mainDisplay, Win, gc, XOff-j, YOff+i, XOff-j, YOff+i); ! break; ! case ROTATE180: /* XDrawPoint (mainDisplay, Win, gc, XOff-i, YOff-j); */ /* Hack to run on RTs -- crash server on RTs */ --- 294,302 ---- XDrawLine (mainDisplay, Win, gc, XOff-j, YOff+i, XOff-j, YOff+i); ! break; ! case ROTATE180: ! for (i = 0; i < w; i++) ! for (j = 0; j < h; j++) ! if (XGetPixel (from_image, i, j) == 1) /* XDrawPoint (mainDisplay, Win, gc, XOff-i, YOff-j); */ /* Hack to run on RTs -- crash server on RTs */ *************** *** 296,301 **** XDrawLine (mainDisplay, Win, gc, XOff-i, YOff-j, XOff-i, YOff-j); ! break; ! case ROTATE270: /* XDrawPoint (mainDisplay, Win, gc, XOff+j, YOff-i); */ /* Hack to run on RTs -- crash server on RTs */ --- 303,311 ---- XDrawLine (mainDisplay, Win, gc, XOff-i, YOff-j, XOff-i, YOff-j); ! break; ! case ROTATE270: ! for (i = 0; i < w; i++) ! for (j = 0; j < h; j++) ! if (XGetPixel (from_image, i, j) == 1) /* XDrawPoint (mainDisplay, Win, gc, XOff+j, YOff-i); */ /* Hack to run on RTs -- crash server on RTs */ *************** *** 302,307 **** XDrawLine (mainDisplay, Win, gc, XOff+j, YOff-i, XOff+j, YOff-i); ! break; ! } XDestroyImage (from_image); } --- 312,318 ---- XDrawLine (mainDisplay, Win, gc, XOff+j, YOff-i, XOff+j, YOff-i); ! break; ! } ! XDestroyImage (from_image); } *************** *** 344,347 **** --- 355,359 ---- text_ptr = (struct TextRec *) calloc (1, sizeof(struct TextRec)); text_ptr->font = curFont; + text_ptr->dpi = curFontDPI; text_ptr->style = curStyle; text_ptr->attr = NULL; *************** *** 359,363 **** --- 371,378 ---- curTextObj->type = OBJ_TEXT; curTextObj->color = colorIndex; + curTextObj->id = objId++; + curTextObj->dirty = FALSE; curTextObj->detail.t = text_ptr; + curTextObj->fattr = curTextObj->lattr = NULL; AddObj (NULL, topObj, curTextObj); *************** *** 465,468 **** --- 480,484 ---- SaveCurFont (); curFont = ObjPtr->detail.t->font; + curFontDPI = ObjPtr->detail.t->dpi; curStyle = ObjPtr->detail.t->style; curSize = ObjPtr->detail.t->size; *************** *** 614,632 **** if ((attr_ptr = curTextObj->detail.t->attr) != NULL) { ! if ((!attr_ptr->nameshown) || FindEqual (curTextObj->detail.t->first->s)) ! { ! UpdateAttr(curTextObj->detail.t, attr_ptr); ! textDrawn = FALSE; ! justDrawnTextObj = NULL; ! } ! else ! { ! UnlinkAttr (attr_ptr); ! curTextObj->detail.t->attr = NULL; ! AddObj (NULL, topObj, curTextObj); ! FreeAttr (attr_ptr); ! textDrawn = TRUE; ! justDrawnTextObj = curTextObj; ! } AdjObjBBox (attr_ptr->owner); } --- 630,636 ---- if ((attr_ptr = curTextObj->detail.t->attr) != NULL) { ! UpdateAttr(curTextObj->detail.t, attr_ptr); ! textDrawn = FALSE; ! justDrawnTextObj = NULL; AdjObjBBox (attr_ptr->owner); } *************** *** 704,723 **** else { ! if ((obj_ptr->type == OBJ_POLY) || (obj_ptr->type == OBJ_GROUP) || ! (obj_ptr->type == OBJ_SYM) || (obj_ptr->type == OBJ_ICON)) ! { ! switch (obj_ptr->type) ! { ! case OBJ_POLY : attr_ptr = obj_ptr->detail.p->fattr; break; ! case OBJ_GROUP : ! case OBJ_SYM : ! case OBJ_ICON : attr_ptr = obj_ptr->detail.r->fattr; break; ! } ! for (; attr_ptr != NULL; attr_ptr = attr_ptr->next) ! if (X>=attr_ptr->obj->bbox.ltx && X<=attr_ptr->obj->bbox.rbx && ! Y>=attr_ptr->obj->bbox.lty && Y<=attr_ptr->obj->bbox.rby && ! attr_ptr->shown == TRUE) ! return (attr_ptr->obj); ! } } return (NULL); --- 708,717 ---- else { ! attr_ptr = obj_ptr->fattr; ! for (; attr_ptr != NULL; attr_ptr = attr_ptr->next) ! if (X>=attr_ptr->obj->bbox.ltx && X<=attr_ptr->obj->bbox.rbx && ! Y>=attr_ptr->obj->bbox.lty && Y<=attr_ptr->obj->bbox.rby && ! attr_ptr->shown == TRUE) ! return (attr_ptr->obj); } return (NULL); *************** *** 810,813 **** --- 804,808 ---- curFont = obj_ptr->detail.t->font; + curFontDPI = obj_ptr->detail.t->dpi; curStyle = obj_ptr->detail.t->style; curSize = obj_ptr->detail.t->size; *************** *** 1394,1397 **** --- 1389,1393 ---- curFont = text_ptr->font; + curFontDPI = text_ptr->dpi; curStyle = text_ptr->style; curSize = text_ptr->size; *************** *** 1402,1408 **** if (PRTGIF) { ! textCursorH = pDrawCursorH[FontIndex(curFont,curSize,curStyle)]; ! canvasFontAsc = pDrawFontAsc[FontIndex(curFont,curSize,curStyle)]; ! canvasFontDes = pDrawFontDes[FontIndex(curFont,curSize,curStyle)]; } else --- 1398,1407 ---- if (PRTGIF) { ! canvasFontAsc = ! pDrawFontAsc[FontIndex(curFontDPI,curFont,curSize,curStyle)]; ! canvasFontDes = ! pDrawFontDes[FontIndex(curFontDPI,curFont,curSize,curStyle)]; ! textCursorH = canvasFontAsc + canvasFontDes; ! pointSize = (curFontDPI == FONT_DPI_75) ? pointSize75 : pointSize100; } else *************** *** 1534,1537 **** --- 1533,1537 ---- SaveCurFont (); curFont = text_ptr->font; + curFontDPI = text_ptr->dpi; curStyle = text_ptr->style; curSize = text_ptr->size; *************** *** 1658,1666 **** fprintf (FP, "text(%s,", colorMenuItems[ObjPtr->color]); ! fprintf (FP, "%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,[\n", ObjPtr->x, ! ObjPtr->y, t_ptr->font, t_ptr->style, t_ptr->size, t_ptr->lines, t_ptr->just, t_ptr->rotate, t_ptr->pen, ObjPtr->obbox.rbx-ObjPtr->obbox.ltx, ! ObjPtr->obbox.rby-ObjPtr->obbox.lty); for (s_ptr = t_ptr->first; s_ptr->next != NULL; s_ptr = s_ptr->next) --- 1658,1666 ---- fprintf (FP, "text(%s,", colorMenuItems[ObjPtr->color]); ! fprintf (FP, "%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,%1d,[\n", ! ObjPtr->x, ObjPtr->y, t_ptr->font, t_ptr->style, t_ptr->size, t_ptr->lines, t_ptr->just, t_ptr->rotate, t_ptr->pen, ObjPtr->obbox.rbx-ObjPtr->obbox.ltx, ! ObjPtr->obbox.rby-ObjPtr->obbox.lty, ObjPtr->id, t_ptr->dpi); for (s_ptr = t_ptr->first; s_ptr->next != NULL; s_ptr = s_ptr->next) *************** *** 1702,1706 **** int num_lines, x, y, font, style, size; int text_just, rotate, pen; ! int bbox_w, bbox_h; * ObjPtr = (struct ObjRec *) calloc (1, sizeof(struct ObjRec)); --- 1702,1706 ---- int num_lines, x, y, font, style, size; int text_just, rotate, pen; ! int bbox_w, bbox_h, dpi; * ObjPtr = (struct ObjRec *) calloc (1, sizeof(struct ObjRec)); *************** *** 1713,1731 **** rotate = 0; pen = 1; } else if (fileVersion <= 6) sscanf (s, "%d , %d , %d , %d , %d , %d , %d , %d , %d", &x, &y, &font, &style, &size, &num_lines, &text_just, &rotate, &pen); else sscanf (s, ! "%d , %d , %d , %d , %d , %d , %d , %d , %d , %d , %d", &x, &y, &font, &style, &size, &num_lines, &text_just, &rotate, &pen, ! &bbox_w, &bbox_h); text_ptr = (struct TextRec *) calloc (1, sizeof(struct TextRec)); - text_ptr->just = text_just; text_ptr->lines = num_lines; - text_ptr->rotate = rotate; - text_ptr->pen = pen; if (!PRTGIF) SaveCurFont (); --- 1713,1745 ---- rotate = 0; pen = 1; + (*ObjPtr)->id = objId++; + dpi = FONT_DPI_75; } else if (fileVersion <= 6) + { sscanf (s, "%d , %d , %d , %d , %d , %d , %d , %d , %d", &x, &y, &font, &style, &size, &num_lines, &text_just, &rotate, &pen); + (*ObjPtr)->id = objId++; + dpi = FONT_DPI_75; + } + else if (fileVersion <= 7) + { + sscanf (s, "%d , %d , %d , %d , %d , %d , %d , %d , %d , %d , %d", + &x, &y, &font, &style, &size, &num_lines, &text_just, &rotate, &pen, + &bbox_w, &bbox_h); + (*ObjPtr)->id = objId++; + dpi = FONT_DPI_75; + } else + { sscanf (s, ! "%d , %d , %d , %d , %d , %d , %d , %d , %d , %d , %d , %d , %d", &x, &y, &font, &style, &size, &num_lines, &text_just, &rotate, &pen, ! &bbox_w, &bbox_h, &((*ObjPtr)->id), &dpi); ! if ((*ObjPtr)->id >= objId) objId = (*ObjPtr)->id + 1; ! } text_ptr = (struct TextRec *) calloc (1, sizeof(struct TextRec)); text_ptr->lines = num_lines; if (!PRTGIF) SaveCurFont (); *************** *** 1732,1745 **** curFont = text_ptr->font = font; curStyle = text_ptr->style = style; curSize = text_ptr->size = size; ! textJust = text_just; ! curRotate = rotate; if (PRTGIF) { ! penPat = pen; ! textCursorH = pDrawCursorH[FontIndex(curFont,curSize,curStyle)]; ! canvasFontAsc = pDrawFontAsc[FontIndex(curFont,curSize,curStyle)]; } else --- 1746,1763 ---- curFont = text_ptr->font = font; + curFontDPI = text_ptr->dpi = dpi; curStyle = text_ptr->style = style; curSize = text_ptr->size = size; ! textJust = text_ptr->just = text_just; ! curRotate = text_ptr->rotate = rotate; ! penPat = text_ptr->pen = pen; if (PRTGIF) { ! canvasFontAsc = ! pDrawFontAsc[FontIndex(curFontDPI,curFont,curSize,curStyle)]; ! canvasFontDes = ! pDrawFontDes[FontIndex(curFontDPI,curFont,curSize,curStyle)]; ! textCursorH = canvasFontAsc + canvasFontDes; } else *************** *** 1777,1780 **** --- 1795,1799 ---- (*ObjPtr)->type = OBJ_TEXT; (*ObjPtr)->color = FindColorIndex (color_str); + (*ObjPtr)->dirty = FALSE; (*ObjPtr)->detail.t = text_ptr; *************** *** 1856,1860 **** if (*s == *s1) return; /* no updates */ ! ObjPtr->detail.t->attr->owner->detail.r->dirty = TRUE; *c_ptr = '\0'; --- 1875,1879 ---- if (*s == *s1) return; /* no updates */ ! ObjPtr->detail.t->attr->owner->dirty = TRUE; *c_ptr = '\0'; *************** *** 1861,1864 **** --- 1880,1884 ---- SaveCurFont (); curFont = ObjPtr->detail.t->font; + curFontDPI = ObjPtr->detail.t->dpi; curStyle = ObjPtr->detail.t->style; curSize = ObjPtr->detail.t->size; *** tgif.c.orig Fri Aug 17 13:50:28 1990 --- tgif.c Fri Aug 17 13:50:29 1990 *************** *** 6,10 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.c,v 1.6 90/07/30 11:04:46 william Exp $"; #endif --- 6,10 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.c,v 1.7 90/08/15 15:05:17 william Exp $"; #endif *************** *** 21,25 **** int lastFile; - short * pDrawCursorH; short * pDrawFontAsc; short * pDrawFontDes; --- 21,24 ---- *** version.c.orig Fri Aug 17 13:50:33 1990 --- version.c Fri Aug 17 13:50:34 1990 *************** *** 6,11 **** #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/version.c,v 1.15 90/08/02 09:05:03 william Exp $"; #endif ! char * version_string = "1.12"; --- 6,11 ---- #ifndef lint static char RCSid[] = ! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/version.c,v 1.16 90/08/16 09:41:02 william Exp $"; #endif ! char * version_string = "1.13"; *** choice.e.orig Fri Aug 17 13:50:39 1990 --- choice.e Fri Aug 17 13:50:40 1990 *************** *** 4,8 **** * Copyright (C) 1989, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/choice.e,v 1.1 90/04/01 22:16:56 william Exp $ */ --- 4,8 ---- * Copyright (C) 1989, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/choice.e,v 1.2 90/08/14 18:04:06 william Exp $ */ *************** *** 17,20 **** --- 17,21 ---- extern void ShowJust (); extern void ShowCurFont (); + extern void ShowCurFontDPI (); extern void ShowLineWidth (); extern void ShowWhereToPrint (); *** copypaste.e.orig Fri Aug 17 13:50:42 1990 --- copypaste.e Fri Aug 17 13:50:44 1990 *************** *** 0 **** --- 1,12 ---- + /* + * Author: Kou1 Ma2da (matsuda@ccs.mt.nec.co.jp) + * Modified By: William Chia-Wei Cheng (william@cs.ucla.edu) + * + * Copyright (C) 1990, William Cheng. + * + * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/copypaste.e,v 1.1 90/08/16 09:34:15 william Exp $ + */ + + extern void CopyToCutBuffer (); + extern void PasteFromCutBuffer (); + extern void CleanUpCutBuffer (); *** dup.e.orig Fri Aug 17 13:50:48 1990 --- dup.e Fri Aug 17 13:50:49 1990 *************** *** 4,8 **** * Copyright (C) 1989, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/dup.e,v 1.2 90/07/06 18:00:44 william Exp $ */ --- 4,8 ---- * Copyright (C) 1989, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/dup.e,v 1.3 90/08/16 09:05:28 william Exp $ */ *************** *** 11,16 **** extern int dupDy; ! extern void DupObjBasics (); ! extern void DupTextObj (); ! extern void DupSelObj (); ! extern void JustDupSelObj (); --- 11,17 ---- extern int dupDy; ! extern void DupObjBasics (); ! extern void DupTextObj (); ! extern struct ObjRec * DupObj (); ! extern void DupSelObj (); ! extern void JustDupSelObj (); *** file.e.orig Fri Aug 17 13:50:53 1990 --- file.e Fri Aug 17 13:50:54 1990 *************** *** 4,8 **** * Copyright (C) 1989, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.e,v 1.11 90/07/30 15:53:31 william Exp $ */ --- 4,8 ---- * Copyright (C) 1989, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.e,v 1.12 90/08/10 23:51:33 william Exp $ */ *************** *** 30,33 **** --- 30,34 ---- extern char * FindChar (); extern void ReadState (); + extern void ReadObjAttrs (); extern int ReadObj (); extern void ChangeDomain (); *** font.e.orig Fri Aug 17 13:50:58 1990 --- font.e Fri Aug 17 13:50:59 1990 *************** *** 4,8 **** * Copyright (C) 1989, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.e,v 1.3 90/07/20 16:59:06 william Exp $ */ --- 4,8 ---- * Copyright (C) 1989, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.e,v 1.4 90/08/15 16:58:35 william Exp $ */ *************** *** 26,30 **** extern int defaultFontDes; ! extern int pointSize[]; extern int curFontDPI; extern int curFont; --- 26,32 ---- extern int defaultFontDes; ! extern int * pointSize; ! extern int pointSize75[]; ! extern int pointSize100[]; extern int curFontDPI; extern int curFont; *** prtgif.e.orig Fri Aug 17 13:51:04 1990 --- prtgif.e Fri Aug 17 13:51:05 1990 *************** *** 4,12 **** * Copyright (C) 1990, William Cheng. * ! * @(#) $Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/prtgif.e,v 1.1 90/07/30 11:08:07 william Exp $ */ extern int lastFile; - extern short pDrawCursorH[]; extern short pDrawFontAsc[]; extern short pDrawFontDes[]; --- 4,11 ---- * Copyright (C) 1990, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/prtgif.e,v 1.3 90/08/17 11:13:33 william Exp $ */ extern int lastFile; extern short pDrawFontAsc[]; extern short pDrawFontDes[]; *** const.h.orig Fri Aug 17 13:51:09 1990 --- const.h Fri Aug 17 13:51:10 1990 *************** *** 4,8 **** * Copyright (C) 1990, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/const.h,v 1.5 90/05/23 08:54:00 william Exp Locker: william $ */ --- 4,8 ---- * Copyright (C) 1990, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/const.h,v 1.7 90/08/15 11:41:10 william Exp $ */ *************** *** 114,117 **** --- 114,122 ---- #define MAXFONTSTYLES 4 + #define FONT_DPI_75 0 + #define FONT_DPI_100 1 + + #define MAXFONTDPIS 2 + #define MAXFONTSIZES 6 *************** *** 121,142 **** #define MAXJUSTS 3 - - /* top level menu */ - - #define MENU_MODE 0 - #define MENU_FILE 1 - #define MENU_EDIT 2 - #define MENU_STYLE 3 - #define MENU_SIZE 4 - #define MENU_FONT 5 - #define MENU_LAYOUT 6 - #define MENU_ARRANGE 7 - #define MENU_FILL 8 - #define MENU_LINESTYLE 9 - #define MENU_PEN 10 - #define MENU_COLOR 11 - #define MENU_SPECIAL 12 - - #define MAXMENUS 13 /* alignment */ --- 126,129 ---- *** types.h.orig Fri Aug 17 13:51:16 1990 --- types.h Fri Aug 17 13:51:16 1990 *************** *** 4,8 **** * Copyright (C) 1990, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/types.h,v 1.4 90/07/30 15:53:05 william Exp $ */ --- 4,8 ---- * Copyright (C) 1990, William Cheng. * ! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/types.h,v 1.7 90/08/14 17:32:37 william Exp $ */ *************** *** 19,26 **** typedef struct ObjRec { ! int x, y, type, color; struct BBRec obbox; /* object bounding box */ struct BBRec bbox; /* real bounding box */ struct ObjRec * next, * prev; union { struct GroupRec * r; --- 19,27 ---- typedef struct ObjRec { ! int x, y, type, color, id, dirty; struct BBRec obbox; /* object bounding box */ struct BBRec bbox; /* real bounding box */ struct ObjRec * next, * prev; + struct AttrRec * fattr, * lattr; /* first and last attributes */ union { struct GroupRec * r; *************** *** 47,53 **** struct ObjRec * first, * last; char s[MAXSTRING+1]; - int id, dirty; - struct AttrRec * fattr, *lattr; /* first and last attributes */ - /* OBJ_GROUP, OBJ_SYM, OBJ_ICON can have attr */ } * GroupRecPtr; --- 48,51 ---- *************** *** 57,62 **** int sn; /* number of points in the spline polyline */ XPoint * svlist; ! int style, width, pen, curved, id, fill; ! struct AttrRec * fattr, *lattr; /* OBJ_POLY can have attr */ } * PolyRecPtr; --- 55,59 ---- int sn; /* number of points in the spline polyline */ XPoint * svlist; ! int style, width, pen, curved, fill; } * PolyRecPtr; *************** *** 85,89 **** int just; int lines; ! int font, style, size, rotate, pen; struct AttrRec * attr; /* ptr to attr record if text obj is an attr */ struct StrRec * first, * last; --- 82,86 ---- int just; int lines; ! int font, style, size, dpi, rotate, pen; struct AttrRec * attr; /* ptr to attr record if text obj is an attr */ struct StrRec * first, * last; *************** *** 101,105 **** int orig_x, orig_y, zoom, grid, grid_on; int color, h_align, v_align, line_w, line_s; ! int fill, pen, just, font, font_s, f_size, f_comp_size; char name[MAXPATHLENGTH+1], domain[MAXPATHLENGTH+1]; } * StkRecPtr; --- 98,102 ---- int orig_x, orig_y, zoom, grid, grid_on; int color, h_align, v_align, line_w, line_s; ! int fill, pen, just, font, f_style, f_size, f_dpi; char name[MAXPATHLENGTH+1], domain[MAXPATHLENGTH+1]; } * StkRecPtr; *** Makefile.noimake.orig Fri Aug 17 13:51:22 1990 --- Makefile.noimake Fri Aug 17 13:51:23 1990 *************** *** 4,8 **** # Copyright (C) 1990, William Cheng. # ! # @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Makefile.noimake,v 1.19 90/07/30 11:05:05 william Exp $ # --- 4,8 ---- # Copyright (C) 1990, William Cheng. # ! # @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Makefile.noimake,v 1.22 90/08/16 13:21:47 william Exp $ # *************** *** 19,23 **** OBJ1 = align.o animate.o attr.o \ box.o button.o \ ! choice.o color.o cursor.o \ dialog.o drawing.o dup.o \ edit.o \ --- 19,23 ---- OBJ1 = align.o animate.o attr.o \ box.o button.o \ ! choice.o color.o copypaste.o cursor.o \ dialog.o drawing.o dup.o \ edit.o \ *************** *** 95,111 **** color.o: const.h types.h \ choice.e mark.e menu.e obj.e raster.e select.e setup.e text.e cursor.o: const.h types.h $(CURSOR_BM) choice.e setup.e dialog.o: const.h box.e cursor.e font.e mainloop.e raster.e setup.e drawing.o: const.h types.h \ ! align.e animate.e attr.e box.e choice.e cursor.e dialog.e \ ! dup.e edit.e file.e font.e grid.e group.e mark.e menu.e msg.e \ ! obj.e oval.e pattern.e poly.e polygon.e raster.e rect.e \ ! ruler.e scroll.e select.e setup.e special.e stk.e stretch.e \ ! text.e dup.o: const.h types.h \ attr.e drawing.e grid.e obj.e select.e setup.e edit.o: const.h types.h \ ! align.e color.e cursor.e drawing.e dup.e font.e group.e mark.e \ ! obj.e poly.e raster.e select.e setup.e spline.e stretch.e file.o: const.h types.h \ align.e attr.e box.e button.e choice.e color.e dialog.e \ --- 95,115 ---- color.o: const.h types.h \ choice.e mark.e menu.e obj.e raster.e select.e setup.e text.e + copypaste.o: const.h types.h \ + choice.e color.e dup.e file.e font.e obj.e pattern.e select.e \ + setup.e special.e text.e cursor.o: const.h types.h $(CURSOR_BM) choice.e setup.e dialog.o: const.h box.e cursor.e font.e mainloop.e raster.e setup.e drawing.o: const.h types.h \ ! align.e animate.e attr.e box.e choice.e copypaste.e cursor.e \ ! dialog.e dup.e edit.e file.e font.e grid.e group.e mark.e \ ! menu.e msg.e obj.e oval.e pattern.e poly.e polygon.e raster.e \ ! rect.e ruler.e scroll.e select.e setup.e special.e stk.e \ ! stretch.e text.e dup.o: const.h types.h \ attr.e drawing.e grid.e obj.e select.e setup.e edit.o: const.h types.h \ ! align.e color.e copypaste.e cursor.e drawing.e dup.e font.e \ ! group.e mark.e obj.e poly.e raster.e select.e setup.e spline.e \ ! stretch.e file.o: const.h types.h \ align.e attr.e box.e button.e choice.e color.e dialog.e \ *************** *** 122,128 **** attr.e dup.e file.e obj.e select.e setup.e mainloop.o: const.h types.h \ ! animate.e choice.e color.e cursor.e dialog.e drawing.e \ ! file.e font.e grid.e menu.e msg.e names.e obj.e raster.e \ ! ruler.e scroll.e select.e setup.e stk.e text.e mark.o: const.h types.h \ raster.e setup.e select.e --- 126,132 ---- attr.e dup.e file.e obj.e select.e setup.e mainloop.o: const.h types.h \ ! animate.e choice.e color.e copypaste.e cursor.e dialog.e \ ! drawing.e file.e font.e grid.e menu.e msg.e names.e obj.e \ ! raster.e ruler.e scroll.e select.e setup.e stk.e text.e mark.o: const.h types.h \ raster.e setup.e select.e *** Imakefile.orig Fri Aug 17 13:51:29 1990 --- Imakefile Fri Aug 17 13:51:29 1990 *************** *** 4,11 **** /**/# Copyright (C) 1990, William Cheng. /**/# ! /**/# @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Imakefile,v 1.21 90/08/02 09:15:42 william Exp $ /**/# ! TGIFVERSION = 1.12 PROGRAMS = tgif prtgif tgif2ps frontend11.o CDEBUGFLAGS = -g --- 4,11 ---- /**/# Copyright (C) 1990, William Cheng. /**/# ! /**/# @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Imakefile,v 1.23 90/08/17 09:48:59 william Exp $ /**/# ! TGIFVERSION = 1.13 PROGRAMS = tgif prtgif tgif2ps frontend11.o CDEBUGFLAGS = -g *************** *** 15,18 **** --- 15,19 ---- -DPSFILE_MOD=\"664\" LOCAL_LIBRARIES = $(XLIB) + DEPLIBS = $(DEPXLIB) SYS_LIBRARIES = -lm *************** *** 19,23 **** OBJ1 = align.o animate.o attr.o \ box.o button.o \ ! choice.o color.o cursor.o \ dialog.o drawing.o dup.o \ edit.o \ --- 20,24 ---- OBJ1 = align.o animate.o attr.o \ box.o button.o \ ! choice.o color.o copypaste.o cursor.o \ dialog.o drawing.o dup.o \ edit.o \ *** tgif.man.orig Fri Aug 17 13:51:39 1990 --- tgif.man Fri Aug 17 13:51:40 1990 *************** *** 1,4 **** ! .\"@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.man,v 1.10 90/07/30 16:06:37 william Exp $ ! .TH TGIF 1 "Version 1.10 and Above" "Tgif" .SH NAME \fItgif\fR \- Xlib based 2-D drawing facility under X11. Also supports --- 1,4 ---- ! .\"@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.man,v 1.11 90/08/16 15:30:15 william Exp $ ! .TH TGIF 1 "Version 1.13 and Above" "Tgif" .SH NAME \fItgif\fR \- Xlib based 2-D drawing facility under X11. Also supports *************** *** 80,89 **** styles (plain, head arrow, tail arrow, double arrows) for polyline and open-splines, 3 types of text justifications, 4 text ! styles (roman, itatlic, bold, bold-italic), 6 text sizes ! (8, 10, 12, 14, 18, 24), 5 fonts (Times, Courier, ! Helvetica, New-Century-Schoolbook, Symbol), and 10 colors (magenta, red, green, blue, yellow, pink, cyan, cadet-blue, white, black). Only right-angle rotations are supported. ! All commands in tgif can either be activated by a pop-up menu or by typing an appropriate non-alphanumeric key. --- 80,90 ---- styles (plain, head arrow, tail arrow, double arrows) for polyline and open-splines, 3 types of text justifications, 4 text ! styles (roman, itatlic, bold, bold-italic), 12 text sizes ! (8, 10, 12, 14, 18, and 24 for the 75dpi fonts and ! 11, 14, 17, 20, 25, and 34 for the 100dpi fonts), 5 fonts (Times, Courier, ! Helvetica, New-Century-Schoolbook, Symbol), and 10 default colors (magenta, red, green, blue, yellow, pink, cyan, cadet-blue, white, black). Only right-angle rotations are supported. ! Most commands in tgif can either be activated by a pop-up menu or by typing an appropriate non-alphanumeric key. *************** *** 175,178 **** --- 176,180 ---- ^W change the drawing mode to text\br ^X delete all selected objects\br + ^Y copy selected object to cut buffer\br ^Z escape to Prolog\br ^, scroll left\br *************** *** 205,214 **** #Y escape to Prolog\br #Z zoom in\br ! #0 change the font size to 8\br ! #1 change the font size to 10\br ! #2 change the font size to 12\br ! #3 change the font size to 14\br ! #4 change the font size to 18\br ! #5 change the font size to 24\br #, scroll up\br #. scroll down\br --- 207,216 ---- #Y escape to Prolog\br #Z zoom in\br ! #0 change the font size to 8 (11)\br ! #1 change the font size to 10 (14)\br ! #2 change the font size to 12 (17)\br ! #3 change the font size to 14 (20)\br ! #4 change the font size to 18 (25)\br ! #5 change the font size to 24 (34)\br #, scroll up\br #. scroll down\br *************** *** 232,235 **** --- 234,238 ---- ^#V change the drawing mode to oval\br ^#W toggle between poly and spline\br + ^#Y paste from the cut buffer\br .DE .br *************** *** 415,419 **** \fBlatex\fR(1L), \fBlpr\fR(1), \fBenv\fR(1), \fBX\fR(1), \fBtgif2ps\fR(1), \fBdvips\fR(1) ! .SH BUGS When any of the ``escape to Prolog'' commands are accidentally executed, just type a return key in the window where tgif is started --- 418,422 ---- \fBlatex\fR(1L), \fBlpr\fR(1), \fBenv\fR(1), \fBX\fR(1), \fBtgif2ps\fR(1), \fBdvips\fR(1) ! .SH IDIOSYNCHRASIES When any of the ``escape to Prolog'' commands are accidentally executed, just type a return key in the window where tgif is started *************** *** 420,423 **** --- 423,435 ---- to resume tgif. .PP + The paste operation works on a cut buffer generated by tgif or by non-tgif + tools (such as \fIxterm\fR). + If the cut buffer is \fInot\fR generated by tgif, its content is treated as + ASCII character strings, which is inserted into the current drawing + as a text object (current settings for text objects are used + to create the text object). + If the cut buffer \fIis\fR generated by tgif, then all the current + settings are ignored. + .SH BUGS The directory where tgif is started is considerd the root directory of the tgif session. The user is not allowed to ---------------------------------> cut here <--------------------------------- -- Bill Cheng // UCLA Computer Science Department // (213) 206-7135 3277 Boelter Hall // Los Angeles, California 90024 // USA william@CS.UCLA.EDU ...!{uunet|ucbvax}!cs.ucla.edu!william