*** auxtext.c.orig Sat Mar 27 10:40:56 1999 --- auxtext.c Sat Mar 27 10:40:56 1999 *************** *** 719,722 **** --- 719,749 ---- } + #ifdef _TGIF_DBG + static + void DebugCachedTextBitmapImage(image, before, w, h, min_lbearing, max_rextra) + XImage *image; + int before, w, h, min_lbearing, max_rextra; + { + int i=0; + + if (before) fprintf(stderr, "\n"); + fprintf(stderr, " w = %1d\n", w); + fprintf(stderr, " h = %1d\n", h); + if (before) { + fprintf(stderr, "min_lbearing = %1d\n", min_lbearing); + fprintf(stderr, " max_rextra = %1d\n", max_rextra); + } + for (i=0; i < h; i++) { + int j=0; + + for (j=0; j < w; j++) { + int data=XGetPixel(image,j,i); + + fprintf(stderr, "%c%s", (data==1 ? 'X' : ' '), (j+1 == w ? "\n" : "")); + } + } + } + #endif /* _TGIF_DBG */ + void MakeCachedTextBitmap(ObjPtr) struct ObjRec *ObjPtr; *************** *** 787,792 **** if (ObjPtr->ctm == NULL) { if (text_ptr->read_only) { ! num_cols = ObjPtr->bbox.rbx - ObjPtr->bbox.ltx; ! num_rows = ObjPtr->bbox.rby - ObjPtr->bbox.lty; } else { num_cols = bbox_w; num_rows = bbox_h; --- 814,819 ---- if (ObjPtr->ctm == NULL) { if (text_ptr->read_only) { ! num_cols = ObjPtr->bbox.rbx - ObjPtr->bbox.ltx - 2; ! num_rows = ObjPtr->bbox.rby - ObjPtr->bbox.lty - 2; } else { num_cols = bbox_w; num_rows = bbox_h; *************** *** 834,837 **** --- 861,870 ---- if (!flat && !skinny) { + #ifdef NOT_DEFINED + #ifdef _TGIF_DBG + DebugCachedTextBitmapImage(src_bitmap_image, TRUE, bbox_w, bbox_h, + min_lbearing, max_rextra); + #endif /* _TGIF_DBG */ + #endif /* NOT_DEFINED */ if (ObjPtr->ctm == NULL) { mtrx.image_w = (float)bbox_w; *************** *** 857,870 **** XSync(mainDisplay, False); } ! part_x = ((double)(r+start_row))*((double)(mtrx.rev_m[1][0])); ! part_y = ((double)(r+start_row))*((double)(mtrx.rev_m[1][1])); for (c=0; c < num_cols; c++) { double x, y; ! x = part_x+((double)(c+start_col))*((double)(mtrx.rev_m[0][0])); ! y = part_y+((double)(c+start_col))*((double)(mtrx.rev_m[0][1])); if (x >= ((double)0) && x < ((double)bbox_w) && y >= ((double)0) && y < ((double)bbox_h)) { ! int new_x=round(x), new_y=round(y); if (new_x < 0) new_x = 0; --- 890,903 ---- XSync(mainDisplay, False); } ! part_x = ((double)(r+start_row)+0.5)*(mtrx.rev_m[1][0]); ! part_y = ((double)(r+start_row)+0.5)*(mtrx.rev_m[1][1]); for (c=0; c < num_cols; c++) { double x, y; ! x = part_x+((double)(c+start_col)+0.5)*(mtrx.rev_m[0][0]); ! y = part_y+((double)(c+start_col)+0.5)*(mtrx.rev_m[0][1]); if (x >= ((double)0) && x < ((double)bbox_w) && y >= ((double)0) && y < ((double)bbox_h)) { ! int new_x=(int)x, new_y=(int)y; if (new_x < 0) new_x = 0; *************** *** 887,893 **** --- 920,929 ---- int abs_offset_x=ObjPtr->bbox.ltx+1-ObjPtr->x; int abs_offset_y=ObjPtr->bbox.lty+1-ObjPtr->y; + int abs_adj_x=ObjPtr->x-ObjPtr->orig_obbox.ltx; + int abs_adj_y=ObjPtr->y-ObjPtr->orig_obbox.lty; for (r=0; r < num_rows; r++) { int y=abs_offset_y+ABS_SIZE(r); + double dy=((double)y)+0.5; if (do_msg && ((r & 0xf) == 0)) { *************** *** 900,912 **** for (c=0; c < num_cols; c++) { int x=abs_offset_x+ABS_SIZE(c); double new_dx=((double)0), new_dy=((double)0); ! ReverseTransformDoublePointThroughCTM(x, y, ObjPtr->ctm, &new_dx, &new_dy); ! new_dx += (double)(ObjPtr->x-text_ptr->orig_bbox.ltx); ! new_dy += (double)(ObjPtr->y-text_ptr->orig_bbox.lty); if (new_dx >= ((double)0) && new_dx < ((double)bbox_w) && new_dy >= ((double)0) && new_dy < ((double)bbox_h)) { ! int new_x=round(new_dx), new_y=round(new_dy); if (new_x < 0) new_x = 0; --- 936,949 ---- for (c=0; c < num_cols; c++) { int x=abs_offset_x+ABS_SIZE(c); + double dx=((double)x)+0.5; double new_dx=((double)0), new_dy=((double)0); ! ReverseTransformDoublePointThroughCTM(dx, dy, ObjPtr->ctm, &new_dx, &new_dy); ! new_dx += (double)abs_adj_x; ! new_dy += (double)abs_adj_y; if (new_dx >= ((double)0) && new_dx < ((double)bbox_w) && new_dy >= ((double)0) && new_dy < ((double)bbox_h)) { ! int new_x=(int)new_dx, new_y=(int)new_dy; if (new_x < 0) new_x = 0; *************** *** 928,931 **** --- 965,974 ---- memcpy(&text_ptr->cached_ctm,ObjPtr->ctm,sizeof(struct XfrmMtrxRec)); } + #ifdef NOT_DEFINED + #ifdef _TGIF_DBG + DebugCachedTextBitmapImage(dest_bitmap_image, FALSE, num_cols, num_rows, + 0, 0); + #endif /* _TGIF_DBG */ + #endif /* NOT_DEFINED */ } if (do_msg) { *************** *** 1213,1216 **** --- 1256,1260 ---- fprintf(FP, " %s\n", gPsCmd[PS_GSAVE]); + fprintf(FP, " 1 %s\n", gPsCmd[PS_SETLINEWIDTH]); if (ObjPtr->ctm != NULL) { float m[6]; *** choice.c.orig Sat Mar 27 10:40:58 1999 --- choice.c Sat Mar 27 10:40:58 1999 *************** *** 298,310 **** for (r=0; r < abcRotatedBitmapSize; r++) { int c, y=r-half_sz; for (c=0; c < abcRotatedBitmapSize; c++) { int x=c-half_sz; double new_dx=(double)0, new_dy=(double)0; ! ReverseTransformDoublePointThroughCTM(x, y, &ctm, &new_dx, &new_dy); if (new_dx >= ((double)0) && new_dx < ((double)abc_width) && new_dy >= ((double)0) && new_dy < ((double)abc_height)) { ! int new_x=round(new_dx), new_y=round(new_dy); if (new_x < 0) new_x = 0; --- 298,312 ---- for (r=0; r < abcRotatedBitmapSize; r++) { int c, y=r-half_sz; + double dy=((double)y)+0.5; for (c=0; c < abcRotatedBitmapSize; c++) { int x=c-half_sz; + double dx=((double)x)+0.5; double new_dx=(double)0, new_dy=(double)0; ! ReverseTransformDoublePointThroughCTM(dx, dy, &ctm, &new_dx, &new_dy); if (new_dx >= ((double)0) && new_dx < ((double)abc_width) && new_dy >= ((double)0) && new_dy < ((double)abc_height)) { ! int new_x=(int)new_dx, new_y=(int)new_dy; if (new_x < 0) new_x = 0; *** choose.c.orig Sat Mar 27 10:40:59 1999 --- choose.c Sat Mar 27 10:40:59 1999 *************** *** 380,383 **** --- 380,384 ---- } } + if (check_bits) { } } *** drawing.c.orig Sat Mar 27 10:41:01 1999 --- drawing.c Sat Mar 27 10:41:01 1999 *************** *** 90,93 **** --- 90,94 ---- #include "stream.e" #include "stretch.e" + #include "tangram2.e" #include "text.e" #include "util.e" *************** *** 98,105 **** #include "xpixmap.e" - #ifdef _TANGRAM_II - #include "tangram2.e" - #endif /* _TANGRAM_II */ - #define O_VIS 4 #define O_INVIS 4 --- 99,102 ---- *** exec.c.orig Sat Mar 27 10:41:03 1999 --- exec.c Sat Mar 27 10:41:03 1999 *************** *** 77,80 **** --- 77,81 ---- #include "stk.e" #include "stretch.e" + #include "tangram2.e" #include "tcp.e" #include "text.e" *************** *** 86,93 **** #include "xprtfltr.e" - #ifdef _TANGRAM_II - #include "tangram2.e" - #endif /* _TANGRAM_II */ - int execAnimating=FALSE; int execAnimateRedraw=FALSE; --- 87,90 ---- *************** *** 7048,7052 **** text_ptr = attr_ptr->obj->detail.t; if (text_ptr->minilines.first->next != NULL) { - MiniLinesInfo *minilines=(&text_ptr->minilines); MiniLineInfo *pMiniLine=NULL, *pNextMiniLine=NULL; --- 7045,7048 ---- *** font.c.orig Sat Mar 27 10:41:07 1999 --- font.c Sat Mar 27 10:41:07 1999 *************** *** 247,256 **** "8#267 /periodcentered", "8#270 /cedilla", ! "x", "8#272 /ordmasculine", "8#273 /guillemotright", ! "x", ! "x", ! "x", "8#277 /questiondown", /* \300 */ "8#300 /Agrave", --- 247,256 ---- "8#267 /periodcentered", "8#270 /cedilla", ! "8#271 /onesuperior", "8#272 /ordmasculine", "8#273 /guillemotright", ! "8#274 /onequarter", ! "8#275 /onehalf", ! "8#276 /threequarters", "8#277 /questiondown", /* \300 */ "8#300 /Agrave", *** http.c.orig Sat Mar 27 10:41:08 1999 --- http.c Sat Mar 27 10:41:09 1999 *************** *** 752,756 **** #ifdef _TGIF_DBG static ! void HttpDumpResponse(buf) char *buf; { --- 752,756 ---- #ifdef _TGIF_DBG static ! void DebugHttpDumpResponse(buf) char *buf; { *** imgproc.c.orig Sat Mar 27 10:41:10 1999 --- imgproc.c Sat Mar 27 10:41:10 1999 *************** *** 5911,5916 **** double tmp_dx=(double)0, tmp_dy=(double)0; ! ReverseTransformDoublePointThroughCTM(abs_x-obj_ptr->x, ! abs_y-obj_ptr->y, obj_ptr->ctm, &tmp_dx, &tmp_dy); tmp_dx += (double)(obj_ptr->x-obj_ptr->orig_obbox.ltx); tmp_dy += (double)(obj_ptr->y-obj_ptr->orig_obbox.lty); --- 5911,5918 ---- double tmp_dx=(double)0, tmp_dy=(double)0; ! ReverseTransformDoublePointThroughCTM( ! ((double)(abs_x-obj_ptr->x)+0.5), ! ((double)(abs_y-obj_ptr->y)+0.5), ! obj_ptr->ctm, &tmp_dx, &tmp_dy); tmp_dx += (double)(obj_ptr->x-obj_ptr->orig_obbox.ltx); tmp_dy += (double)(obj_ptr->y-obj_ptr->orig_obbox.lty); *************** *** 5918,5922 **** tmp_dy >= ((double)0) && tmp_dy < ((double)xpm_ptr->image_h)) { ! int tmp_x=round(tmp_dx), tmp_y=round(tmp_dy); if (tmp_x < 0) tmp_x = 0; --- 5920,5924 ---- tmp_dy >= ((double)0) && tmp_dy < ((double)xpm_ptr->image_h)) { ! int tmp_x=(int)tmp_dx, tmp_y=(int)tmp_dy; if (tmp_x < 0) tmp_x = 0; *************** *** 5995,6006 **** static ! unsigned int FillReplacePickAPoint(OrigX, OrigY, cursor) ! int *OrigX, *OrigY; Cursor cursor; { XEvent input; if (!debugNoPointerGrab) { ! XGrabPointer(mainDisplay, drawWindow, False, ButtonPressMask, GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime); } --- 5997,6012 ---- static ! unsigned int FillReplacePickAPoint(OrigX, OrigY, EndX, EndY, AllowDrag, cursor) ! int *OrigX, *OrigY, *EndX, *EndY, AllowDrag; ! /* if AllowDrag is TRUE, EndX and EndY must not be NULL */ Cursor cursor; { + unsigned int button=(unsigned int)(-1); + int dragging=FALSE; XEvent input; if (!debugNoPointerGrab) { ! XGrabPointer(mainDisplay, drawWindow, False, ! PointerMotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime); } *************** *** 6009,6013 **** --- 6015,6021 ---- if (TgWindowIsPinnedMenu(input.xany.window, MENU_COLOR)) { + SaveStatusStrings(); TgHandlePinnedMenuEvent(input.xany.window, MENU_COLOR, &input); + RestoreStatusStrings(); } else if (TgIsCmdEvent(&input)) { TgHandleCmdEvent(&input); *************** *** 6015,6023 **** ExposeEventHandler(&input, TRUE); } else if (input.type == ButtonPress) { ! XUngrabPointer(mainDisplay, CurrentTime); ! XSync(mainDisplay, False); *OrigX = input.xbutton.x; *OrigY = input.xbutton.y; ! return input.xbutton.button; } else if (input.type == KeyPress) { XKeyEvent *key_ev=(&(input.xkey)); --- 6023,6055 ---- ExposeEventHandler(&input, TRUE); } else if (input.type == ButtonPress) { ! button = input.xbutton.button; *OrigX = input.xbutton.x; *OrigY = input.xbutton.y; ! if (AllowDrag && button == Button3) { ! *EndX = *OrigX; ! *EndY = *OrigY; ! SelBox(drawWindow, revDefaultGC, *OrigX, *OrigY, *EndX, *EndY); ! dragging = TRUE; ! SaveStatusStrings(); ! SetStringStatus("Drag to select an area..."); ! } else { ! XUngrabPointer(mainDisplay, CurrentTime); ! XSync(mainDisplay, False); ! return button; ! } ! } else if (AllowDrag && dragging && input.type == ButtonRelease) { ! SelBox(drawWindow, revDefaultGC, *OrigX, *OrigY, *EndX, *EndY); ! XUngrabPointer(mainDisplay, CurrentTime); ! XSync(mainDisplay, False); ! *EndX = input.xbutton.x; ! *EndY = input.xbutton.y; ! RestoreStatusStrings(); ! XSync(mainDisplay, False); ! return button; ! } else if (AllowDrag && dragging && input.type == MotionNotify) { ! SelBox(drawWindow, revDefaultGC, *OrigX, *OrigY, *EndX, *EndY); ! *EndX = input.xmotion.x; ! *EndY = input.xmotion.y; ! SelBox(drawWindow, revDefaultGC, *OrigX, *OrigY, *EndX, *EndY); } else if (input.type == KeyPress) { XKeyEvent *key_ev=(&(input.xkey)); *************** *** 6028,6031 **** --- 6060,6067 ---- TranslateKeys(s, &key_sym); if (CharIsESC(key_ev, s, key_sym, &has_ch)) { + if (AllowDrag && dragging) { + SelBox(drawWindow, revDefaultGC, *OrigX, *OrigY, *EndX, *EndY); + RestoreStatusStrings(); + } XUngrabPointer(mainDisplay, CurrentTime); XSync(mainDisplay, False); *************** *** 6136,6141 **** while (!done) { int mouse_x=0, mouse_y=0; ! unsigned int button=FillReplacePickAPoint(&mouse_x, &mouse_y, ! floodCursor); if (button == Button1) { --- 6172,6177 ---- while (!done) { int mouse_x=0, mouse_y=0; ! unsigned int button=FillReplacePickAPoint(&mouse_x, &mouse_y, NULL, NULL, ! FALSE, floodCursor); if (button == Button1) { *************** *** 6156,6161 **** double image_dx=(double)0, image_dy=(double)0; ! ReverseTransformDoublePointThroughCTM(abs_x-obj_ptr->x, ! abs_y-obj_ptr->y, obj_ptr->ctm, &image_dx, &image_dy); image_dx += (double)(obj_ptr->x-obj_ptr->orig_obbox.ltx); image_dy += (double)(obj_ptr->y-obj_ptr->orig_obbox.lty); --- 6192,6199 ---- double image_dx=(double)0, image_dy=(double)0; ! ReverseTransformDoublePointThroughCTM( ! ((double)(abs_x-obj_ptr->x)+0.5), ! ((double)(abs_y-obj_ptr->y)+0.5), ! obj_ptr->ctm, &image_dx, &image_dy); image_dx += (double)(obj_ptr->x-obj_ptr->orig_obbox.ltx); image_dy += (double)(obj_ptr->y-obj_ptr->orig_obbox.lty); *************** *** 6163,6168 **** image_dx < ((double)image_w) && image_dy < ((double)image_h)) { ! image_x = round(image_dx); ! image_y = round(image_dy); if (image_x < 0) image_x = 0; if (image_x >= image_w) image_x = image_w-1; --- 6201,6206 ---- image_dx < ((double)image_w) && image_dy < ((double)image_h)) { ! image_x = (int)image_dx; ! image_y = (int)image_dy; if (image_x < 0) image_x = 0; if (image_x >= image_w) image_x = image_w-1; *************** *** 6270,6275 **** } } - SetWatchCursor(drawWindow); - SetWatchCursor(mainWindow); gnPixelToFill = colorPixels[colorIndex]; if (pixel == (-1)) { --- 6308,6311 ---- *************** *** 6351,6379 **** } } ! SetDefaultCursor(mainWindow); ! ShowCursor(); ! XPutImage(mainDisplay, xpm_ptr->pixmap, xpmGC, image, 0, 0, 0, 0, ! image_w, image_h); ! if (bitmap_image != NULL) { ! XPutImage(mainDisplay, xpm_ptr->bitmap, xbmGC, bitmap_image, 0, 0, 0, 0, ! image_w, image_h); } ! if (xpm_ptr->cached_pixmap != None) { ! XFreePixmap(mainDisplay, xpm_ptr->cached_pixmap); ! xpm_ptr->cached_pixmap = None; } ! if (xpm_ptr->cached_bitmap != None) { ! XFreePixmap(mainDisplay, xpm_ptr->cached_bitmap); ! xpm_ptr->cached_bitmap = None; ! } ! AdjObjCache(obj_ptr); ! RedrawAnArea(botObj, selLtX-GRID_ABS_SIZE(1), selLtY-GRID_ABS_SIZE(1), ! selRbX+GRID_ABS_SIZE(1), selRbY+GRID_ABS_SIZE(1)); ! SetFileModified(TRUE); ! justDupped = FALSE; } static int ContinueFloodFill(obj_ptr) struct ObjRec *obj_ptr; --- 6387,6461 ---- } } ! } ! static ! int TryFloodFill(obj_ptr, image_w, image_h, image, bitmap_image, button, ! mouse_x, mouse_y) ! struct ObjRec *obj_ptr; ! int image_w, image_h, mouse_x, mouse_y; ! XImage *image, *bitmap_image; ! unsigned int button; ! { ! int changed=FALSE, abs_x=ABS_X(mouse_x), abs_y=ABS_Y(mouse_y), found=FALSE; ! int image_x=0, image_y=0; ! ! if (obj_ptr->ctm == NULL) { ! if (abs_x >= obj_ptr->obbox.ltx && abs_y >= obj_ptr->obbox.lty && ! abs_x < obj_ptr->obbox.rbx && abs_y < obj_ptr->obbox.rby) { ! image_x = abs_x-obj_ptr->obbox.ltx; ! image_y = abs_y-obj_ptr->obbox.lty; ! if (image_x >= 0 && image_y >= 0 && ! image_x < image_w && image_y < image_h) { ! found = TRUE; ! } ! } ! } else { ! double image_dx=(double)0, image_dy=(double)0; ! ! ReverseTransformDoublePointThroughCTM( ! ((double)(abs_x-obj_ptr->x)+0.5), ! ((double)(abs_y-obj_ptr->y)+0.5), ! obj_ptr->ctm, &image_dx, &image_dy); ! image_dx += (double)(obj_ptr->x-obj_ptr->orig_obbox.ltx); ! image_dy += (double)(obj_ptr->y-obj_ptr->orig_obbox.lty); ! if (image_dx >= ((double)0) && image_dy >= ((double)0) && ! image_dx < ((double)image_w) && ! image_dy < ((double)image_h)) { ! image_x = (int)image_dx; ! image_y = (int)image_dy; ! if (image_x < 0) image_x = 0; ! if (image_x >= image_w) image_x = image_w-1; ! if (image_y < 0) image_y = 0; ! if (image_y >= image_h) image_y = image_h-1; ! found = TRUE; ! } } ! if (found) { ! changed = TRUE; ! StartFloodFill(obj_ptr, image, bitmap_image, image_x, image_y, ! image_w, image_h, button==Button1); } ! return changed; } static + void GetUntransformedPoint(obj_ptr, abs_x, abs_y, v) + struct ObjRec *obj_ptr; + int abs_x, abs_y; + IntPoint *v; + { + double image_dx=(double)0, image_dy=(double)0; + + ReverseTransformDoublePointThroughCTM( + ((double)(abs_x-obj_ptr->x)+0.5), + ((double)(abs_y-obj_ptr->y)+0.5), + obj_ptr->ctm, &image_dx, &image_dy); + image_dx += (double)(obj_ptr->x-obj_ptr->orig_obbox.ltx); + image_dy += (double)(obj_ptr->y-obj_ptr->orig_obbox.lty); + v->x = (int)image_dx; + v->y = (int)image_dy; + } + + static int ContinueFloodFill(obj_ptr) struct ObjRec *obj_ptr; *************** *** 6381,6385 **** int done=FALSE, image_w, image_h, changed=FALSE; struct XPmRec *xpm_ptr=obj_ptr->detail.xpm; ! XImage *image, *bitmap_image; xpm_ptr = obj_ptr->detail.xpm; --- 6463,6467 ---- int done=FALSE, image_w, image_h, changed=FALSE; struct XPmRec *xpm_ptr=obj_ptr->detail.xpm; ! XImage *image=NULL, *bitmap_image=NULL; xpm_ptr = obj_ptr->detail.xpm; *************** *** 6403,6447 **** SetMouseStatus("Flood-fill", "Finish", "Set a pixel"); while (!done) { ! int mouse_x=0, mouse_y=0; unsigned int button=FillReplacePickAPoint(&mouse_x, &mouse_y, ! floodCursor); ! if (button == Button1 || button == Button3) { ! int abs_x=ABS_X(mouse_x), abs_y=ABS_Y(mouse_y), found=FALSE; ! int image_x=0, image_y=0; ! if (obj_ptr->ctm == NULL) { ! if (abs_x >= obj_ptr->obbox.ltx && abs_y >= obj_ptr->obbox.lty && ! abs_x < obj_ptr->obbox.rbx && abs_y < obj_ptr->obbox.rby) { ! image_x = abs_x-obj_ptr->obbox.ltx; ! image_y = abs_y-obj_ptr->obbox.lty; ! if (image_x >= 0 && image_y >= 0 && ! image_x < image_w && image_y < image_h) { ! found = TRUE; } } } else { ! double image_dx=(double)0, image_dy=(double)0; ! ReverseTransformDoublePointThroughCTM(abs_x-obj_ptr->x, ! abs_y-obj_ptr->y, obj_ptr->ctm, &image_dx, &image_dy); ! image_dx += (double)(obj_ptr->x-obj_ptr->orig_obbox.ltx); ! image_dy += (double)(obj_ptr->y-obj_ptr->orig_obbox.lty); ! if (image_dx >= ((double)0) && image_dy >= ((double)0) && ! image_dx < ((double)image_w) && ! image_dy < ((double)image_h)) { ! image_x = round(image_dx); ! image_y = round(image_dy); ! if (image_x < 0) image_x = 0; ! if (image_x >= image_w) image_x = image_w-1; ! if (image_y < 0) image_y = 0; ! if (image_y >= image_h) image_y = image_h-1; ! found = TRUE; } } ! if (found) { ! changed = TRUE; ! StartFloodFill(obj_ptr, image, bitmap_image, image_x, image_y, ! image_w, image_h, button==Button1); } else { sprintf(gszMsgBox, "Selected point is not on the selected image."); --- 6485,6572 ---- SetMouseStatus("Flood-fill", "Finish", "Set a pixel"); while (!done) { ! int mouse_x=0, mouse_y=0, mouse_end_x=0, mouse_end_y=0; unsigned int button=FillReplacePickAPoint(&mouse_x, &mouse_y, ! &mouse_end_x, &mouse_end_y, TRUE, floodCursor); ! SetWatchCursor(drawWindow); ! SetWatchCursor(mainWindow); ! if (button == Button1) { ! changed = TryFloodFill(obj_ptr, image_w, image_h, image, bitmap_image, ! button, mouse_x, mouse_y); ! } else if (button == Button3) { ! if (mouse_x == mouse_end_x && mouse_y == mouse_end_y) { ! changed = TryFloodFill(obj_ptr, image_w, image_h, image, ! bitmap_image, button, mouse_x, mouse_y); ! } else if (obj_ptr->ctm == NULL) { ! int r=0; ! struct BBRec bbox; ! SetBBRec(&bbox, mouse_x, mouse_y, mouse_end_x, mouse_end_y); ! for (r=bbox.lty; r < bbox.rby; r++) { ! int c=0; ! ! for (c=bbox.ltx; c < bbox.rbx; c++) { ! if (TryFloodFill(obj_ptr, image_w, image_h, image, ! bitmap_image, button, c, r)) { ! changed = TRUE; ! } } } } else { ! int r=0, abs_x=ABS_X(mouse_x), abs_y=ABS_Y(mouse_y); ! int abs_end_x=ABS_X(mouse_end_x), abs_end_y=ABS_Y(mouse_end_y); ! int ltx=0, lty=0, rbx=0, rby=0; ! IntPoint ivs[6]; ! GetUntransformedPoint(obj_ptr, abs_x, abs_y, &ivs[0]); ! GetUntransformedPoint(obj_ptr, abs_x, abs_end_y, &ivs[1]); ! GetUntransformedPoint(obj_ptr, abs_end_x, abs_end_y, &ivs[2]); ! GetUntransformedPoint(obj_ptr, abs_end_x, abs_y, &ivs[3]); ! memcpy(&ivs[4], &ivs[0], sizeof(IntPoint)); ! ltx = min(min(ivs[0].x, ivs[1].x),min(ivs[2].x, ivs[3].x)); ! lty = min(min(ivs[0].y, ivs[1].y),min(ivs[2].y, ivs[3].y)); ! rbx = max(max(ivs[0].x, ivs[1].x),max(ivs[2].x, ivs[3].x)); ! rby = max(max(ivs[0].y, ivs[1].y),max(ivs[2].y, ivs[3].y)); ! ! for (r=lty; r < rby; r++) { ! int c=0; ! ! if (r < 0 || r >= image_h) continue; ! for (c=ltx; c < rbx; c++) { ! if (c < 0 || c >= image_w) continue; ! ! if (PointInIntPolygon(c, r, 5, ivs)) { ! StartFloodFill(obj_ptr, image, bitmap_image, c, r, ! c, r, FALSE); ! changed = TRUE; ! } ! } } } ! } else { ! done = TRUE; ! } ! if (!done) { ! if (changed) { ! XPutImage(mainDisplay, xpm_ptr->pixmap, xpmGC, image, 0, 0, 0, 0, ! image_w, image_h); ! if (bitmap_image != NULL) { ! XPutImage(mainDisplay, xpm_ptr->bitmap, xbmGC, bitmap_image, ! 0, 0, 0, 0, image_w, image_h); ! } ! if (xpm_ptr->cached_pixmap != None) { ! XFreePixmap(mainDisplay, xpm_ptr->cached_pixmap); ! xpm_ptr->cached_pixmap = None; ! } ! if (xpm_ptr->cached_bitmap != None) { ! XFreePixmap(mainDisplay, xpm_ptr->cached_bitmap); ! xpm_ptr->cached_bitmap = None; ! } ! AdjObjCache(obj_ptr); ! RedrawAnArea(botObj, selLtX-GRID_ABS_SIZE(1), ! selLtY-GRID_ABS_SIZE(1), selRbX+GRID_ABS_SIZE(1), ! selRbY+GRID_ABS_SIZE(1)); ! SetFileModified(TRUE); ! justDupped = FALSE; } else { sprintf(gszMsgBox, "Selected point is not on the selected image."); *************** *** 6448,6454 **** SetStringStatus(gszMsgBox); } - } else { - done = TRUE; } } RestoreStatusStrings(); --- 6573,6579 ---- SetStringStatus(gszMsgBox); } } + SetDefaultCursor(mainWindow); + ShowCursor(); } RestoreStatusStrings(); *************** *** 6814,6818 **** SetMouseStatus("Start-contour", "Finish", "Finish"); ! button = FillReplacePickAPoint(&mouse_x, &mouse_y, handCursor); if (button == Button1) { --- 6939,6944 ---- SetMouseStatus("Start-contour", "Finish", "Finish"); ! button = FillReplacePickAPoint(&mouse_x, &mouse_y, NULL, NULL, FALSE, ! handCursor); if (button == Button1) { *************** *** 6833,6838 **** double image_dx=(double)0, image_dy=(double)0; ! ReverseTransformDoublePointThroughCTM(abs_x-obj_ptr->x, ! abs_y-obj_ptr->y, obj_ptr->ctm, &image_dx, &image_dy); image_x += (double)(obj_ptr->x-obj_ptr->orig_obbox.ltx); image_y += (double)(obj_ptr->y-obj_ptr->orig_obbox.lty); --- 6959,6966 ---- double image_dx=(double)0, image_dy=(double)0; ! ReverseTransformDoublePointThroughCTM( ! ((double)(abs_x-obj_ptr->x)+0.5), ! ((double)(abs_y-obj_ptr->y)+0.5), ! obj_ptr->ctm, &image_dx, &image_dy); image_x += (double)(obj_ptr->x-obj_ptr->orig_obbox.ltx); image_y += (double)(obj_ptr->y-obj_ptr->orig_obbox.lty); *************** *** 6839,6844 **** if (image_dx >= ((double)0) && image_dy >= ((double)0) && image_dx < ((double)image_w) && image_dy < ((double)image_h)) { ! image_x = round(image_dx); ! image_y = round(image_dy); if (image_x < 0) image_x = 0; if (image_x >= image_w) image_x = image_w-1; --- 6967,6972 ---- if (image_dx >= ((double)0) && image_dy >= ((double)0) && image_dx < ((double)image_w) && image_dy < ((double)image_h)) { ! image_x = (int)image_dx; ! image_y = (int)image_dy; if (image_x < 0) image_x = 0; if (image_x >= image_w) image_x = image_w-1; *** mainloop.c.orig Sat Mar 27 10:41:13 1999 --- mainloop.c Sat Mar 27 10:41:13 1999 *************** *** 90,93 **** --- 90,94 ---- #include "shortcut.e" #include "stk.e" + #include "tangram2.e" #include "text.e" #include "util.e" *** mainmenu.c.orig Sat Mar 27 10:41:15 1999 --- mainmenu.c Sat Mar 27 10:41:15 1999 *************** *** 60,70 **** #include "special.e" #include "stretch.e" #include "text.e" #include "util.e" - #ifdef _TANGRAM_II - #include "tangram2.e" - #endif /* _TANGRAM_II */ - #define DEF_MAINMENUPINDIST 80 --- 60,67 ---- #include "special.e" #include "stretch.e" + #include "tangram2.e" #include "text.e" #include "util.e" #define DEF_MAINMENUPINDIST 80 *** menu.c.orig Sat Mar 27 10:41:16 1999 --- menu.c Sat Mar 27 10:41:16 1999 *************** *** 71,74 **** --- 71,75 ---- #include "special.e" #include "stk.e" + #include "tangram2.e" #include "text.e" #include "util.e" *************** *** 75,82 **** #include "version.e" - #ifdef _TANGRAM_II - #include "tangram2.e" - #endif /* _TANGRAM_II */ - #include "xbm/check.xbm" #include "xbm/submenu.xbm" --- 76,79 ---- *** menuinfo.c.orig Sat Mar 27 10:41:17 1999 --- menuinfo.c Sat Mar 27 10:41:17 1999 *************** *** 53,63 **** #include "shape.e" #include "stream.e" #include "text.e" #include "xbitmap.e" - #ifdef _TANGRAM_II - #include "tangram2.e" - #endif /* _TANGRAM_II */ - /* ------------------ color menus ------------------ */ --- 53,60 ---- #include "shape.e" #include "stream.e" + #include "tangram2.e" #include "text.e" #include "xbitmap.e" /* ------------------ color menus ------------------ */ *************** *** 376,379 **** --- 373,378 ---- { "ContrastEnhance...", NULL, "Adjust contrast of a selected image", NULL, CMDID_CONTRASTENHANCE }, + { "GammaCorrect...", NULL, "Apply gamma correction a selected image", NULL, + CMDID_GAMMA }, { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, { "ChangeSaturation...", NULL, "Change saturation of a selected image", NULL, *************** *** 381,386 **** { "ChangeHue...", NULL, "Change hue of a selected image", NULL, CMDID_CHANGEHUE }, - { "GammaCorrect...", NULL, "Apply gamma correction a selected image", NULL, - CMDID_GAMMA }, { TGMUITEM_SEPARATOR, NULL, NULL, NULL, INVALID }, { "InvertColor", NULL, --- 380,383 ---- *** miniline.c.orig Sat Mar 27 10:41:19 1999 --- miniline.c Sat Mar 27 10:41:19 1999 *************** *** 1656,1661 **** values.stipple = patPixmap[penPat]; values.font = canvasFontPtr->fid; ! XChangeGC(dpy, gc, ! GCForeground | GCFunction | GCFillStyle | GCStipple | GCFont, &values); if (use_highlight && depth != 1) { PaintString(dpy, d, gc, depth, x, baseline_y, pStrSeg->dyn_str.s, --- 1656,1664 ---- values.stipple = patPixmap[penPat]; values.font = canvasFontPtr->fid; ! values.line_width = 1; ! values.line_style = LineSolid; ! XChangeGC(dpy, gc, GCForeground | GCFunction | GCFillStyle | GCStipple | ! GCFont | GCLineWidth | GCLineStyle, &values); ! if (use_highlight && depth != 1) { PaintString(dpy, d, gc, depth, x, baseline_y, pStrSeg->dyn_str.s, *** pattern.c.orig Sat Mar 27 10:41:21 1999 --- pattern.c Sat Mar 27 10:41:21 1999 *************** *** 490,494 **** item_info->menu_str = (char*)(Pixmap*)(&patPixmap[i]); item_info->shortcut_str = NULL; ! item_info->status_str = "Set fill pattern"; item_info->submenu_info = NULL; item_info->cmdid = CMDID_CHANGEALLSELFILL; --- 490,501 ---- item_info->menu_str = (char*)(Pixmap*)(&patPixmap[i]); item_info->shortcut_str = NULL; ! switch (i) { ! case NONEPAT: sprintf(gszMsgBox, "Set fill pattern to NONE"); break; ! case SOLIDPAT: sprintf(gszMsgBox, "Set fill pattern to SOLID"); break; ! case BACKPAT: sprintf(gszMsgBox, "Set fill pattern to BACKGROUND"); break; ! default: sprintf(gszMsgBox, "Set fill pattern to pattern #%1d", i); break; ! } ! item_info->status_str = UtilStrDup(gszMsgBox); ! if (item_info->status_str == NULL) FailAllocMessage(); item_info->submenu_info = NULL; item_info->cmdid = CMDID_CHANGEALLSELFILL; *************** *** 497,500 **** --- 504,510 ---- menu = TgCreateMenuFromMenuInfo(parent_menu, x, y, &stMenuInfo); + for (item_info=stMenuInfo.items, i=0; i < MAXPATTERNS; item_info++, i++) { + UtilFree(item_info->status_str); + } memset(stMenuInfo.items, 0, (MAXPATTERNS+1)*sizeof(TgMenuItemInfo)); free(stMenuInfo.items); *************** *** 1363,1367 **** item_info->menu_str = (char*)(Pixmap*)(&lineDashPixmap[i]); item_info->shortcut_str = NULL; ! item_info->status_str = "Set dash pattern for the pen"; item_info->submenu_info = NULL; item_info->cmdid = CMDID_CHANGEALLSELLINEDASH; --- 1373,1384 ---- item_info->menu_str = (char*)(Pixmap*)(&lineDashPixmap[i]); item_info->shortcut_str = NULL; ! if (i == 0) { ! sprintf(gszMsgBox, "Set dash pattern for the pen to be no dashes"); ! } else { ! sprintf(gszMsgBox, "Set dash pattern for the pen to dash pattern #%1d", ! i); ! } ! item_info->status_str = UtilStrDup(gszMsgBox); ! if (item_info->status_str == NULL) FailAllocMessage(); item_info->submenu_info = NULL; item_info->cmdid = CMDID_CHANGEALLSELLINEDASH; *************** *** 1370,1373 **** --- 1387,1393 ---- menu = TgCreateMenuFromMenuInfo(parent_menu, x, y, &stMenuInfo); + for (item_info=stMenuInfo.items, i=0; i < MAXDASHES; item_info++, i++) { + UtilFree(item_info->status_str); + } memset(stMenuInfo.items, 0, (MAXDASHES+1)*sizeof(TgMenuItemInfo)); free(stMenuInfo.items); *************** *** 1564,1568 **** item_info->menu_str = (char*)(Pixmap*)(&patPixmap[i]); item_info->shortcut_str = NULL; ! item_info->status_str = "Set pen pattern"; item_info->submenu_info = NULL; item_info->cmdid = CMDID_CHANGEALLSELPEN; --- 1584,1595 ---- item_info->menu_str = (char*)(Pixmap*)(&patPixmap[i]); item_info->shortcut_str = NULL; ! switch (i) { ! case NONEPAT: sprintf(gszMsgBox, "Set pen pattern to NONE"); break; ! case SOLIDPAT: sprintf(gszMsgBox, "Set pen pattern to SOLID"); break; ! case BACKPAT: sprintf(gszMsgBox, "Set pen pattern to BACKGROUND"); break; ! default: sprintf(gszMsgBox, "Set pen pattern to pattern #%1d", i); break; ! } ! item_info->status_str = UtilStrDup(gszMsgBox); ! if (item_info->status_str == NULL) FailAllocMessage(); item_info->submenu_info = NULL; item_info->cmdid = CMDID_CHANGEALLSELPEN; *************** *** 1571,1574 **** --- 1598,1604 ---- menu = TgCreateMenuFromMenuInfo(parent_menu, x, y, &stMenuInfo); + for (item_info=stMenuInfo.items, i=0; i < MAXPATTERNS; item_info++, i++) { + UtilFree(item_info->status_str); + } memset(stMenuInfo.items, 0, (MAXPATTERNS+1)*sizeof(TgMenuItemInfo)); free(stMenuInfo.items); *** rect.c.orig Sat Mar 27 10:41:23 1999 --- rect.c Sat Mar 27 10:41:23 1999 *************** *** 183,189 **** void ReverseTransformDoublePointThroughCTM(X, Y, ctm, NewDx, NewDy) ! int X, Y; struct XfrmMtrxRec *ctm; - double *NewDx, *NewDy; /* * [ a b 0 ] --- 183,188 ---- void ReverseTransformDoublePointThroughCTM(X, Y, ctm, NewDx, NewDy) ! double X, Y, *NewDx, *NewDy; struct XfrmMtrxRec *ctm; /* * [ a b 0 ] *************** *** 201,206 **** { double ad_bc=ctm->m[0]*ctm->m[3]-ctm->m[1]*ctm->m[2]; ! double term_1=((double)X)-((double)(ctm->t[CTM_TX])); ! double term_2=((double)Y)-((double)(ctm->t[CTM_TY])); *NewDx = ((double)1000.0) * --- 200,205 ---- { double ad_bc=ctm->m[0]*ctm->m[3]-ctm->m[1]*ctm->m[2]; ! double term_1=X-((double)(ctm->t[CTM_TX])); ! double term_2=Y-((double)(ctm->t[CTM_TY])); *NewDx = ((double)1000.0) * *************** *** 216,220 **** double x=(double)0, y=(double)0; ! ReverseTransformDoublePointThroughCTM(X, Y, ctm, &x, &y); *NewX = round(x); *NewY = round(y); --- 215,219 ---- double x=(double)0, y=(double)0; ! ReverseTransformDoublePointThroughCTM(((double)X), ((double)Y), ctm, &x, &y); *NewX = round(x); *NewY = round(y); *************** *** 444,447 **** --- 443,485 ---- } + int PointInIntPolygon(X, Y, NumPts, IV) + int X, Y, NumPts; + IntPoint *IV; + { + register double x1, x2, y1, y2; + double m, y_int; + int n, count=0; + + x2 = (double)IV[0].x; + y2 = (double)IV[0].y; + for (n=0; n < NumPts-1; n++) { + x1 = x2; + y1 = y2; + x2 = (double)(IV[n+1].x); + y2 = (double)(IV[n+1].y); + if (x2 == x1) { + if (X == x1 && Y >= min(y1,y2) && Y <= max(y1,y2)) count++; + continue; + } + if (x2 > x1) { + if (X >= x2 || X < x1) continue; + } else { + if (X > x1 || X <= x2) continue; + } + m = (y1 - y2) / (x1 - x2); + y_int = m * X + (y1 - m * x1); + if (Y <= y_int) { + if (fabs(X-x1) < INT_TOL) { + double x3=(double)((n == 0) ? IV[NumPts-2].x : IV[n-1].x); + + if ((x2 > X && X > x3) || (x3 > X && X > x2)) count++; + } else { + count++; + } + } + } + return (count & 0x1); + } + int PointInPolygon(X, Y, NumPts, V) int X, Y, NumPts; *** setup.c.orig Sat Mar 27 10:41:24 1999 --- setup.c Sat Mar 27 10:41:24 1999 *************** *** 83,86 **** --- 83,87 ---- #include "stk.e" #include "stretch.e" + #include "tangram2.e" #include "text.e" #include "util.e" *************** *** 91,98 **** #include "xprtfltr.e" - #ifdef _TANGRAM_II - #include "tangram2.e" - #endif /* _TANGRAM_II */ - #include "tgificon.xbm" --- 92,95 ---- *** shortcut.c.orig Sat Mar 27 10:41:25 1999 --- shortcut.c Sat Mar 27 10:41:26 1999 *************** *** 40,47 **** #include "setup.e" #include "shortcut.e" - - #ifdef _TANGRAM_II #include "tangram2.e" - #endif /* _TANGRAM_II */ static struct ShortCutRec shortCutXlateTbl[] = { --- 40,44 ---- *** tangram2.c.orig Sat Mar 27 10:41:27 1999 --- tangram2.c Sat Mar 27 10:41:27 1999 *************** *** 1,3 **** --- 1,4 ---- /* + * Author: Daniel Ratton Figueiredo * Author: William Chia-Wei Cheng (william@cs.ucla.edu) * *** xbitmap.c.orig Sat Mar 27 10:41:28 1999 --- xbitmap.c Sat Mar 27 10:41:28 1999 *************** *** 667,671 **** target_percent = 5; for (r = 0; r < num_rows; r++) { ! float part_x, part_y; if (do_msg && ((r & 0xf) == 0)) { --- 667,671 ---- target_percent = 5; for (r = 0; r < num_rows; r++) { ! double part_x, part_y; if (do_msg && ((r & 0xf) == 0)) { *************** *** 679,692 **** } } ! part_x = (r+start_row)*mtrx.rev_m[1][0]; ! part_y = (r+start_row)*mtrx.rev_m[1][1]; for (c = 0; c < num_cols; c++) { ! int x, y; ! x = (int)((c+start_col)*mtrx.rev_m[0][0]+part_x); ! y = (int)((c+start_col)*mtrx.rev_m[0][1]+part_y); ! if (x>=0 && x=0 && y= ((double)0) && x < ((double)image_w) && ! y >= ((double)0) && y < ((double)image_h)) { ! if (XGetPixel(src_image, (int)x, (int)y) == 1) { ! XPutPixel(dest_image, c, r, 1); ! } } } *************** *** 704,707 **** --- 706,710 ---- for (r=0; r < num_rows; r++) { int y=abs_offset_y+ABS_SIZE(r); + double dy=((double)y)+0.5; if (do_msg && ((r & 0xf) == 0)) { *************** *** 717,730 **** for (c=0; c < num_cols; c++) { int x=abs_offset_x+ABS_SIZE(c); double new_dx=(double)0, new_dy=(double)0; - double dx, dy; ! ReverseTransformDoublePointThroughCTM(x, y, ObjPtr->ctm, &new_dx, &new_dy); if (xbm_ptr->real_type != XBM_XBM) { ! dx = ((double)new_dx)/sx; ! dy = ((double)new_dy)/sy; ! new_dx = dx + ((double)(ObjPtr->x - ObjPtr->orig_obbox.ltx)); ! new_dy = dy + ((double)(ObjPtr->y - ObjPtr->orig_obbox.lty)); } else { new_dx += (double)(ObjPtr->x-ObjPtr->orig_obbox.ltx); --- 720,734 ---- for (c=0; c < num_cols; c++) { int x=abs_offset_x+ABS_SIZE(c); + double dx=((double)x)+0.5; double new_dx=(double)0, new_dy=(double)0; ! ReverseTransformDoublePointThroughCTM(dx, dy, ObjPtr->ctm, &new_dx, &new_dy); if (xbm_ptr->real_type != XBM_XBM) { ! double tmp_dx=((double)new_dx)/sx; ! double tmp_dy=((double)new_dy)/sy; ! ! new_dx = tmp_dx + ((double)(ObjPtr->x - ObjPtr->orig_obbox.ltx)); ! new_dy = tmp_dy + ((double)(ObjPtr->y - ObjPtr->orig_obbox.lty)); } else { new_dx += (double)(ObjPtr->x-ObjPtr->orig_obbox.ltx); *************** *** 733,737 **** if (new_dx >= ((double)0) && new_dx < ((double)image_w) && new_dy >= ((double)0) && new_dy < ((double)image_h)) { ! int new_x=round(new_dx), new_y=round(new_dy); if (new_x < 0) new_x = 0; --- 737,741 ---- if (new_dx >= ((double)0) && new_dx < ((double)image_w) && new_dy >= ((double)0) && new_dy < ((double)image_h)) { ! int new_x=(int)new_dx, new_y=(int)new_dy; if (new_x < 0) new_x = 0; *************** *** 2326,2329 **** --- 2330,2334 ---- } + #ifdef _TGIF_DBG static void DebugXPmColors() *************** *** 2400,2403 **** --- 2405,2409 ---- } } + #endif /* _TGIF_DBG */ #define FS_SCALE 0x400 *************** *** 2604,2608 **** --- 2610,2616 ---- } else if (colorDump) { #ifdef NOT_DEFINED + #ifdef _TGIF_DBG DebugXPmColorsAndExportImage(image, w, h, left, top, right, bottom); + #endif /* _TGIF_DBG */ #endif /* NOT_DEFINED */ BuildXPmBuckets(numColorsToDump, pixelValue, INVALID, NULL); *** xpixmap.c.orig Sat Mar 27 10:41:30 1999 --- xpixmap.c Sat Mar 27 10:41:30 1999 *************** *** 394,398 **** target_percent = 5; for (r=0; r < num_rows; r++) { ! float part_x, part_y; if (do_msg && ((r & 0xf) == 0)) { --- 394,398 ---- target_percent = 5; for (r=0; r < num_rows; r++) { ! double part_x, part_y; if (do_msg && ((r & 0xf) == 0)) { *************** *** 406,419 **** } } ! part_x = (r+start_row)*mtrx.rev_m[1][0]; ! part_y = (r+start_row)*mtrx.rev_m[1][1]; for (c=0; c < num_cols; c++) { ! int x, y; ! x = (int)((c+start_col)*mtrx.rev_m[0][0]+part_x); ! y = (int)((c+start_col)*mtrx.rev_m[0][1]+part_y); ! if (x>=0 && x=0 && y= ((double)0) && x < ((double)image_w) && ! y >= ((double)0) && y < ((double)image_h)) { ! int new_x=(int)x, new_y=(int)y; ! ! if (XGetPixel(src_bitmap_image,new_x,new_y) != 0) { ! XPutPixel(dest_image, c, r, XGetPixel(src_image,new_x,new_y)); } else { XPutPixel(dest_bitmap_image, c, r, 0); *************** *** 440,443 **** --- 443,447 ---- for (r=0; r < num_rows; r++) { int y=abs_offset_y+ABS_SIZE(r); + double dy=((double)y)+0.5; if (do_msg && ((r & 0xf) == 0)) { *************** *** 452,459 **** } for (c=0; c < num_cols; c++) { - double new_dx=(double)0, new_dy=(double)0; int x=abs_offset_x+ABS_SIZE(c); ! ReverseTransformDoublePointThroughCTM(x, y, ObjPtr->ctm, &new_dx, &new_dy); new_dx += (double)(ObjPtr->x-ObjPtr->orig_obbox.ltx); --- 456,464 ---- } for (c=0; c < num_cols; c++) { int x=abs_offset_x+ABS_SIZE(c); + double dx=((double)x)+0.5; + double new_dx=(double)0, new_dy=(double)0; ! ReverseTransformDoublePointThroughCTM(dx, dy, ObjPtr->ctm, &new_dx, &new_dy); new_dx += (double)(ObjPtr->x-ObjPtr->orig_obbox.ltx); *************** *** 461,466 **** if (new_dx >= ((double)0) && new_dx < ((double)image_w) && new_dy >= ((double)0) && new_dy < ((double)image_h)) { ! int new_x=round(new_dx); ! int new_y=round(new_dy); if (new_x < 0) new_x = 0; --- 466,470 ---- if (new_dx >= ((double)0) && new_dx < ((double)image_w) && new_dy >= ((double)0) && new_dy < ((double)image_h)) { ! int new_x=(int)new_dx, new_y=(int)new_dy; if (new_x < 0) new_x = 0; *** rect.e.orig Sat Mar 27 10:41:32 1999 --- rect.e Sat Mar 27 10:41:32 1999 *************** *** 59,63 **** struct XfrmMtrxRec *, int *NewX, int *NewY)); ! extern void ReverseTransformDoublePointThroughCTM ARGS_DECL((int X, int Y, struct XfrmMtrxRec *, double *NewDx, --- 59,64 ---- struct XfrmMtrxRec *, int *NewX, int *NewY)); ! extern void ReverseTransformDoublePointThroughCTM ARGS_DECL((double X, ! double Y, struct XfrmMtrxRec *, double *NewDx, *************** *** 94,97 **** --- 95,100 ---- extern int Inside ARGS_DECL((struct BBRec Rect1, struct BBRec Rect2)); extern int PointInBBox ARGS_DECL((int X, int Y, struct BBRec Rect)); + extern int PointInIntPolygon ARGS_DECL((int X, int Y, int NumPts, + IntPoint *)); extern int PointInPolygon ARGS_DECL((int X, int Y, int NumPts, XPoint *)); extern int PointInPoly ARGS_DECL((int X, int Y, int NumPts, XPoint *, *** tangram2.e.orig Sat Mar 27 10:41:33 1999 --- tangram2.e Sat Mar 27 10:41:33 1999 *************** *** 1,3 **** --- 1,4 ---- /* + * Author: Daniel Ratton Figueiredo * Author: William Chia-Wei Cheng (william@cs.ucla.edu) * *** patchlvl.h.orig Sat Mar 27 10:41:34 1999 --- patchlvl.h Sat Mar 27 10:41:34 1999 *************** *** 35,39 **** #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 3 #endif /*_TGIF_PATCHLEVEL_H_*/ --- 35,39 ---- #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 4 #endif /*_TGIF_PATCHLEVEL_H_*/ *** Makefile.noimake.orig Sat Mar 27 10:41:35 1999 --- Makefile.noimake Sat Mar 27 10:41:35 1999 *************** *** 100,103 **** --- 100,115 ---- -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT + #-D_DONT_USE_PORTABLE_LOCALE + # Include the above line if don't want to use the portable locale. + # (Portable locale is "C" for all locale categories.) + #-D_NO_RECURSIVE_EXTERN + # Include the above line if your C compiler cannot handle + # "#define extern extern". The /bin/cc compiler on HP-UX reports a + # Recursion in macro "extern" when the above define is used. + #-D_DL_EXPORT_UNDERSCORE + # Include the above line if you use export filters and there is an entry + # point to an export filter named "_TgifExportFilterMain" (and there's + # no entry point named "TgifExportFilterMain"). One can see all the + # entry points to an export filter by running 'nm' against it. #-D_NO_XCIN # Include the above line if you do not want to include the code *************** *** 125,129 **** # -ldl above. #-D_NO_LOCALE_SUPPORT ! # Include the above line if you don't have . #-D_METRIC_PIX_PER_INCH # Include the above line if you want to use 127 pixels per inch --- 137,143 ---- # -ldl above. #-D_NO_LOCALE_SUPPORT ! # Include the above line if you don't have . If this ! # is the case and you don't have , you must also use ! # -D_NO_XIM because "convxim.c" assumes that you have . #-D_METRIC_PIX_PER_INCH # Include the above line if you want to use 127 pixels per inch *************** *** 133,140 **** # Include the above line if you do not have the gettimeofday() # function but have the ftime() function. #-D_TGIF_WB # Include the above line if you want to include the whiteboard feature # by Renato Santana . This flag is being ! # obsoleted by the people at ufrj.br. Please do not use it for tgif-4. #-DBSD_COMP # Include the above line if you are compiling on a Solaris (or --- 147,160 ---- # Include the above line if you do not have the gettimeofday() # function but have the ftime() function. + #-D_TANGRAM_II + # Include the above line if you want to include the Tangram-II features + # by Carlos Fisch de Brito, Luiz Rogerio Goncalves de Carvalho, and + # Denise Jorge de Oliveira of the + # Tangram-II team of the Universidade Federal do Rio de Janeiro. These + # features are under development and highly experimental. #-D_TGIF_WB # Include the above line if you want to include the whiteboard feature # by Renato Santana . This flag is being ! # obsoleted by the people at ufrj.br. Please do not use it for tgif-4.x. #-DBSD_COMP # Include the above line if you are compiling on a Solaris (or *************** *** 142,147 **** # (If you see the error that FIONBIO is not defined when compiling # tcp.c, then you probably need this.) ! #-D_HANDLE_SIGCHLD ! # Include the above line if there are defunct tgif child processes. #-D_NO_LSTAT # Include the above line if lstat() is not available. In this case, --- 162,167 ---- # (If you see the error that FIONBIO is not defined when compiling # tcp.c, then you probably need this.) ! #-D_BACKGROUND_DONT_FORK ! # Try the above line if there are defunct tgif child processes. #-D_NO_LSTAT # Include the above line if lstat() is not available. In this case, *************** *** 165,169 **** #-D_BSD # Include the above line in the DEFINES if the select() function can ! # does not be found for AIX systems. #-DNO_STRSTR # Include the above line in the DEFINES if you do not have the strstr() --- 185,191 ---- #-D_BSD # Include the above line in the DEFINES if the select() function can ! # does not be found for AIX systems (such as RS6000). Also, on AIX ! # systems, if you see garbage file names when you try to open files, ! # try this flag to make direct and dirent equivalent (in ). #-DNO_STRSTR # Include the above line in the DEFINES if you do not have the strstr() *************** *** 179,183 **** # Include the above line in the DEFINES if you don't want the black and # the white colors to be freed when tgif initializes itself. You should ! # not need to do this unless to get around some server bugs. #-DUSE_XAPPLRESDIR # Include the above line in the DEFINES if $XAPPLRESDIR/Tgif is used to --- 201,205 ---- # Include the above line in the DEFINES if you don't want the black and # the white colors to be freed when tgif initializes itself. You should ! # not need to do this unless you need to get around some server bugs. #-DUSE_XAPPLRESDIR # Include the above line in the DEFINES if $XAPPLRESDIR/Tgif is used to *************** *** 184,192 **** # specify the resource file. If your system does not have putenv() # (such as IBM-RT), then this won't work. #-DUSE_XT_INITIALIZE # This will cause the XToolkit to be initialized so that the X defaults # are obtained from the Xt directories. This should only be used when ! # USE_XAPPLRESDIR option is NOT used. Please remember to use the ! # LDFLAGS with -lXmu -lXt above. #-DNO_THIN_LINE # Include the above line in the DEFINES if a line width of 0 causes --- 206,217 ---- # specify the resource file. If your system does not have putenv() # (such as IBM-RT), then this won't work. + #-DXAPPLOADDIR_DEF + # If you define USE_XAPPLRESDIR, define this to a default directory + # to use in case $XAPPLRESDIR isn't set. #-DUSE_XT_INITIALIZE # This will cause the XToolkit to be initialized so that the X defaults # are obtained from the Xt directories. This should only be used when ! # USE_XAPPLRESDIR option is NOT used. Please remember to use the ! # LOCAL_LIBRARIES with $(XTOOLLIB) $(XMULIB) above. #-DNO_THIN_LINE # Include the above line in the DEFINES if a line width of 0 causes *** Imakefile.orig Sat Mar 27 10:41:36 1999 --- Imakefile Sat Mar 27 10:41:36 1999 *************** *** 53,57 **** $(MOREDEFINES) ! TGIFVERSION = 4.1.3 XCOMM Things to try to add to the DEFINES line above: --- 53,57 ---- $(MOREDEFINES) ! TGIFVERSION = 4.1.4 XCOMM Things to try to add to the DEFINES line above: *** HISTORY.orig Sat Mar 27 10:41:37 1999 --- HISTORY Sat Mar 27 10:41:37 1999 *************** *** 1,2 **** --- 1,14 ---- + -----------------------> tgif-4.1.3 => tgif-4.1.4 <----------------------- + Here's a short list of added features/bug fixes. + + 1) Fix bugs with truncated text objects in exporting to GIF files where + that are rotated text objects. + 2) Fix bugs with underlined text. Sometimes, a thick line is used to + draw the underline. + 3) Add PS support the following 8-bit ISO-Latin-1 characters: + "onesuperior", "onequarter", "onehalf", and "threequarters". Thanks to + Antonio Miguel Corbi Bellot for + pointing out the problem. + -----------------------> tgif-4.1.2 => tgif-4.1.3 <----------------------- Here's a short list of added features/bug fixes. *** Tgif.tmpl-irix.orig Sat Mar 27 10:41:38 1999 --- Tgif.tmpl-irix Sat Mar 27 10:41:38 1999 *************** *** 42,46 **** #endif ! OPTIMIZER = -O2 -Olimit 1500 EXTRA_LDOPTIONS = --- 42,47 ---- #endif ! OPTIMIZER = -O2 -Olimit 1500 XCOMM for IRIX 5.3 ! OPTIMIZER = -O2 -OPT:Olimit=1500 XCOMM for IRIX 6.2 EXTRA_LDOPTIONS =