v08i048: tgif 1.9, Patch1, Part03/03
William Cheng
william at CS.UCLA.EDU
Mon Jul 9 17:22:23 AEST 1990
Submitted-by: william at CS.UCLA.EDU (William Cheng)
Posting-number: Volume 8, Issue 48
Archive-name: tgif/patch2.03
Patch-To: tgif: Volume 7, Issue 56-76
Here is part 03 of the patch that takes tgif from version 1.2 to 1.9.
The most recent version is available for anonymous ftp at the following places.
expo.lcs.mit.edu contrib/tgif-1.9.tar.Z
rye.cs.ucla.edu pub/tgif-1.9.tar.Z
--Bill
---------------------------------> cut here <---------------------------------
*** setup.c.orig Wed Jun 27 13:30:39 1990
--- setup.c Wed Jun 27 13:30:41 1990
***************
*** 6,10 ****
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/setup.c,v 1.3 90/05/15 09:33:59 william Exp $";
#endif
--- 6,10 ----
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/setup.c,v 1.8 90/06/26 00:13:09 william Exp $";
#endif
***************
*** 105,110 ****
int objId = 0;
! int myBlackPixel;
! int myWhitePixel;
char drawPath[255];
--- 105,112 ----
int objId = 0;
! int myBgPixel;
! int myFgPixel;
! int myBorderPixel;
! int reverseVideo = FALSE;
char drawPath[255];
***************
*** 206,210 ****
void Setup ()
{
! int num_of_planes, brdr_pixel, bg_pixel, bitmask = 0, index;
char * c_ptr;
Window root_win;
--- 208,212 ----
void Setup ()
{
! int num_of_planes, bitmask = 0, index;
char * c_ptr;
Window root_win;
***************
*** 219,236 ****
InitColor ();
- bg_pixel = myBlackPixel;
-
- if ((c_ptr = XGetDefault (mainDisplay, TOOL_NAME, "BorderColor")) == NULL ||
- XParseColor (mainDisplay, mainColormap, c_ptr, &color) == 0 ||
- XAllocColor (mainDisplay, mainColormap, &color) == 0)
- brdr_pixel = myWhitePixel;
- else
- brdr_pixel = color.pixel;
-
if ((c_ptr = getenv ("TGIFPATH")) == NULL)
! strcpy (drawPath, "/u/tangram/u/william/X11/TGIF");
else
if (strlen (c_ptr) >= 255)
! strcpy (drawPath, "/u/tangram/u/william/X11/TGIF");
else
strcpy (drawPath, c_ptr);
--- 221,229 ----
InitColor ();
if ((c_ptr = getenv ("TGIFPATH")) == NULL)
! strcpy (drawPath, TGIF_PATH);
else
if (strlen (c_ptr) >= 255)
! strcpy (drawPath, TGIF_PATH);
else
strcpy (drawPath, c_ptr);
***************
*** 294,298 ****
if ((mainWindow = XCreateSimpleWindow (mainDisplay, rootWindow,
sizehints.x, sizehints.y, sizehints.width, sizehints.height,
! brdrW, brdr_pixel, bg_pixel)) == 0)
{ printf ("Could not create main window!\n"); exit(1); }
--- 287,291 ----
if ((mainWindow = XCreateSimpleWindow (mainDisplay, rootWindow,
sizehints.x, sizehints.y, sizehints.width, sizehints.height,
! brdrW, myBorderPixel, myBgPixel)) == 0)
{ printf ("Could not create main window!\n"); exit(1); }
***************
*** 310,319 ****
if ((titleWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0, 0,
! titleWindowW, titleWindowH, brdrW, brdr_pixel, bg_pixel)) == 0)
{ printf ("Could not create menu window!\n"); exit(1); }
if ((msgWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
! titleWindowH+2*brdrW, msgWindowW, msgWindowH, brdrW, brdr_pixel,
! bg_pixel)) == 0)
{ printf ("Could not create message window!\n"); exit(1); }
--- 303,312 ----
if ((titleWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0, 0,
! titleWindowW, titleWindowH, brdrW, myBorderPixel, myBgPixel)) == 0)
{ printf ("Could not create menu window!\n"); exit(1); }
if ((msgWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
! titleWindowH+2*brdrW, msgWindowW, msgWindowH, brdrW, myBorderPixel,
! myBgPixel)) == 0)
{ printf ("Could not create message window!\n"); exit(1); }
***************
*** 320,324 ****
if ((choiceWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
msgWindowW+2*brdrW, titleWindowH+2*brdrW, choiceWindowW, choiceWindowH,
! brdrW, brdr_pixel, bg_pixel)) == 0)
{ printf ("Could not create choice window!\n"); exit(1); }
--- 313,317 ----
if ((choiceWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
msgWindowW+2*brdrW, titleWindowH+2*brdrW, choiceWindowW, choiceWindowH,
! brdrW, myBorderPixel, myBgPixel)) == 0)
{ printf ("Could not create choice window!\n"); exit(1); }
***************
*** 327,331 ****
if ((hRuleWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
rulerW+2*brdrW, titleWindowH+choiceWindowH+4*brdrW, drawWinW, rulerW,
! brdrW, brdr_pixel, bg_pixel)) == 0)
{ printf ("Could not create horizontal ruler window!\n"); exit(1); }
--- 320,324 ----
if ((hRuleWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
rulerW+2*brdrW, titleWindowH+choiceWindowH+4*brdrW, drawWinW, rulerW,
! brdrW, myBorderPixel, myBgPixel)) == 0)
{ printf ("Could not create horizontal ruler window!\n"); exit(1); }
***************
*** 332,336 ****
if ((vRuleWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
titleWindowH+rulerW+choiceWindowH+6*brdrW, rulerW, drawWinH,
! brdrW, brdr_pixel, bg_pixel)) == 0)
{ printf ("Could not create vertical ruler window!\n"); exit(1); }
--- 325,329 ----
if ((vRuleWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
titleWindowH+rulerW+choiceWindowH+6*brdrW, rulerW, drawWinH,
! brdrW, myBorderPixel, myBgPixel)) == 0)
{ printf ("Could not create vertical ruler window!\n"); exit(1); }
***************
*** 337,341 ****
if ((drawWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
rulerW+2*brdrW, titleWindowH+rulerW+choiceWindowH+6*brdrW,
! drawWinW, drawWinH, brdrW, brdr_pixel, bg_pixel)) == 0)
{ printf ("Could not create draw window!\n"); exit(1); }
--- 330,334 ----
if ((drawWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
rulerW+2*brdrW, titleWindowH+rulerW+choiceWindowH+6*brdrW,
! drawWinW, drawWinH, brdrW, myBorderPixel, myBgPixel)) == 0)
{ printf ("Could not create draw window!\n"); exit(1); }
***************
*** 342,346 ****
if ((vSBarWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
4*brdrW+rulerW+drawWinW, titleWindowH+choiceWindowH+4*brdrW,
! scrollBarW, vSBarH, brdrW, brdr_pixel, bg_pixel)) == 0)
{ printf ("Could not create vertical scrollbar window!\n"); exit(1); }
--- 335,339 ----
if ((vSBarWindow = XCreateSimpleWindow (mainDisplay, mainWindow,
4*brdrW+rulerW+drawWinW, titleWindowH+choiceWindowH+4*brdrW,
! scrollBarW, vSBarH, brdrW, myBorderPixel, myBgPixel)) == 0)
{ printf ("Could not create vertical scrollbar window!\n"); exit(1); }
***************
*** 347,351 ****
if ((hSBarWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
titleWindowH+rulerW+drawWinH+choiceWindowH+8*brdrW,
! hSBarW, scrollBarW, brdrW, brdr_pixel, bg_pixel)) == 0)
{ printf ("Could not create horizontal scrollbar window!\n"); exit(1); }
--- 340,344 ----
if ((hSBarWindow = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
titleWindowH+rulerW+drawWinH+choiceWindowH+8*brdrW,
! hSBarW, scrollBarW, brdrW, myBorderPixel, myBgPixel)) == 0)
{ printf ("Could not create horizontal scrollbar window!\n"); exit(1); }
***************
*** 353,357 ****
rulerW+drawWinW+4*brdrW,
titleWindowH+choiceWindowH+rulerW+drawWinH+8*brdrW,
! scrollBarW, scrollBarW, brdrW, brdr_pixel, bg_pixel)) == 0)
{ printf ("Could not create dummy window!\n"); exit(1); }
--- 346,350 ----
rulerW+drawWinW+4*brdrW,
titleWindowH+choiceWindowH+rulerW+drawWinH+8*brdrW,
! scrollBarW, scrollBarW, brdrW, myBorderPixel, myBgPixel)) == 0)
{ printf ("Could not create dummy window!\n"); exit(1); }
***************
*** 358,362 ****
if ((dummyWindow2 = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
titleWindowH+choiceWindowH+4*brdrW, rulerW, rulerW,
! brdrW, brdr_pixel, bg_pixel)) == 0)
{ printf ("Could not create dummy window!\n"); exit(1); }
--- 351,355 ----
if ((dummyWindow2 = XCreateSimpleWindow (mainDisplay, mainWindow, 0,
titleWindowH+choiceWindowH+4*brdrW, rulerW, rulerW,
! brdrW, myBorderPixel, myBgPixel)) == 0)
{ printf ("Could not create dummy window!\n"); exit(1); }
***************
*** 406,408 ****
--- 399,411 ----
if (curChoice == DRAWTEXT) return (CreateTextObj ());
return (FALSE);
+ }
+
+ void SetFileModified (modified)
+ int modified;
+ {
+ if (modified != fileModified)
+ {
+ fileModified = modified;
+ RedrawTitleWindow ();
+ }
}
*** special.c.orig Wed Jun 27 13:30:53 1990
--- special.c Wed Jun 27 13:30:55 1990
***************
*** 6,10 ****
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/special.c,v 1.1 90/04/01 22:16:42 william Exp $";
#endif
--- 6,10 ----
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/special.c,v 1.4 90/06/26 13:05:00 william Exp $";
#endif
***************
*** 74,81 ****
struct ObjRec * obj_ptr;
struct AttrRec * attr_ptr, * top_attr = NULL, * bot_attr = NULL;
! char inbuf[255], obj_name[10];
int len;
! while (fgets (inbuf, 255, FP) != NULL)
{
len = strlen (inbuf) - 1;
--- 74,81 ----
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)
{
len = strlen (inbuf) - 1;
***************
*** 185,189 ****
void Instantiate ()
{
! char file_name[80], sym_name[80], full_name[MAXPATHLENGTH];
struct ObjRec * obj_ptr;
FILE * fp;
--- 185,189 ----
void Instantiate ()
{
! char file_name[MAXPATHLENGTH], sym_name[MAXPATHLENGTH], full_name[MAXPATHLENGTH];
struct ObjRec * obj_ptr;
FILE * fp;
***************
*** 220,224 ****
if (topObj != NULL) SelectTopObj ();
ShowCursor ();
! fileModified = TRUE;
justDupped = FALSE;
}
--- 220,224 ----
if (topObj != NULL) SelectTopObj ();
ShowCursor ();
! SetFileModified (TRUE);
justDupped = FALSE;
}
***************
*** 234,238 ****
topSel->obj->type = OBJ_SYM;
Msg ("Selected GROUP object is now SYMBOLIC.");
! fileModified = TRUE;
AdjObjBBox (topSel->obj);
UpdSelBBox ();
--- 234,238 ----
topSel->obj->type = OBJ_SYM;
Msg ("Selected GROUP object is now SYMBOLIC.");
! SetFileModified (TRUE);
AdjObjBBox (topSel->obj);
UpdSelBBox ();
***************
*** 280,284 ****
{
HighLightReverse ();
! fileModified = TRUE;
UpdSelBBox ();
RedrawAnArea (botObj,
--- 280,284 ----
{
HighLightReverse ();
! SetFileModified (TRUE);
UpdSelBBox ();
RedrawAnArea (botObj,
***************
*** 291,297 ****
void MakeIconic ()
{
! char icon_name[80], file_name[80], s[255];
FILE * fp;
struct ObjRec * saved_obj_ptr;
if (topSel!=NULL && topSel==botSel && topSel->obj->type==OBJ_GROUP)
--- 291,299 ----
void MakeIconic ()
{
! char icon_name[MAXPATHLENGTH], file_name[MAXPATHLENGTH];
! char s[MAXPATHLENGTH];
FILE * fp;
struct ObjRec * saved_obj_ptr;
+ int len;
if (topSel!=NULL && topSel==botSel && topSel->obj->type==OBJ_GROUP)
***************
*** 298,301 ****
--- 300,304 ----
{
Dialog ("Please Enter Name of the Icon:", icon_name);
+ len = strlen (icon_name);
if (*icon_name == '\0')
{
***************
*** 303,310 ****
return;
}
if (*curDomainName != '\0')
! sprintf (file_name, "%s/%s.sym", curDomainName, icon_name);
else
! sprintf (file_name, "%s.sym", icon_name);
if (!OkayToCreateFile (file_name)) return;
if ((fp = fopen (file_name, "w")) == NULL)
--- 306,333 ----
return;
}
+
+ if (strlen (icon_name) >= 4)
+ {
+ if (strcmp (&icon_name[len-4], ".obj") == 0)
+ {
+ Msg ("Can not save as a .obj file, icon not created.");
+ return;
+ }
+ else if (strcmp (&icon_name[len-4], ".sym") != 0)
+ strcat (icon_name, ".sym");
+
+ if (strlen (icon_name) == 4)
+ {
+ Msg ("No file name specified. File not saved.");
+ return;
+ }
+ }
+ else
+ strcat (icon_name, ".sym");
+
if (*curDomainName != '\0')
! sprintf (file_name, "%s/%s", curDomainName, icon_name);
else
! sprintf (file_name, "%s", icon_name);
if (!OkayToCreateFile (file_name)) return;
if ((fp = fopen (file_name, "w")) == NULL)
***************
*** 332,336 ****
topSel->obj->detail.r->id = objId++;
Msg ("Selected GROUP object is now ICONIC.");
! fileModified = TRUE;
AdjObjBBox (topSel->obj);
UpdSelBBox ();
--- 355,359 ----
topSel->obj->detail.r->id = objId++;
Msg ("Selected GROUP object is now ICONIC.");
! SetFileModified (TRUE);
AdjObjBBox (topSel->obj);
UpdSelBBox ();
***************
*** 366,370 ****
{
Msg ("Selected ICONIC objects are GROUP objects now.");
! fileModified = TRUE;
UpdSelBBox ();
RedrawAnArea (botObj, selLtX-(1<<zoomScale), selLtY-(1<<zoomScale),
--- 389,393 ----
{
Msg ("Selected ICONIC objects are GROUP objects now.");
! SetFileModified (TRUE);
UpdSelBBox ();
RedrawAnArea (botObj, selLtX-(1<<zoomScale), selLtY-(1<<zoomScale),
***************
*** 378,382 ****
{
register int index;
- char s[80];
int * fore_colors, * valid;
--- 401,404 ----
*** spline.c.orig Wed Jun 27 13:31:02 1990
--- spline.c Wed Jun 27 13:31:04 1990
***************
*** 6,10 ****
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/spline.c,v 1.1 90/04/30 10:36:03 william Exp $";
#endif
--- 6,10 ----
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/spline.c,v 1.2 90/05/22 14:38:02 william Exp $";
#endif
***************
*** 181,185 ****
{
sv[sn].x = sv[0].x; sv[sn].y = sv[0].y;
! values.foreground = (Fill == 2) ? myBlackPixel : Pixel;
values.function = GXcopy;
values.fill_style = FillOpaqueStippled;
--- 181,185 ----
{
sv[sn].x = sv[0].x; sv[sn].y = sv[0].y;
! values.foreground = (Fill == 2) ? myBgPixel : Pixel;
values.function = GXcopy;
values.fill_style = FillOpaqueStippled;
***************
*** 194,198 ****
if (Pen != 0)
{
! values.foreground = (Pen == 2) ? myBlackPixel : Pixel;
values.function = GXcopy;
values.fill_style = FillOpaqueStippled;
--- 194,198 ----
if (Pen != 0)
{
! values.foreground = (Pen == 2) ? myBgPixel : Pixel;
values.function = GXcopy;
values.fill_style = FillOpaqueStippled;
***************
*** 292,296 ****
if (Fill != 0)
{
! values.foreground = (Fill == 2) ? myBlackPixel : Pixel;
values.function = GXcopy;
values.fill_style = FillOpaqueStippled;
--- 292,296 ----
if (Fill != 0)
{
! values.foreground = (Fill == 2) ? myBgPixel : Pixel;
values.function = GXcopy;
values.fill_style = FillOpaqueStippled;
***************
*** 303,307 ****
if (Pen != 0)
{
! values.foreground = (Pen == 2) ? myBlackPixel : Pixel;
values.function = GXcopy;
values.fill_style = FillOpaqueStippled;
--- 303,307 ----
if (Pen != 0)
{
! values.foreground = (Pen == 2) ? myBgPixel : Pixel;
values.function = GXcopy;
values.fill_style = FillOpaqueStippled;
*** stk.c.orig Wed Jun 27 13:31:12 1990
--- stk.c Wed Jun 27 13:31:13 1990
***************
*** 6,10 ****
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stk.c,v 1.1 90/04/01 22:16:44 william Exp $";
#endif
--- 6,10 ----
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stk.c,v 1.3 90/06/26 00:11:30 william Exp $";
#endif
***************
*** 49,53 ****
struct StkRec * stk_ptr;
struct ObjRec * obj_ptr;
! char file_name[80], s[80], full_name[MAXPATHLENGTH];
FILE * fp;
--- 49,54 ----
struct StkRec * stk_ptr;
struct ObjRec * obj_ptr;
! char file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
! char full_name[MAXPATHLENGTH];
FILE * fp;
***************
*** 128,132 ****
curFileDefined = TRUE;
! fileModified = FALSE;
sprintf (s, "Current file is '%s'.", file_name);
Msg (s);
--- 129,133 ----
curFileDefined = TRUE;
! SetFileModified (FALSE);
sprintf (s, "Current file is '%s'.", file_name);
Msg (s);
***************
*** 137,141 ****
void PopIcon ()
{
! char dummy[80];
if (topStk == NULL)
--- 138,142 ----
void PopIcon ()
{
! char dummy[MAXPATHLENGTH];
if (topStk == NULL)
*** stretch.c.orig Wed Jun 27 13:31:29 1990
--- stretch.c Wed Jun 27 13:31:33 1990
***************
*** 6,10 ****
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stretch.c,v 1.1 90/04/01 22:16:45 william Exp $";
#endif
--- 6,10 ----
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/stretch.c,v 1.4 90/06/26 00:11:32 william Exp $";
#endif
***************
*** 173,181 ****
int x, y, dx, dy, num, pixel, stretching = TRUE;
int ltx, lty, rbx, rby, curved;
! int grid_x = XGridOff, grid_y = YGridOff, new_grid_x, new_grid_y;
! Window root_win, child_win;
! int root_x, root_y;
! unsigned int status;
! XGCValues values;
switch (ObjPtr->type)
--- 173,178 ----
int x, y, dx, dy, num, pixel, stretching = TRUE;
int ltx, lty, rbx, rby, curved;
! int grid_x = XGridOff, grid_y = YGridOff;
! XEvent input;
switch (ObjPtr->type)
***************
*** 230,260 ****
rby = ObjPtr->bbox.rby;
! XGrabPointer (mainDisplay, drawWindow, FALSE, ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, None, handCursor, CurrentTime);
! if (curved == LT_SPLINE) MyDashedLine (drawWindow, revDefaultGC, v, num);
dx = dy = 0;
while (stretching)
{
! XQueryPointer (mainDisplay, drawWindow, &root_win, &child_win,
! &root_x, &root_y, &x, &y, &status);
! GridXY (x, y, &new_grid_x, &new_grid_y);
!
! if (new_grid_x==grid_x && new_grid_y==grid_y && (status & Button1Mask)!=0)
! continue;
!
! grid_x = new_grid_x; grid_y = new_grid_y;
!
! MyDashedLine (drawWindow, revDefaultGC, v, num);
! dx = grid_x - XGridOff;
! dy = grid_y - YGridOff;
! v[1].x = OFFSET_X(V[Index].x) + dx;
! v[1].y = OFFSET_Y(V[Index].y) + dy;
! MarkRulers (grid_x, grid_y);
!
! if ((status & Button1Mask) == 0)
{
XUngrabPointer (mainDisplay, CurrentTime);
stretching = FALSE;
HighLightReverse ();
--- 227,245 ----
rby = ObjPtr->bbox.rby;
! XGrabPointer (mainDisplay, drawWindow, FALSE,
! PointerMotionMask | ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, None, handCursor, CurrentTime);
! MyDashedLine (drawWindow, revDefaultGC, v, num);
dx = dy = 0;
while (stretching)
{
! XNextEvent (mainDisplay, &input);
! if (input.type == ButtonRelease)
{
XUngrabPointer (mainDisplay, CurrentTime);
stretching = FALSE;
+
+ MyDashedLine (drawWindow, revDefaultGC, v, num);
HighLightReverse ();
***************
*** 303,315 ****
ObjPtr->bbox.rbx+(1<<zoomScale),
ObjPtr->bbox.rby+(1<<zoomScale));
! fileModified = TRUE;
}
- else
- MyDashedLine (drawWindow, revDefaultGC, v, num);
-
HighLightForward ();
}
! else
MyDashedLine (drawWindow, revDefaultGC, v, num);
}
}
--- 288,311 ----
ObjPtr->bbox.rbx+(1<<zoomScale),
ObjPtr->bbox.rby+(1<<zoomScale));
! SetFileModified (TRUE);
}
HighLightForward ();
}
! else if (input.type == MotionNotify)
! {
! x = input.xmotion.x;
! y = input.xmotion.y;
! GridXY (x, y, &grid_x, &grid_y);
!
MyDashedLine (drawWindow, revDefaultGC, v, num);
+
+ dx = grid_x - XGridOff;
+ dy = grid_y - YGridOff;
+ v[1].x = OFFSET_X(V[Index].x) + dx;
+ v[1].y = OFFSET_Y(V[Index].y) + dy;
+ MarkRulers (grid_x, grid_y);
+
+ MyDashedLine (drawWindow, revDefaultGC, v, num);
+ }
}
}
***************
*** 516,525 ****
int stretched_sel_ltx, stretched_sel_lty, stretched_sel_rbx;
int stretched_sel_rby;
- Window root_win, child_win;
- int root_x, root_y;
- unsigned int status;
double obj_w, obj_h;
! int grid_x = XGridOff, grid_y = YGridOff, new_grid_x, new_grid_y;
! XGCValues values;
SetPivot (Corner, ObjPtr->obbox);
--- 512,518 ----
int stretched_sel_ltx, stretched_sel_lty, stretched_sel_rbx;
int stretched_sel_rby;
double obj_w, obj_h;
! int grid_x = XGridOff, grid_y = YGridOff;
! XEvent input;
SetPivot (Corner, ObjPtr->obbox);
***************
*** 542,546 ****
obj_h = (double)(moveY - pivotY);
! XGrabPointer (mainDisplay, drawWindow, FALSE, ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, None, handCursor, CurrentTime);
--- 535,540 ----
obj_h = (double)(moveY - pivotY);
! XGrabPointer (mainDisplay, drawWindow, FALSE,
! PointerMotionMask | ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, None, handCursor, CurrentTime);
***************
*** 547,579 ****
while (stretching)
{
! XQueryPointer (mainDisplay, drawWindow, &root_win, &child_win,
! &root_x, &root_y, &x, &y, &status);
! GridXY (x, y, &new_grid_x, &new_grid_y);
!
! if (new_grid_x==grid_x && new_grid_y==grid_y && (status & Button1Mask)!=0)
! continue;
!
! grid_x = new_grid_x; grid_y = new_grid_y;
!
! MarkRulers (grid_x, grid_y);
!
! SelBox (drawWindow, revDefaultGC, stretched_ltx, stretched_lty,
! stretched_rbx, stretched_rby);
! SelBox (drawWindow, revDefaultGC, stretched_sel_ltx-1,
! stretched_sel_lty-1, stretched_sel_rbx+1, stretched_sel_rby+1);
!
! if (changeX)
! multX = (double)(moveX + grid_x - XGridOff - pivotX) / obj_w;
! else
! multX = (double)1.0;
! if (changeY)
! multY = (double)(moveY + grid_y - YGridOff - pivotY) / obj_h;
! else
! multY = (double)1.0;
!
! if ((status & Button1Mask) == 0)
{
XUngrabPointer (mainDisplay, CurrentTime);
stretching = FALSE;
if (multX != (double)1.0 || multY != (double)1.0)
{
--- 541,555 ----
while (stretching)
{
! XNextEvent (mainDisplay, &input);
! if (input.type == ButtonRelease)
{
XUngrabPointer (mainDisplay, CurrentTime);
stretching = FALSE;
+
+ SelBox (drawWindow, revDefaultGC, stretched_ltx, stretched_lty,
+ stretched_rbx, stretched_rby);
+ SelBox (drawWindow, revDefaultGC, stretched_sel_ltx-1,
+ stretched_sel_lty-1, stretched_sel_rbx+1, stretched_sel_rby+1);
+
if (multX != (double)1.0 || multY != (double)1.0)
{
***************
*** 590,598 ****
HighLightForward ();
UpdSelBBox ();
! fileModified = TRUE;
}
}
! else
{
StretchedXY (sel_ltx, sel_lty, &stretched_sel_ltx, &stretched_sel_lty);
StretchedXY (sel_rbx, sel_rby, &stretched_sel_rbx, &stretched_sel_rby);
--- 566,593 ----
HighLightForward ();
UpdSelBBox ();
! SetFileModified (TRUE);
}
}
! else if (input.type == MotionNotify)
{
+ x = input.xmotion.x;
+ y = input.xmotion.y;
+ GridXY (x, y, &grid_x, &grid_y);
+ MarkRulers (grid_x, grid_y);
+
+ SelBox (drawWindow, revDefaultGC, stretched_ltx, stretched_lty,
+ stretched_rbx, stretched_rby);
+ SelBox (drawWindow, revDefaultGC, stretched_sel_ltx-1,
+ stretched_sel_lty-1, stretched_sel_rbx+1, stretched_sel_rby+1);
+
+ if (changeX)
+ multX = (double)(moveX + grid_x - XGridOff - pivotX) / obj_w;
+ else
+ multX = (double)1.0;
+ if (changeY)
+ multY = (double)(moveY + grid_y - YGridOff - pivotY) / obj_h;
+ else
+ multY = (double)1.0;
+
StretchedXY (sel_ltx, sel_lty, &stretched_sel_ltx, &stretched_sel_lty);
StretchedXY (sel_rbx, sel_rby, &stretched_sel_rbx, &stretched_sel_rby);
***************
*** 643,647 ****
struct AttrRec * attr_ptr;
! fileModified = TRUE;
two_x_pivot = selObjLtX + selObjRbX;
new_obj_ltx = two_x_pivot - ObjPtr->obbox.rbx;
--- 638,642 ----
struct AttrRec * attr_ptr;
! SetFileModified (TRUE);
two_x_pivot = selObjLtX + selObjRbX;
new_obj_ltx = two_x_pivot - ObjPtr->obbox.rbx;
***************
*** 734,738 ****
struct AttrRec * attr_ptr;
! fileModified = TRUE;
two_x_pivot = selObjLtY + selObjRbY;
new_obj_lty = two_x_pivot - ObjPtr->obbox.rby;
--- 729,733 ----
struct AttrRec * attr_ptr;
! SetFileModified (TRUE);
two_x_pivot = selObjLtY + selObjRbY;
new_obj_lty = two_x_pivot - ObjPtr->obbox.rby;
***************
*** 851,855 ****
struct AttrRec * attr_ptr;
! fileModified = TRUE;
switch (ObjPtr->type)
{
--- 846,850 ----
struct AttrRec * attr_ptr;
! SetFileModified (TRUE);
switch (ObjPtr->type)
{
***************
*** 957,961 ****
struct AttrRec * attr_ptr;
! fileModified = TRUE;
switch (ObjPtr->type)
{
--- 952,956 ----
struct AttrRec * attr_ptr;
! SetFileModified (TRUE);
switch (ObjPtr->type)
{
*** text.c.orig Wed Jun 27 13:32:29 1990
--- text.c Wed Jun 27 13:32:33 1990
***************
*** 6,10 ****
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/text.c,v 1.1 90/04/01 22:16:47 william Exp $";
#endif
--- 6,10 ----
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/text.c,v 1.6 90/06/26 00:11:37 william Exp $";
#endif
***************
*** 265,274 ****
}
! XSetFont (mainDisplay, defaultGC, canvasFontPtr->fid);
! XDrawImageString (mainDisplay, textBackingPixmap, defaultGC, 0,
canvasFontAsc, Str, len);
from_image = XGetImage (mainDisplay, textBackingPixmap, 0, 0, w, h, 1,
XYPixmap);
- XSetFont (mainDisplay, defaultGC, defaultFontPtr->fid);
values.foreground = colorPixels[ColorIndex];
--- 265,273 ----
}
! XSetFont (mainDisplay, revDefaultGC, canvasFontPtr->fid);
! XDrawImageString (mainDisplay, textBackingPixmap, revDefaultGC, 0,
canvasFontAsc, Str, len);
from_image = XGetImage (mainDisplay, textBackingPixmap, 0, 0, w, h, 1,
XYPixmap);
values.foreground = colorPixels[ColorIndex];
***************
*** 282,286 ****
for (i = 0; i < w; i++)
for (j = 0; j < h; j++)
! if (XGetPixel (from_image, i, j) == myWhitePixel)
switch (Rotate)
{
--- 281,285 ----
for (i = 0; i < w; i++)
for (j = 0; j < h; j++)
! if (XGetPixel (from_image, i, j) == 1)
switch (Rotate)
{
***************
*** 287,291 ****
case ROTATE90:
/* XDrawPoint (mainDisplay, Win, gc, XOff-j, YOff+i); */
! /* Hack to run on RTs -- stupid IBM */
XDrawLine (mainDisplay, Win, gc, XOff-j, YOff+i,
XOff-j, YOff+i);
--- 286,290 ----
case ROTATE90:
/* XDrawPoint (mainDisplay, Win, gc, XOff-j, YOff+i); */
! /* Hack to run on RTs -- crash server on RTs */
XDrawLine (mainDisplay, Win, gc, XOff-j, YOff+i,
XOff-j, YOff+i);
***************
*** 293,297 ****
case ROTATE180:
/* XDrawPoint (mainDisplay, Win, gc, XOff-i, YOff-j); */
! /* Hack to run on RTs -- stupid IBM */
XDrawLine (mainDisplay, Win, gc, XOff-i, YOff-j,
XOff-i, YOff-j);
--- 292,296 ----
case ROTATE180:
/* XDrawPoint (mainDisplay, Win, gc, XOff-i, YOff-j); */
! /* Hack to run on RTs -- crash server on RTs */
XDrawLine (mainDisplay, Win, gc, XOff-i, YOff-j,
XOff-i, YOff-j);
***************
*** 299,303 ****
case ROTATE270:
/* XDrawPoint (mainDisplay, Win, gc, XOff+j, YOff-i); */
! /* Hack to run on RTs -- stupid IBM */
XDrawLine (mainDisplay, Win, gc, XOff+j, YOff-i,
XOff+j, YOff-i);
--- 298,302 ----
case ROTATE270:
/* XDrawPoint (mainDisplay, Win, gc, XOff+j, YOff-i); */
! /* Hack to run on RTs -- crash server on RTs */
XDrawLine (mainDisplay, Win, gc, XOff+j, YOff-i,
XOff+j, YOff-i);
***************
*** 309,313 ****
else
{
! values.foreground = myBlackPixel;
values.function = GXcopy;
values.fill_style = FillSolid;
--- 308,312 ----
else
{
! values.foreground = myBgPixel;
values.function = GXcopy;
values.fill_style = FillSolid;
***************
*** 328,334 ****
--- 327,335 ----
void EraseTextCursor ()
{
+ XSetForeground (mainDisplay, revDefaultGC, myFgPixel^myBgPixel);
XDrawLine (mainDisplay, drawWindow, revDefaultGC, textCurX>>zoomScale,
textCurY>>zoomScale, textCurX>>zoomScale,
(textCurY+textCursorH)>>zoomScale);
+ XSetForeground (mainDisplay, revDefaultGC, 1);
}
***************
*** 728,732 ****
{
register int left, w;
! char s[256];
strcpy (s, curStr->s);
--- 729,733 ----
{
register int left, w;
! char s[MAXSTRING+1];
strcpy (s, curStr->s);
***************
*** 745,776 ****
static
- int DrawAttrAndName (AttrPtr)
- struct AttrRec * AttrPtr;
- {
- struct TextRec * text_ptr;
- struct BBRec old_bbox, new_bbox;
- int offset = 0;
-
- if (AttrPtr->nameshown != TRUE)
- {
- text_ptr = AttrPtr->obj->detail.t;
- strcpy (text_ptr->first->s, AttrPtr->name);
- strcat (text_ptr->first->s, AttrPtr->s);
- offset = XTextWidth (canvasFontPtr, text_ptr->first->s,
- strlen (text_ptr->first->s));
-
- old_bbox = AttrPtr->obj->bbox;
- UpdTextBBox (AttrPtr->obj);
- new_bbox = AttrPtr->obj->bbox;
- RedrawAreas (botObj,
- old_bbox.ltx-(1<<zoomScale), old_bbox.lty-(1<<zoomScale),
- old_bbox.rbx+(1<<zoomScale), old_bbox.rby+(1<<zoomScale),
- new_bbox.ltx-(1<<zoomScale), new_bbox.lty-(1<<zoomScale),
- new_bbox.rbx+(1<<zoomScale), new_bbox.rby+(1<<zoomScale));
- }
- return (offset);
- }
-
- static
void HandleButton (Button_Ev)
XButtonEvent * Button_Ev;
--- 746,749 ----
***************
*** 1077,1082 ****
struct StrRec * s_ptr, * s_ptr1, * new_cur_str;
int highlighting = FALSE, new_cur_index, second_index, len;
! int i, y, new_cur_y;
! char * s;
if (!textHighlight) return;
--- 1050,1055 ----
struct StrRec * s_ptr, * s_ptr1, * new_cur_str;
int highlighting = FALSE, new_cur_index, second_index, len;
! int i, y, new_cur_y, len1, len2;
! char * s, msg[80];
if (!textHighlight) return;
***************
*** 1090,1093 ****
--- 1063,1075 ----
{
second_index = (s_ptr == curStr) ? textCurIndex : textEndIndex;
+ len1 = strlen (new_cur_str->s);
+ len2 = strlen (&(s_ptr->s[second_index]));
+ if (len1+len2 >= MAXSTRING)
+ {
+ sprintf (msg, "String length exceeds %1d. String truncated.",
+ MAXSTRING);
+ Msg (msg);
+ s_ptr->s[MAXSTRING-len1+second_index] = '\0';
+ }
strcat (new_cur_str->s, &(s_ptr->s[second_index]));
if (s_ptr == lastStr)
***************
*** 1167,1174 ****
AddStr (curStr, curStr->next, str_ptr);
curStr = str_ptr;
- textCurX = textOrigX;
textCurY += textCursorH;
textCurIndex = 0;
curStrW = XTextWidth (canvasFontPtr, curStr->s, strlen (curStr->s));
i = textCursorH * NumLines ();
if (i > textH)
--- 1149,1156 ----
AddStr (curStr, curStr->next, str_ptr);
curStr = str_ptr;
textCurY += textCursorH;
textCurIndex = 0;
curStrW = XTextWidth (canvasFontPtr, curStr->s, strlen (curStr->s));
+ SetTextCurX ();
i = textCursorH * NumLines ();
if (i > textH)
***************
*** 1200,1203 ****
--- 1182,1187 ----
struct StrRec * str_ptr;
struct AttrRec * attr_ptr;
+ int len1, len2;
+ char msg[80];
if (textHighlight)
***************
*** 1249,1252 ****
--- 1233,1245 ----
curStr->prev->next = curStr->next;
textCurIndex = strlen (curStr->prev->s);
+ len1 = strlen (curStr->prev->s);
+ len2 = strlen (curStr->s);
+ if (len1+len2 >= MAXSTRING)
+ {
+ sprintf (msg, "String length exceeds %1d. String truncated.",
+ MAXSTRING);
+ Msg (msg);
+ curStr->s[MAXSTRING-len1] = '\0';
+ }
strcat (curStr->prev->s, curStr->s);
cfree (curStr);
***************
*** 1283,1289 ****
--- 1276,1293 ----
register int amount;
int need_redraw;
+ char msg[80];
+ XEvent ev;
if (need_redraw = textHighlight) DeleteHighlightedText ();
+ if (textCurIndex+strlen (&(curStr->s[textCurIndex])) >= MAXSTRING)
+ {
+ sprintf (msg, "String length exceeds %1d. Character ignored.",MAXSTRING);
+ Msg (msg);
+ RedrawCurText ();
+ while (XCheckWindowEvent (mainDisplay, drawWindow, KeyPressMask, &ev)) ;
+ return;
+ }
+
amount = XTextWidth (canvasFontPtr, Str, 1);
***************
*** 1356,1360 ****
PutTextCursor ();
MarkRulers (textCurX>>zoomScale, textCurY>>zoomScale);
! fileModified = TRUE;
}
}
--- 1360,1364 ----
PutTextCursor ();
MarkRulers (textCurX>>zoomScale, textCurY>>zoomScale);
! SetFileModified (TRUE);
}
}
***************
*** 1681,1685 ****
struct StrRec * s_ptr;
struct TextRec * text_ptr;
! char color_str[20], * s, tmp_str[80], inbuf[255];
int num_lines, x, y, font, style, size;
int text_just, rotate, pen;
--- 1685,1690 ----
struct StrRec * s_ptr;
struct TextRec * text_ptr;
! char color_str[80], * s;
! char tmp_str[MAXSTRING+1], inbuf[MAXSTRING+1];
int num_lines, x, y, font, style, size;
int text_just, rotate, pen;
***************
*** 1715,1719 ****
for (i = 0; i < num_lines; i++)
{
! fgets (inbuf, 255, FP);
strcpy(tmp_str, FindChar ('"', inbuf));
s = ReadString (tmp_str);
--- 1720,1724 ----
for (i = 0; i < num_lines; i++)
{
! fgets (inbuf, MAXSTRING, FP);
strcpy(tmp_str, FindChar ('"', inbuf));
s = ReadString (tmp_str);
***************
*** 1805,1809 ****
{
register char * s = ObjPtr->detail.t->first->s, * s1 = Str;
! char tmp_str[80], * c_ptr;
int len;
struct BBRec bbox;
--- 1810,1814 ----
{
register char * s = ObjPtr->detail.t->first->s, * s1 = Str;
! char tmp_str[MAXSTRING+1], * c_ptr;
int len;
struct BBRec bbox;
***************
*** 1830,1834 ****
if (*s != '\0')
{
! values.foreground = myBlackPixel;
values.function = GXcopy;
values.fill_style = FillSolid;
--- 1835,1839 ----
if (*s != '\0')
{
! values.foreground = myBgPixel;
values.function = GXcopy;
values.fill_style = FillSolid;
*** tgif2ps.c.orig Wed Jun 27 13:32:59 1990
--- tgif2ps.c Wed Jun 27 13:33:00 1990
***************
*** 6,10 ****
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif2ps.c,v 1.1 90/04/04 22:59:59 william Exp $";
#endif
--- 6,10 ----
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif2ps.c,v 1.4 90/06/05 09:31:14 william Exp $";
#endif
***************
*** 25,28 ****
--- 25,29 ----
exit (-1);
}
+ printf ("%%!\n");
}
***************
*** 79,83 ****
}
else if (strcmp (inbuf, "72 0.4 mul 72 -0.6 mul translate\n") == 0)
! { /* landscape format */
/* printf ("72 3.5 mul 72 -0.6 mul translate\n"); */
if (fgets (inbuf, 255, stdin) == NULL)
--- 80,84 ----
}
else if (strcmp (inbuf, "72 0.4 mul 72 -0.6 mul translate\n") == 0)
! { /* landscape or slide-landscape format */
/* printf ("72 3.5 mul 72 -0.6 mul translate\n"); */
if (fgets (inbuf, 255, stdin) == NULL)
***************
*** 88,95 ****
if (strcmp (inbuf, "0.565 -0.565 scale\n") != 0)
{
! fprintf (stderr, "ERROR: '0.565 -0.565 scale' not found.\n");
! exit (-1);
}
! printf ("0.565 -0.565 scale\n");
}
else if (strcmp (inbuf, "72 0.2 mul 72 -0.3 mul translate\n") == 0)
--- 89,102 ----
if (strcmp (inbuf, "0.565 -0.565 scale\n") != 0)
{
! if (strcmp (inbuf, "1.13 -1.13 scale\n") != 0)
! {
! fprintf (stderr, "ERROR: neither '0.565 -0.565 scale' nor ");
! fprintf (stderr, "'1.13 -1.13 scale' is found.\n");
! exit (-1);
! }
! printf ("1.13 -1.13 scale\n");
}
! else
! printf ("0.565 -0.565 scale\n");
}
else if (strcmp (inbuf, "72 0.2 mul 72 -0.3 mul translate\n") == 0)
***************
*** 107,125 ****
}
printf ("0.28 -0.28 scale\n");
- }
- else if (strcmp (inbuf, "72 0.4 mul 72 -0.6 mul translate\n") == 0)
- { /* slide-landscape format */
- /* printf ("72 3.5 mul 72 -0.6 mul translate\n"); */
- if (fgets (inbuf, 255, stdin) == NULL)
- {
- fprintf (stderr, "ERROR: Incomplete file.\n");
- exit (-1);
- }
- if (strcmp (inbuf, "1.13 -1.13 scale\n") != 0)
- {
- fprintf (stderr, "ERROR: '1.13 -1.13 scale' not found.\n");
- exit (-1);
- }
- printf ("1.13 -1.13 scale\n");
}
else if (strcmp (inbuf, "showpage\n") == 0)
--- 114,117 ----
*** version.c.orig Wed Jun 27 13:33:08 1990
--- version.c Wed Jun 27 13:33:09 1990
***************
*** 6,11 ****
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/version.c,v 1.3 90/05/16 08:31:53 william Exp $";
#endif
! char * version_string = "1.2";
--- 6,11 ----
#ifndef lint
static char RCSid[] =
! "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/version.c,v 1.12 90/06/26 08:47:59 william Exp $";
#endif
! char * version_string = "1.9";
*** file.e.orig Wed Jun 27 13:33:15 1990
--- file.e Wed Jun 27 13:33:17 1990
***************
*** 4,8 ****
* Copyright (C) 1989, William Cheng.
*
! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.e,v 1.1 90/04/01 22:17:03 william Exp $
*/
--- 4,8 ----
* Copyright (C) 1989, William Cheng.
*
! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.e,v 1.6 90/05/24 10:35:30 william Exp $
*/
***************
*** 12,15 ****
--- 12,24 ----
extern int importingFile;
extern char * fileMenuStr[];
+ extern int psDotsPerInch;
+ extern char * psScaleStr[];
+ extern float psScale[];
+ extern char * psXOffStr[];
+ extern float psXOff[];
+ extern char * psYOffStr[];
+ extern float psYOff[];
+ extern float psPageWidthInInch[];
+ extern float psPageHeightInInch[];
extern void ClearFileInfo ();
***************
*** 28,31 ****
--- 37,41 ----
extern void DumpAttrs ();
extern void DumpAllObj ();
+ extern void DumpBBox ();
extern void Dump ();
extern void NewProc ();
*** scroll.e.orig Wed Jun 27 13:33:22 1990
--- scroll.e Wed Jun 27 13:33:23 1990
***************
*** 4,8 ****
* Copyright (C) 1989, William Cheng.
*
! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/scroll.e,v 1.1 90/04/01 22:17:19 william Exp $
*/
--- 4,8 ----
* Copyright (C) 1989, William Cheng.
*
! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/scroll.e,v 1.2 90/05/21 16:43:32 william Exp $
*/
***************
*** 15,18 ****
--- 15,22 ----
extern void InitScroll ();
extern void RedrawScrollBars ();
+ extern void ScrollUp ();
+ extern void ScrollDown ();
+ extern void ScrollLeft ();
+ extern void ScrollRight ();
extern void ScrollEventHandler ();
extern void CleanUpScrolls ();
*** setup.e.orig Wed Jun 27 13:33:28 1990
--- setup.e Wed Jun 27 13:33:29 1990
***************
*** 4,8 ****
* Copyright (C) 1989, William Cheng.
*
! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/setup.e,v 1.2 90/05/15 09:33:37 william Exp $
*/
--- 4,8 ----
* Copyright (C) 1989, William Cheng.
*
! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/setup.e,v 1.6 90/06/25 23:44:35 william Exp $
*/
***************
*** 66,72 ****
extern void Setup ();
extern int TieLooseEnds ();
! extern int myBlackPixel;
! extern int myWhitePixel;
extern char drawPath[];
--- 66,75 ----
extern void Setup ();
extern int TieLooseEnds ();
+ extern void SetFileModified ();
! extern int myBgPixel;
! extern int myFgPixel;
! extern int myBorderPixel;
! extern int reverseVideo;
extern char drawPath[];
*** const.h.orig Wed Jun 27 13:33:34 1990
--- const.h Wed Jun 27 13:33:35 1990
***************
*** 4,8 ****
* Copyright (C) 1990, William Cheng.
*
! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/const.h,v 1.1 90/04/01 22:17:28 william Exp $
*/
--- 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 $
*/
***************
*** 37,40 ****
--- 37,41 ----
#define SetRecVals(R,X,Y,W,H) ((R).x=(X),(R).y=(Y),(R).width=(W),(R).height=(H))
+ #define MAXSTRING 256
#define MAXPATHLENGTH 256
***************
*** 175,178 ****
--- 176,181 ----
#define SLIDEPORT 4
#define SLIDELAND 5
+
+ #define MAXPAGESTYLES 6
/* where to print */
*** types.h.orig Wed Jun 27 13:33:40 1990
--- types.h Wed Jun 27 13:33:41 1990
***************
*** 4,10 ****
* Copyright (C) 1990, William Cheng.
*
! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/types.h,v 1.1 90/04/01 22:17:28 william Exp $
*/
typedef struct BBRec {
int ltx, lty, rbx, rby;
--- 4,12 ----
* Copyright (C) 1990, William Cheng.
*
! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/types.h,v 1.3 90/05/18 20:23:48 william Exp $
*/
+ #include "const.h"
+
typedef struct BBRec {
int ltx, lty, rbx, rby;
***************
*** 32,37 ****
typedef struct AttrRec {
! char name[80]; /* attribute name */
! char s[80]; /* attribute value string */
short shown; /* TRUE if the attribute is shown */
short nameshown; /* TRUE if the attr name is also shown */
--- 34,39 ----
typedef struct AttrRec {
! char name[MAXSTRING+1]; /* attribute name */
! char s[MAXSTRING+1]; /* attribute value string */
short shown; /* TRUE if the attribute is shown */
short nameshown; /* TRUE if the attr name is also shown */
***************
*** 44,48 ****
typedef struct GroupRec {
struct ObjRec * first, * last;
! char s[80];
int id, dirty;
struct AttrRec * fattr, *lattr; /* first and last attributes */
--- 46,50 ----
typedef struct GroupRec {
struct ObjRec * first, * last;
! char s[MAXSTRING+1];
int id, dirty;
struct AttrRec * fattr, *lattr; /* first and last attributes */
***************
*** 76,80 ****
typedef struct StrRec {
! char s[80];
struct StrRec * next, * prev;
} * StrRecPtr;
--- 78,82 ----
typedef struct StrRec {
! char s[MAXSTRING+1];
struct StrRec * next, * prev;
} * StrRecPtr;
***************
*** 100,112 ****
int color, h_align, v_align, line_w, line_s;
int fill, pen, just, font, font_s, f_size, f_comp_size;
! char name[80], domain[256];
} * StkRecPtr;
typedef struct _DspItem {
! char s[256];
} DspItem;
typedef struct _DspList {
! char itemstr[256];
struct _DspList * next;
} DspList;
--- 102,114 ----
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;
typedef struct _DspItem {
! char s[MAXPATHLENGTH+1];
} DspItem;
typedef struct _DspList {
! char itemstr[MAXPATHLENGTH+1];
struct _DspList * next;
} DspList;
*** Makefile.noimake.orig Wed Jun 27 13:33:50 1990
--- Makefile.noimake Wed Jun 27 13:33:51 1990
***************
*** 4,8 ****
# Copyright (C) 1990, William Cheng.
#
! # @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Makefile.noimake,v 1.3 90/05/10 09:12:10 william Exp $
#
--- 4,8 ----
# Copyright (C) 1990, William Cheng.
#
! # @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Makefile.noimake,v 1.10 90/06/13 14:32:34 william Exp $
#
***************
*** 13,17 ****
CC = cc
! CFLAGS = -g -I/usr/local/include
LFLAGS = -lX11 -lm
--- 13,18 ----
CC = cc
! CFLAGS = -g -DTGIF_PATH=\"/u/tangram/u/william/X11/TGIF\" -DPSFILE_MOD=\"664\" \
! -I/usr/local/include
LFLAGS = -lX11 -lm
***************
*** 94,103 ****
cursor.o: const.h types.h $(CURSOR_BM) choice.e setup.e
tgif.o: const.h types.h mainloop.e setup.e version.e
! dialog.o: const.h types.h cursor.e box.e font.e mainloop.e raster.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 poly.e polygon.e raster.e rect.e ruler.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
--- 95,105 ----
cursor.o: const.h types.h $(CURSOR_BM) choice.e setup.e
tgif.o: const.h types.h mainloop.e setup.e version.e
! dialog.o: const.h cursor.e box.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
***************
*** 127,131 ****
box.e choice.e color.e cursor.e dialog.e drawing.e edit.e \
file.e font.e grid.e msg.e names.e obj.e pattern.e raster.e \
! select.e setup.e special.e text.e
move.o: const.h types.h \
attr.e cursor.e drawing.e dup.e grid.e obj.e oval.e \
--- 129,133 ----
box.e choice.e color.e cursor.e dialog.e drawing.e edit.e \
file.e font.e grid.e msg.e names.e obj.e pattern.e raster.e \
! select.e setup.e special.e text.e version.e
move.o: const.h types.h \
attr.e cursor.e drawing.e dup.e grid.e obj.e oval.e \
*** Imakefile.orig Wed Jun 27 13:33:58 1990
--- Imakefile Wed Jun 27 13:33:59 1990
***************
*** 4,18 ****
/**/# Copyright (C) 1990, William Cheng.
/**/#
! /**/# @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Imakefile,v 1.5 90/05/17 08:34:23 william Exp $
/**/#
! XLIB = -lX11
! MATHLIB = -lm
PROGRAMS = tgif prtgif tgif2ps frontend11.o
CDEBUGFLAGS = -g
BINDIR = /u/tangram/bin
! /**/# MY_LIBRARIES = /usr/lib/debug/malloc.o $(XLIB) $(MATHLIB)
! MY_LIBRARIES = $(XLIB) $(MATHLIB)
! TGIFVERSION = 1.2
OBJ1 = align.o animate.o attr.o \
--- 4,18 ----
/**/# Copyright (C) 1990, William Cheng.
/**/#
! /**/# @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/Imakefile,v 1.16 90/06/26 08:48:16 william Exp $
/**/#
! TGIFVERSION = 1.9
PROGRAMS = tgif prtgif tgif2ps frontend11.o
CDEBUGFLAGS = -g
BINDIR = /u/tangram/bin
! DEFINES = -DTGIF_PATH=\"/u/tangram/u/william/X11/TGIF\" \
! -DPSFILE_MOD=\"664\"
! LOCAL_LIBRARIES = $(XLIB)
! SYS_LIBRARIES = -lm
OBJ1 = align.o animate.o attr.o \
***************
*** 34,43 ****
OBJS1 = tgif.o $(OBJ1)
OBJS2 = prtgif.o $(OBJ1)
! OBJS3 = $(OBJ1)
SRCS1 = .//**/*.c
! SRCS2 = .//**/*.c
! SRCS3 = .//**/*.c
.SUFFIXES: .l .man
--- 34,49 ----
OBJS1 = tgif.o $(OBJ1)
OBJS2 = prtgif.o $(OBJ1)
! OBJS3 = tgif2ps.o
SRCS1 = .//**/*.c
! SRCS2 =
! SRCS3 =
+ ComplexProgramTarget_1(tgif,$(LOCAL_LIBRARIES),)
+ ComplexProgramTarget_2(prtgif,$(LOCAL_LIBRARIES),)
+ ComplexProgramTarget_3(tgif2ps,,)
+
+ NormalRelocatableTarget(frontend11,$(OBJ1))
+
.SUFFIXES: .l .man
***************
*** 46,59 ****
cp $*.l $*.man
- ComplexProgramTarget_1(tgif,,$(MY_LIBRARIES))
- NormalProgramTarget(prtgif,$(OBJS2),,,$(MY_LIBRARIES))
- NormalProgramTarget(tgif2ps,tgif2ps.o,,,)
- NormalRelocatableTarget(frontend11,$(OBJS3))
- InstallProgram(tgif2ps,$(BINDIR))
- InstallProgram(prtgif,$(BINDIR))
-
OBJDEMO = an-sr-flip-flop.obj fonts.obj slide-demo.obj spice//**/*.obj
SYMDEMO = flip-flop.sym nand2.sym pin.sym tangram.sym spice//**/*.sym
! MISCTAR = *.man README Copyright tgif.pl spice//**/*.mod
distr: tar shar version
--- 52,58 ----
cp $*.l $*.man
OBJDEMO = an-sr-flip-flop.obj fonts.obj slide-demo.obj spice//**/*.obj
SYMDEMO = flip-flop.sym nand2.sym pin.sym tangram.sym spice//**/*.sym
! MISCTAR = *.man README Copyright tgif.pl spice//**/*.mod example.tex
distr: tar shar version
***************
*** 60,64 ****
tar:
! rm tgif-$(TGIFVERSION).tar/**/*
tar cvf tgif-$(TGIFVERSION).tar /**/*.c /**/*.e /**/*.h \
Makefile.noimake Imakefile bitmaps//**/*.bm \
--- 59,63 ----
tar:
! rm -f tgif-$(TGIFVERSION).tar/**/*
tar cvf tgif-$(TGIFVERSION).tar /**/*.c /**/*.e /**/*.h \
Makefile.noimake Imakefile bitmaps//**/*.bm \
***************
*** 70,74 ****
SPICE_1 = spice spice//**/*.obj spice//**/*.sym spice//**/*.mod
! MAN_1 = /**/*.man
MISC_1 = Makefile.noimake Imakefile .psmac ./**/*port ./**/*land \
README Copyright tgif.pl tgificon.obj
--- 69,73 ----
SPICE_1 = spice spice//**/*.obj spice//**/*.sym spice//**/*.mod
! MAN_1 = /**/*.man example.tex
MISC_1 = Makefile.noimake Imakefile .psmac ./**/*port ./**/*land \
README Copyright tgif.pl tgificon.obj
***************
*** 77,81 ****
shar:
! rm tgif-$(TGIFVERSION).shar./**/*
shar -otgif-$(TGIFVERSION).shar.1 -n1 -e21 a/**/*.c
shar -otgif-$(TGIFVERSION).shar.2 -n2 -e21 b/**/*.c c/**/*.c
--- 76,80 ----
shar:
! rm -f tgif-$(TGIFVERSION).shar./**/*
shar -otgif-$(TGIFVERSION).shar.1 -n1 -e21 a/**/*.c
shar -otgif-$(TGIFVERSION).shar.2 -n2 -e21 b/**/*.c c/**/*.c
*** tgif.man.orig Wed Jun 27 13:34:05 1990
--- tgif.man Wed Jun 27 13:34:06 1990
***************
*** 1,4 ****
! .\"@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/tgif.man,v 1.4 90/05/17 09:21:26 william Exp $
! .TH TGIF 1 "Version 1.1" "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.6 90/06/05 12:19:24 william Exp $
! .TH TGIF 1 "Version 1.6" "Tgif"
.SH NAME
\fItgif\fR \- Xlib based 2-D drawing facility under X11. Also supports
***************
*** 176,179 ****
--- 176,181 ----
^X delete all selected objects\br
^Z escape to Prolog\br
+ ^, scroll left\br
+ ^. scroll right\br
\br
#A attach selected attributes to the selected complex object\br
***************
*** 187,190 ****
--- 189,193 ----
#I increment the grid size\br
#J hide attribute names on the selected objects\br
+ #K change the drawing mode to select\br
#L give the line style and line width pop-up menu\br
#M move the attributes of a selected object\br
***************
*** 208,211 ****
--- 211,216 ----
#4 change the font size to 18\br
#5 change the font size to 24\br
+ #, scroll up\br
+ #. scroll down\br
\br
^#B change the text style to bold\br
***************
*** 265,271 ****
Save and name the file.
.SH LATEX FIGURE FORMATS
! Here we show how to make a figure for a LaTeX file.
.PP
! Before printing a file in the \fI.ps\fR format, center the picture
on the page (e.g., the width of a portrait style page is 7.5 inch, so the
center of the page is at the 3.75 inch mark),
--- 270,311 ----
Save and name the file.
.SH LATEX FIGURE FORMATS
! Here we show how to make a figure for a LaTeX file, first with
! the \fIpsfig\fR (or \fIepsf\fR) special construct, then with the
! \fIpsfile\fR special construct. An example of both can be found
! in ``example.tex'' included with this distribution.
.PP
! To print a tgif file to be included in a LaTeX document with
! the \fIpsfig\fR or \fIepsf\fR special construct
! (files generated will be in the
! \fIencapsulated PostScript\fR format), first
! select LaTeX format in the panel window (click the left mouse
! button on the laser printer icon), then type ^P to generate
! the PostScript file. If the file name is ``an-sr-flip-flop.obj'',
! then the LaTeX figure file generated will be named
! ``an-sr-flip-flop.ps''. This file can be included in a LaTeX
! document as follows,
! .PP
! .DS I
! \\begin{figure*}[htb]
! .br
! \\input{psfig}
! .br
! \\centerline{\\psfig{figure=an-sr-flip-flop.ps}}
! .br
! \\caption{An SR flip-flop. \\label{fig:an-sr-flip-flop}}
! .br
! \\end{figure*}
! .br
! .DE
! .br
! .PP
! The \\centerline command above centers the picture. Also, \fItgif2ps\fR is
! used to generate the \fI.ps\fR file, so it should be
! installed (see the man pages on tgif2ps,
! which is included in the tgif distribution).
! .PP
! If encapsulated PostScript is not desired, the \fIpsfile\fR
! special construct can be used as described here.
! First, center the picture
on the page (e.g., the width of a portrait style page is 7.5 inch, so the
center of the page is at the 3.75 inch mark),
***************
*** 272,281 ****
and make the top object on the page as close to
the top of the page as possible.
! Select LaTeX format in the panel window (click the left mouse button
! in the laser printer icon),
then print in the LaTeX format.
! For example, if the file name is ``an-sr-flip-flop.obj'', the LaTeX figure
! file generated will be named ``an-sr-flip-flop.ps''. This file can be
! included in a LaTeX document as follows,
.PP
.DS I
--- 312,320 ----
and make the top object on the page as close to
the top of the page as possible.
! Select LaTeX format in the panel window,
then print in the LaTeX format.
! Same as with the \fIpsfig\fR construct, a file with the \fI.ps\fR
! extention will be generated.
! This file can be included in a LaTeX document as follows,
.PP
.DS I
***************
*** 297,304 ****
Notice that the psfile special construct is used. Encapsulated
! PostScript format is not supported. Also, \fItgif2ps\fR is
used to generate the \fI.ps\fR file, so it should be
! installed (see the man pages on tgif2ps,
! which is included in the tgif distribution).
.SH X DEFAULTS
.TP
--- 336,342 ----
Notice that the psfile special construct is used. Encapsulated
! PostScript format is not supported. Again, \fItgif2ps\fR is
used to generate the \fI.ps\fR file, so it should be
! installed in the path.
.SH X DEFAULTS
.TP
***************
*** 307,312 ****
--- 345,359 ----
.I Tgif*IconGeometry: +X+Y
.TP
+ .I Tgif*Foreground: COLORSTRING
+ .TP
+ .I Tgif*Background: COLORSTRING
+ .TP
.I Tgif*BorderColor: COLORSTRING
.TP
+ .I Tgif*ReverseVideo: [on,off]
+ For black and white terminal, reverse video ``on'' means the background
+ is black. For color terminal, reverse video ``on'' means the background
+ is specified by the Tgif*Foreground color.
+ .TP
.I Tgif*Color#: COLORSTRING
This specified the correspondance between the color number and a color.
***************
*** 319,322 ****
--- 366,373 ----
This specified the default color index if certain color can not be found.
Default is 0.
+ .TP
+ .I Tgif*PrintCommand: COMMAND
+ This specified the print command used for printing the PostScript file.
+ Default is lpr (without any quotes).
.SH ENVIRONMENT
.TP
***************
*** 345,350 ****
.br
.DE
.SH SEE ALSO
! \fBlatex\fR(1L), \fBlpr\fR(1), \fBenv\fR(1), \fBX\fR(1), \fBtgif2ps\fR(1)
.SH BUGS
When any of the ``escape to Prolog'' commands are accidentally
--- 396,406 ----
.br
.DE
+ .br
+ .PP
+ Note that the last 6 files are no longer needed for version 1.3
+ and above.
.SH SEE ALSO
! \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
*** README.orig Wed Jun 27 13:34:11 1990
--- README Wed Jun 27 13:34:12 1990
***************
*** 2,6 ****
* Author: William Chia-Wei Cheng (william at cs.ucla.edu)
*
! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/README,v 1.2 90/05/10 09:23:20 william Exp $
*/
--- 2,6 ----
* Author: William Chia-Wei Cheng (william at cs.ucla.edu)
*
! * @(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/README,v 1.3 90/05/25 14:34:11 william Exp $
*/
***************
*** 16,20 ****
psroff -man tgif.man <== to print
! 3) If you don't have imake, just do the following,
cp Makefile.noimake Makefile
make tgif
--- 16,23 ----
psroff -man tgif.man <== to print
! 3) Modify Makefile.noimake or Imakefile such that TGIF_PATH is set
! to the directory where the icon file and the PostScript macro file are.
!
! 4) If you don't have imake, just do the following,
cp Makefile.noimake Makefile
make tgif
***************
*** 24,29 ****
make tgif
! 4) Remember to set the environment variables TGIFPATH and TGIFICON (see
the man pages).
! 5) Please also note that tgif has nothing to do with GIF files/formats.
--- 27,32 ----
make tgif
! 5) Remember to set the environment variables TGIFPATH and TGIFICON (see
the man pages).
! 6) Please also note that tgif has nothing to do with GIF files/formats.
*** .psmac.orig Wed Jun 27 14:28:37 1990
--- .psmac Wed Jun 27 14:28:37 1990
***************
*** 1,3 ****
- %!
/ellipsedict 6 dict def
--- 1,2 ----
---------------------------------> cut here <---------------------------------
--
-- Bill Cheng // UCLA Computer Science Department // (213) 206-7135
3277 Boelter Hall // Los Angeles, California 90024 // USA
william at CS.UCLA.EDU ...!{uunet|ucbvax}!cs.ucla.edu!william
dan
----------------------------------------------------
O'Reilly && Associates argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.
More information about the Comp.sources.x
mailing list