home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-21 | 32.6 KB | 1,062 lines |
- Newsgroups: comp.sources.x
- From: envbvs@epb12.lbl.gov (Brian V. Smith)
- Subject: v21i029: xfig - Draw amd manipulate objects in an X-Window, Patch02i/16
- Message-ID: <1993Oct21.185854.7192@sparky.sterling.com>
- X-Md4-Signature: b79c3efb3ec403b57293865e99b8cd70
- Sender: chris@sparky.sterling.com (Chris Olson)
- Organization: Sterling Software
- Date: Thu, 21 Oct 1993 18:58:54 GMT
- Approved: chris@sterling.com
-
- Submitted-by: envbvs@epb12.lbl.gov (Brian V. Smith)
- Posting-number: Volume 21, Issue 29
- Archive-name: xfig/patch02i
- Environment: patch, X11, xfig
- Patch-To: xfig: Volume 19, Issue 113-139
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: xfig.03
- # Wrapped by chris@sparky on Thu Oct 21 13:40:06 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 9 (of 16)."'
- if test -f 'xfig.03' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xfig.03'\"
- else
- echo shar: Extracting \"'xfig.03'\" \(30182 characters\)
- sed "s/^X//" >'xfig.03' <<'END_OF_FILE'
- X generic_window("POLYLINE", "Box", &box_ic, done_line, 1, 0);
- X p1 = *new_l->points;
- X p2 = *new_l->points->next->next;
- X! xy_panel(p1.x, p1.y, "First Corner:", &x1_panel, &y1_panel);
- X! xy_panel(p2.x, p2.y, "Opposite Corner:", &x2_panel, &y2_panel);
- X break;
- X case T_ARC_BOX:
- X generic_window("POLYLINE", "ArcBox", &arc_box_ic, done_line, 1, 0);
- X p1 = *new_l->points;
- X p2 = *new_l->points->next->next;
- X! xy_panel(p1.x, p1.y, "First Corner:", &x1_panel, &y1_panel);
- X! xy_panel(p2.x, p2.y, "Opposite Corner:", &x2_panel, &y2_panel);
- X int_panel(new_l->radius, form, "Radius =", &radius);
- X break;
- X case T_EPS_BOX:
- X--- 475,489 ----
- X generic_window("POLYLINE", "Box", &box_ic, done_line, 1, 0);
- X p1 = *new_l->points;
- X p2 = *new_l->points->next->next;
- X! xy_panel(p1.x, p1.y, "First Corner", &x1_panel, &y1_panel);
- X! xy_panel(p2.x, p2.y, "Opposite Corner", &x2_panel, &y2_panel);
- X break;
- X case T_ARC_BOX:
- X generic_window("POLYLINE", "ArcBox", &arc_box_ic, done_line, 1, 0);
- X p1 = *new_l->points;
- X p2 = *new_l->points->next->next;
- X! xy_panel(p1.x, p1.y, "First Corner", &x1_panel, &y1_panel);
- X! xy_panel(p2.x, p2.y, "Opposite Corner", &x2_panel, &y2_panel);
- X int_panel(new_l->radius, form, "Radius =", &radius);
- X break;
- X case T_EPS_BOX:
- X***************
- X*** 495,502 ****
- X str_panel(new_l->eps->file, "EPS Filename =", &eps_name_panel);
- X p1 = *new_l->points;
- X p2 = *new_l->points->next->next;
- X! xy_panel(p1.x, p1.y, "First Corner:", &x1_panel, &y1_panel);
- X! xy_panel(p2.x, p2.y, "Opposite corner:", &x2_panel, &y2_panel);
- X
- X /* make popup flipped menu */
- X FirstArg(XtNfromVert, below);
- X--- 494,501 ----
- X str_panel(new_l->eps->file, "EPS Filename =", &eps_name_panel);
- X p1 = *new_l->points;
- X p2 = *new_l->points->next->next;
- X! xy_panel(p1.x, p1.y, "First Corner", &x1_panel, &y1_panel);
- X! xy_panel(p2.x, p2.y, "Opposite corner", &x2_panel, &y2_panel);
- X
- X /* make popup flipped menu */
- X FirstArg(XtNfromVert, below);
- X***************
- X*** 802,811 ****
- X XtNumber(special_text_items),
- X special_text_panel, special_text_select);
- X
- X! xy_panel(new_t->base_x, new_t->base_y, "Origin:", &x1_panel, &y1_panel);
- X font_image_panel(new_psflag ? psfont_menu_bitmaps[new_t->font + 1] :
- X! latexfont_menu_bitmaps[new_t->font], "Font:", &font_panel);
- X! str_panel(new_t->cstring, "Text:", &text_panel);
- X }
- X
- X static
- X--- 801,810 ----
- X XtNumber(special_text_items),
- X special_text_panel, special_text_select);
- X
- X! xy_panel(new_t->base_x, new_t->base_y, "Origin", &x1_panel, &y1_panel);
- X font_image_panel(new_psflag ? psfont_menu_bitmaps[new_t->font + 1] :
- X! latexfont_menu_bitmaps[new_t->font], "Font", &font_panel);
- X! str_panel(new_t->cstring, "Text", &text_panel);
- X }
- X
- X static
- X***************
- X*** 832,837 ****
- X--- 831,837 ----
- X new_t->color = color;
- X new_t->depth = atoi(panel_get_value(depth_panel));
- X new_t->angle = M_PI / 180 * atoi(panel_get_value(angle_panel));
- X+ fixangle(&new_t->angle); /* keep between 0 and 2PI */
- X new_t->base_x = atoi(panel_get_value(x1_panel));
- X new_t->base_y = atoi(panel_get_value(y1_panel));
- X if (new_t->cstring)
- X***************
- X*** 839,856 ****
- X s = panel_get_value(text_panel);
- X new_t->cstring = new_string(strlen(s) + 1);
- X strcpy(new_t->cstring, s);
- X canvas_font = lookfont(x_fontnum(new_t->flags, new_t->font),
- X! new_t->size, new_t->angle*180.0/M_PI);
- X! new_t->fontstruct = canvas_font;
- X size = pf_textwidth(canvas_font, strlen(s), s);
- X new_t->height = size.y;
- X new_t->length = size.x;
- X }
- X
- X static
- X done_text()
- X {
- X! int xmin, ymin, xmax, ymax;
- X
- X old_t = new_t->next;
- X switch (button_result) {
- X--- 839,858 ----
- X s = panel_get_value(text_panel);
- X new_t->cstring = new_string(strlen(s) + 1);
- X strcpy(new_t->cstring, s);
- X+ /* get the fontstruct for zoom = 1 to get the size of the string */
- X canvas_font = lookfont(x_fontnum(new_t->flags, new_t->font),
- X! new_t->size);
- X size = pf_textwidth(canvas_font, strlen(s), s);
- X new_t->height = size.y;
- X new_t->length = size.x;
- X+ /* now set the fontstruct for this zoom scale */
- X+ reload_text_fstruct(new_t);
- X }
- X
- X static
- X done_text()
- X {
- X! int xmin, ymin, xmax, ymax, dum;
- X
- X old_t = new_t->next;
- X switch (button_result) {
- X***************
- X*** 865,871 ****
- X get_new_text_values();
- X new_t->next = NULL;
- X change_text(old_t, new_t);
- X! text_bound(new_t, &xmin, &ymin, &xmax, &ymax);
- X redisplay_zoomed_region(xmin, ymin, xmax, ymax);
- X reset_cursor();
- X break;
- X--- 867,874 ----
- X get_new_text_values();
- X new_t->next = NULL;
- X change_text(old_t, new_t);
- X! text_bound(new_t, &xmin, &ymin, &xmax, &ymax,
- X! &dum, &dum, &dum, &dum, &dum, &dum, &dum, &dum);
- X redisplay_zoomed_region(xmin, ymin, xmax, ymax);
- X reset_cursor();
- X break;
- X***************
- X*** 872,878 ****
- X case CANCEL:
- X if (changed) {
- X draw_text(new_t, ERASE);
- X! text_bound(old_t, &xmin, &ymin, &xmax, &ymax);
- X redisplay_zoomed_region(xmin, ymin, xmax, ymax);
- X } else {
- X toggle_textmarker(old_t);
- X--- 875,882 ----
- X case CANCEL:
- X if (changed) {
- X draw_text(new_t, ERASE);
- X! text_bound(old_t, &xmin, &ymin, &xmax, &ymax,
- X! &dum, &dum, &dum, &dum, &dum, &dum, &dum, &dum);
- X redisplay_zoomed_region(xmin, ymin, xmax, ymax);
- X } else {
- X toggle_textmarker(old_t);
- X***************
- X*** 928,939 ****
- X &angle_panel);
- X
- X if (ellipse_flag) {
- X! f_pos_panel(&new_e->center, "Center:",
- X &x1_panel, &y1_panel);
- X! f_pos_panel(&new_e->radiuses, "Radiuses:",
- X &x2_panel, &y2_panel);
- X } else {
- X! f_pos_panel(&new_e->center, "Center:",
- X &x1_panel, &y1_panel);
- X int_panel(new_e->radiuses.x, form, "Radius =",
- X &x2_panel);
- X--- 932,943 ----
- X &angle_panel);
- X
- X if (ellipse_flag) {
- X! f_pos_panel(&new_e->center, "Center",
- X &x1_panel, &y1_panel);
- X! f_pos_panel(&new_e->radiuses, "Radiuses",
- X &x2_panel, &y2_panel);
- X } else {
- X! f_pos_panel(&new_e->center, "Center",
- X &x1_panel, &y1_panel);
- X int_panel(new_e->radiuses.x, form, "Radius =",
- X &x2_panel);
- X***************
- X*** 945,950 ****
- X--- 949,955 ----
- X {
- X get_generic_vals(new_e);
- X new_e->angle = M_PI / 180 * atoi(panel_get_value(angle_panel));
- X+ fixangle(&new_e->angle); /* keep between 0 and 2PI */
- X get_f_pos(&new_e->center, x1_panel, y1_panel);
- X if (ellipse_flag)
- X get_f_pos(&new_e->radiuses, x2_panel, y2_panel);
- X***************
- X*** 965,972 ****
- X static
- X done_ellipse()
- X {
- X- int xmin, ymin, xmax, ymax;
- X-
- X old_e = new_e->next;
- X switch (button_result) {
- X case APPLY:
- X--- 970,975 ----
- X***************
- X*** 1009,1017 ****
- X put_generic_vals(new_a);
- X put_generic_arrows(new_a);
- X generic_window("ARC", "Specified by 3 points", &arc_ic, done_arc, 1, 1);
- X! f_pos_panel(&new_a->point[0], "p1:", &x1_panel, &y1_panel);
- X! f_pos_panel(&new_a->point[1], "p2:", &x2_panel, &y2_panel);
- X! f_pos_panel(&new_a->point[2], "p3:", &x3_panel, &y3_panel);
- X }
- X
- X static
- X--- 1012,1020 ----
- X put_generic_vals(new_a);
- X put_generic_arrows(new_a);
- X generic_window("ARC", "Specified by 3 points", &arc_ic, done_arc, 1, 1);
- X! f_pos_panel(&new_a->point[0], "p1", &x1_panel, &y1_panel);
- X! f_pos_panel(&new_a->point[1], "p2", &x2_panel, &y2_panel);
- X! f_pos_panel(&new_a->point[2], "p3", &x3_panel, &y3_panel);
- X }
- X
- X static
- X***************
- X*** 1039,1046 ****
- X static
- X done_arc()
- X {
- X- int xmin, ymin, xmax, ymax;
- X-
- X old_a = new_a->next;
- X switch (button_result) {
- X case APPLY:
- X--- 1042,1047 ----
- X***************
- X*** 1109,1116 ****
- X static
- X done_spline()
- X {
- X- int xmin, ymin, xmax, ymax;
- X-
- X old_s = new_s->next;
- X switch (button_result) {
- X case APPLY:
- X--- 1110,1115 ----
- X***************
- X*** 1259,1270 ****
- X Pixmap image_pm;
- X static int actions_added=0;
- X
- X- #ifdef OPENWIN_BUG
- X- /* to cater for OpenWindows bug - see below */
- X- Pixel fg, bg;
- X-
- X- #endif
- X-
- X static char *linestyle_items[] = {
- X "Solid Line ", "Dashed Line", "Dotted Line"};
- X static char *fill_style_items[] = {
- X--- 1258,1263 ----
- X***************
- X*** 1318,1325 ****
- X
- X /* doesn't already exist, create a pixmap from the data (ala panel.c) */
- X /* OpenWindows bug doesn't handle a 1-plane bitmap on a n-plane display */
- X if (!image_pm) {
- X! #ifdef OPENWIN_BUG
- X /* get the foreground/background of the widget */
- X FirstArg(XtNforeground, &fg);
- X NextArg(XtNbackground, &bg);
- X--- 1311,1319 ----
- X
- X /* doesn't already exist, create a pixmap from the data (ala panel.c) */
- X /* OpenWindows bug doesn't handle a 1-plane bitmap on a n-plane display */
- X+ /* so we use CreatePixmap.... */
- X if (!image_pm) {
- X! Pixel fg, bg;
- X /* get the foreground/background of the widget */
- X FirstArg(XtNforeground, &fg);
- X NextArg(XtNbackground, &bg);
- X***************
- X*** 1328,1337 ****
- X image_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
- X (char *) icon->data, icon->width, icon->height,
- X fg, bg, XDefaultDepthOfScreen(tool_s));
- X- #else
- X- image_pm = XCreateBitmapFromData(tool_d, canvas_win,
- X- (char *) icon->data, icon->width, icon->height);
- X- #endif
- X pix_table[i].image_pm = image_pm;
- X pix_table[i].image = icon;
- X }
- X--- 1322,1327 ----
- X***************
- X*** 1808,1826 ****
- X <Key>F18: PastePanelKey()\n";
- X
- X static
- X! str_panel(string, label, pi_x)
- X char *string;
- X! char *label;
- X Widget *pi_x;
- X {
- X int width, nlines, i;
- X Dimension pwidth;
- X PIX_FONT temp_font;
- X
- X FirstArg(XtNfromVert, below);
- X! NextArg(XtNlabel, label);
- X NextArg(XtNborderWidth, 0);
- X! beside = XtCreateManagedWidget(label, labelWidgetClass, form, Args, ArgCount);
- X
- X /* get the font and width of above label widget */
- X FirstArg(XtNfont, &temp_font);
- X--- 1798,1826 ----
- X <Key>F18: PastePanelKey()\n";
- X
- X static
- X! str_panel(string, name, pi_x)
- X char *string;
- X! char *name;
- X Widget *pi_x;
- X {
- X int width, nlines, i;
- X Dimension pwidth;
- X PIX_FONT temp_font;
- X+ char *labelname, *textname;
- X
- X+ /* make the labels of the widgets xxx_lab for the label part and xxx_text for
- X+ the asciiwidget part */
- X+ labelname = (char *) malloc(strlen(name)+5);
- X+ textname = (char *) malloc(strlen(name)+6);
- X+ strcpy(labelname,name);
- X+ strcat(labelname,"_lab");
- X+ strcpy(textname,name);
- X+ strcat(textname,"_text");
- X+
- X FirstArg(XtNfromVert, below);
- X! NextArg(XtNlabel, name);
- X NextArg(XtNborderWidth, 0);
- X! beside = XtCreateManagedWidget(labelname, labelWidgetClass, form, Args, ArgCount);
- X
- X /* get the font and width of above label widget */
- X FirstArg(XtNfont, &temp_font);
- X***************
- X*** 1852,1858 ****
- X NextArg(XtNscrollHorizontal, XawtextScrollWhenNeeded);
- X NextArg(XtNscrollVertical, XawtextScrollWhenNeeded);
- X
- X! *pi_x = XtCreateManagedWidget(label, asciiTextWidgetClass, form, Args, ArgCount);
- X
- X /* make Newline do nothing for now */
- X XtOverrideTranslations(*pi_x, XtParseTranslationTable(text_translations));
- X--- 1852,1858 ----
- X NextArg(XtNscrollHorizontal, XawtextScrollWhenNeeded);
- X NextArg(XtNscrollVertical, XawtextScrollWhenNeeded);
- X
- X! *pi_x = XtCreateManagedWidget(textname, asciiTextWidgetClass, form, Args, ArgCount);
- X
- X /* make Newline do nothing for now */
- X XtOverrideTranslations(*pi_x, XtParseTranslationTable(text_translations));
- X***************
- X*** 1861,1866 ****
- X--- 1861,1869 ----
- X XtOverrideTranslations(*pi_x, XtParseTranslationTable(local_translations));
- X
- X below = *pi_x;
- X+
- X+ free((char *) textname);
- X+ free((char *) labelname);
- X }
- X
- X static
- Xdiff -rc xfig.2.1.7a/e_glue.c xfig.2.1.8/e_glue.c
- X*** xfig.2.1.7a/e_glue.c Tue Jan 5 11:41:16 1993
- X--- xfig.2.1.8/e_glue.c Thu Jun 17 10:05:03 1993
- X***************
- X*** 15,20 ****
- X--- 15,21 ----
- X #include "mode.h"
- X #include "object.h"
- X #include "paintop.h"
- X+ #include "u_bound.h"
- X #include "u_create.h"
- X #include "u_draw.h"
- X #include "u_elastic.h"
- X***************
- X*** 147,152 ****
- X--- 148,173 ----
- X compound_bound(c, &c->nwcorner.x, &c->nwcorner.y,
- X &c->secorner.x, &c->secorner.y);
- X
- X+ /* if zero width or height in the compound, adjust to next positioning
- X+ grid point or a few pixels if positioning grid is "ANY" */
- X+ if (c->nwcorner.x == c->secorner.x) {
- X+ if (cur_pointposn == P_ANY) {
- X+ c->secorner.x += MARK_SIZ+1; /* just enough to clear the markers */
- X+ }
- X+ else {
- X+ c->secorner.x += posn_rnd[cur_pointposn];
- X+ ceil_coords(c->secorner.x);
- X+ }
- X+ }
- X+ if (c->nwcorner.y == c->secorner.y) {
- X+ if (cur_pointposn == P_ANY) {
- X+ c->secorner.y += MARK_SIZ+1; /* just enough to clear the markers */
- X+ }
- X+ else {
- X+ c->secorner.y += posn_rnd[cur_pointposn];
- X+ ceil_coords(c->secorner.y);
- X+ }
- X+ }
- X c->next = NULL;
- X clean_up();
- X set_action(F_GLUE);
- X***************
- X*** 404,415 ****
- X int dum;
- X
- X for (t = objects.texts; t != NULL; t = t->next) {
- X! if (appres.textoutline) {
- X! text_bound_actual(t, t->angle, &txmin, &tymin, &txmax, &tymax,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X! } else {
- X! text_bound(t, &txmin, &tymin, &txmax, &tymax);
- X! }
- X if (xmin > txmin || xmax < txmax ||
- X ymin > tymin || ymax < tymax)
- X continue;
- X--- 425,432 ----
- X int dum;
- X
- X for (t = objects.texts; t != NULL; t = t->next) {
- X! text_bound(t, &txmin, &tymin, &txmax, &tymax,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X if (xmin > txmin || xmax < txmax ||
- X ymin > tymin || ymax < tymax)
- X continue;
- Xdiff -rc xfig.2.1.7a/e_movept.c xfig.2.1.8/e_movept.c
- X*** xfig.2.1.7a/e_movept.c Tue Feb 16 15:38:22 1993
- X--- xfig.2.1.8/e_movept.c Tue Sep 7 09:38:46 1993
- X***************
- X*** 25,30 ****
- X--- 25,31 ----
- X #include "w_mousefun.h"
- X
- X extern void force_anglegeom(), force_noanglegeom();
- X+ extern scale_radius();
- X
- X /* local routine declarations */
- X
- X***************
- X*** 51,57 ****
- X static int fix_movedsplinepoint();
- X static int fix_box();
- X static int fix_movedlinepoint();
- X- static int fix_movedlatexlinepoint();
- X
- X static int cancel_movedarcpoint();
- X static int cancel_movedellipsepoint();
- X--- 52,57 ----
- X***************
- X*** 88,94 ****
- X
- X static
- X init_stretch_move_point(obj, type, x, y, p, q)
- X! char *obj;
- X int type, x, y;
- X F_point *p, *q;
- X {
- X--- 88,94 ----
- X
- X static
- X init_stretch_move_point(obj, type, x, y, p, q)
- X! F_line *obj;
- X int type, x, y;
- X F_point *p, *q;
- X {
- X***************
- X*** 213,218 ****
- X--- 213,220 ----
- X elastic_cbd();
- X break;
- X }
- X+ /* show current radius(ii) */
- X+ (canvas_locmove_proc)(cur_x, cur_y);
- X from_x = cur_x;
- X from_y = cur_y;
- X set_temp_cursor(crosshair_cursor);
- X***************
- X*** 340,345 ****
- X--- 342,349 ----
- X canvas_locmove_proc = reshaping_arc;
- X canvas_leftbut_proc = fix_movedarcpoint;
- X canvas_rightbut_proc = cancel_movedarcpoint;
- X+ /* show current length(s) */
- X+ (canvas_locmove_proc)(cur_x, cur_y);
- X }
- X
- X static
- X***************
- X*** 435,440 ****
- X--- 439,446 ----
- X left_point = p, p = p->next);
- X }
- X }
- X+ /* show current length(s) */
- X+ (canvas_locmove_proc)(cur_x, cur_y);
- X elastic_linelink();
- X canvas_leftbut_proc = fix_movedsplinepoint;
- X canvas_rightbut_proc = cancel_movedsplinepoint;
- X***************
- X*** 519,524 ****
- X--- 525,532 ----
- X canvas_locmove_proc = constrained_resizing_box;
- X canvas_leftbut_proc = prescale_compound;
- X canvas_rightbut_proc = cancel_compound;
- X+ /* show current length(s) */
- X+ (canvas_locmove_proc)(cur_x, cur_y);
- X }
- X
- X static
- X***************
- X*** 606,611 ****
- X--- 614,621 ----
- X canvas_locmove_proc = constrained_resizing_box;
- X canvas_leftbut_proc = fix_box;
- X canvas_rightbut_proc = cancel_box;
- X+ /* show current length(s) */
- X+ (canvas_locmove_proc)(cur_x, cur_y);
- X return;
- X
- X case T_POLYLINE:
- X***************
- X*** 657,662 ****
- X--- 667,674 ----
- X elastic_linelink();
- X canvas_leftbut_proc = fix_movedlinepoint;
- X canvas_rightbut_proc = cancel_movedlinepoint;
- X+ /* show current length(s) */
- X+ (canvas_locmove_proc)(cur_x, cur_y);
- X }
- X
- X static
- X***************
- X*** 683,688 ****
- X--- 695,702 ----
- X new_l->eps->flipped = 1 - new_l->eps->flipped;
- X }
- X assign_newboxpoint(new_l, fix_x, fix_y, x, y);
- X+ if (new_l->type == T_ARC_BOX) /* don't scale radius unless too large */
- X+ scale_radius(new_l, new_l);
- X change_line(cur_l, new_l);
- X draw_line(new_l, PAINT);
- X toggle_linemarker(new_l);
- Xdiff -rc xfig.2.1.7a/e_scale.c xfig.2.1.8/e_scale.c
- X*** xfig.2.1.7a/e_scale.c Tue Feb 16 15:26:43 1993
- X--- xfig.2.1.8/e_scale.c Fri Sep 3 15:18:43 1993
- X***************
- X*** 725,730 ****
- X--- 725,745 ----
- X p->x = round(refx + (p->x - refx) * sx);
- X p->y = round(refy + (p->y - refy) * sy);
- X }
- X+ /* now scale the radius */
- X+ if (l->type == T_ARC_BOX) {
- X+ int h,w;
- X+ /* scale by the average of height/width factor */
- X+ l->radius = round(l->radius * (sx+sy)/2);
- X+ /* if the radius is larger than half the width or height, set it to the
- X+ minimum of the width or heigth divided by 2 */
- X+ w = abs(l->points->x-l->points->next->next->x);
- X+ h = abs(l->points->y-l->points->next->next->y);
- X+ if ((l->radius > w/2) || (l->radius > h/2))
- X+ l->radius = min2(w,h)/2;
- X+ /* finally, if it is 0, make it 1 */
- X+ if (l->radius == 0)
- X+ l->radius = 1;
- X+ }
- X }
- X
- X scale_spline(s, sx, sy, refx, refy)
- X***************
- X*** 753,765 ****
- X int refx, refy;
- X {
- X int i;
- X
- X for (i = 0; i < 3; i++) {
- X a->point[i].x = round(refx + (a->point[i].x - refx) * sx);
- X a->point[i].y = round(refy + (a->point[i].y - refy) * sy);
- X }
- X! compute_arccenter(a->point[0], a->point[1], a->point[2],
- X! &a->center.x, &a->center.y);
- X a->direction = compute_direction(a->point[0], a->point[1], a->point[2]);
- X }
- X
- X--- 768,803 ----
- X int refx, refy;
- X {
- X int i;
- X+ F_point p[3];
- X
- X for (i = 0; i < 3; i++) {
- X+ /* save original points for co-linear check later */
- X+ p[i].x = a->point[i].x;
- X+ p[i].y = a->point[i].y;
- X a->point[i].x = round(refx + (a->point[i].x - refx) * sx);
- X a->point[i].y = round(refy + (a->point[i].y - refy) * sy);
- X }
- X! if (compute_arccenter(a->point[0], a->point[1], a->point[2],
- X! &a->center.x, &a->center.y) == 0) {
- X! /* the new arc is co-linear, move the middle point one pixel */
- X! if (a->point[0].x == a->point[1].x) { /* vertical, move middle left or right */
- X! if (p[1].x > p[0].x)
- X! a->point[1].x++; /* convex to the right -> ) */
- X! else
- X! a->point[1].x--; /* convex to the left -> ( */
- X! }
- X! /* check ALSO for horizontally co-linear in case all three points are equal */
- X! if (a->point[0].y == a->point[1].y) { /* horizontal, move middle point up or down */
- X! if (p[1].y > p[0].y)
- X! a->point[1].y++; /* curves up */
- X! else
- X! a->point[1].y--; /* curves down */
- X! }
- X! /* now check if the endpoints are equal, move one of them */
- X! if (a->point[0].x == a->point[2].x &&
- X! a->point[0].y == a->point[2].y)
- X! a->point[2].x++;
- X! }
- X a->direction = compute_direction(a->point[0], a->point[1], a->point[2]);
- X }
- X
- X***************
- X*** 926,931 ****
- X--- 964,971 ----
- X new_l->eps->flipped = 1 - new_l->eps->flipped;
- X if (signof(fix_y - from_y) != signof(fix_y - y))
- X new_l->eps->flipped = 1 - new_l->eps->flipped;
- X+ } else if (new_l->type == T_ARC_BOX) { /* scale the radius also */
- X+ scale_radius(cur_l, new_l);
- X }
- X change_line(cur_l, new_l);
- X draw_line(new_l, PAINT);
- X***************
- X*** 933,938 ****
- X--- 973,1000 ----
- X wrapup_scale();
- X }
- X
- X+ scale_radius(old, new)
- X+ F_line *old, *new;
- X+ {
- X+ int owd,oht, nwd, nht;
- X+ float wdscale, htscale;
- X+ owd = abs(old->points->x - old->points->next->next->x);
- X+ oht = abs(old->points->y - old->points->next->next->y);
- X+ nwd = abs(new->points->x - new->points->next->next->x);
- X+ nht = abs(new->points->y - new->points->next->next->y);
- X+ wdscale = (float) nwd/owd;
- X+ htscale = (float) nht/oht;
- X+ /* scale by the average of height/width factor */
- X+ new->radius = round(new->radius * (wdscale+htscale)/2);
- X+ /* next, if the radius is larger than half the width, set it to the
- X+ minimum of the width or heigth divided by 2 */
- X+ if ((new->radius > nwd/2) || (new->radius > nht/2))
- X+ new->radius = min2(nwd,nht)/2;
- X+ /* finally, if it is 0, make it 1 */
- X+ if (new->radius == 0)
- X+ new->radius = 1;
- X+ }
- X+
- X static
- X assign_newboxpoint(b, x1, y1, x2, y2)
- X F_line *b;
- X***************
- X*** 1021,1026 ****
- X--- 1083,1091 ----
- X old_l->next = cur_l;
- X /* now change the original to become the new object */
- X rescale_points(cur_l->points, x, y);
- X+ /* and scale the radius if ARC_BOX */
- X+ if (cur_l->type == T_ARC_BOX)
- X+ scale_radius(old_l, cur_l);
- X draw_line(cur_l, PAINT);
- X toggle_linemarker(cur_l);
- X wrapup_scale();
- Xdiff -rc xfig.2.1.7a/e_update.c xfig.2.1.8/e_update.c
- X*** xfig.2.1.7a/e_update.c Fri Feb 12 09:16:07 1993
- X--- xfig.2.1.8/e_update.c Wed May 5 12:01:45 1993
- X***************
- X*** 24,29 ****
- X--- 24,30 ----
- X #include "w_mousefun.h"
- X
- X extern update_current_settings();
- X+ extern PIX_FONT lookfont();
- X static int init_update_object();
- X static int init_update_settings();
- X
- X***************
- X*** 316,323 ****
- X up_part(text->angle, cur_elltextangle*M_PI/180.0, I_ELLTEXTANGLE);
- X up_part(text->color, cur_color, I_COLOR);
- X up_part(text->depth, cur_depth, I_DEPTH);
- X! size = pf_textwidth(lookfont(x_fontnum(text->flags, text->font), text->size,
- X! cur_elltextangle), strlen(text->cstring), text->cstring);
- X text->length = size.x; /* in pixels */
- X text->height = size.y; /* in pixels */
- X reload_text_fstruct(text); /* make sure fontstruct is current */
- X--- 317,324 ----
- X up_part(text->angle, cur_elltextangle*M_PI/180.0, I_ELLTEXTANGLE);
- X up_part(text->color, cur_color, I_COLOR);
- X up_part(text->depth, cur_depth, I_DEPTH);
- X! size = pf_textwidth(lookfont(x_fontnum(text->flags, text->font), text->size),
- X! strlen(text->cstring), text->cstring);
- X text->length = size.x; /* in pixels */
- X text->height = size.y; /* in pixels */
- X reload_text_fstruct(text); /* make sure fontstruct is current */
- Xdiff -rc xfig.2.1.7a/f_epsobj.c xfig.2.1.8/f_epsobj.c
- X*** xfig.2.1.7a/f_epsobj.c Wed Apr 28 15:25:11 1993
- X--- xfig.2.1.8/f_epsobj.c Tue Aug 31 14:18:38 1993
- X***************
- X*** 33,39 ****
- X char *cp;
- X unsigned char *mp;
- X unsigned int hexnib;
- X! int flag,preview;
- X char buf[300];
- X int llx, lly, urx, ury, bad_bbox;
- X FILE *epsf;
- X--- 33,39 ----
- X char *cp;
- X unsigned char *mp;
- X unsigned int hexnib;
- X! int flag;
- X char buf[300];
- X int llx, lly, urx, ury, bad_bbox;
- X FILE *epsf;
- Xdiff -rc xfig.2.1.7a/f_read.c xfig.2.1.8/f_read.c
- X*** xfig.2.1.7a/f_read.c Mon May 3 10:41:12 1993
- X--- xfig.2.1.8/f_read.c Tue Sep 14 09:08:19 1993
- X***************
- X*** 139,145 ****
- X return -2;
- X if (strncmp(buf, "#FIG", 4) == 0) { /* versions 1.4/later have #FIG in
- X * first line */
- X! if ((sscanf((char*)(index(buf, ' ') + 1), "%f", &fproto)) == 0) /* assume 1.4 */
- X proto = 14;
- X else
- X proto = (fproto + .01) * 10; /* protocol version*10 */
- X--- 139,145 ----
- X return -2;
- X if (strncmp(buf, "#FIG", 4) == 0) { /* versions 1.4/later have #FIG in
- X * first line */
- X! if ((sscanf((char*)(strchr(buf, ' ') + 1), "%f", &fproto)) == 0) /* assume 1.4 */
- X proto = 14;
- X else
- X proto = (fproto + .01) * 10; /* protocol version*10 */
- X***************
- X*** 157,165 ****
- X status = read_1_3_objects(fp, obj);
- X }
- X
- X! /* shift the figure on the page if there are negative coords */
- X! /**** DISABLE UNTIL WE PUT IN AN *OPTION* TO DO THIS */
- X! /* shift_figure(obj); */
- X
- X fclose(fp);
- X return (status);
- X--- 157,164 ----
- X status = read_1_3_objects(fp, obj);
- X }
- X
- X! /* ask the user if the figure should be shifted if there are negative coords */
- X! shift_figure(obj);
- X
- X fclose(fp);
- X return (status);
- X***************
- X*** 448,453 ****
- X--- 447,453 ----
- X return (NULL);
- X }
- X e->fill_style = FILL_CONVERT(e->fill_style);
- X+ fixangle(&e->angle); /* make sure angle is 0 to 2PI */
- X fixdepth(&e->depth);
- X return (e);
- X }
- X***************
- X*** 711,717 ****
- X int ignore = 0;
- X char s[BUF_SIZE], s_temp[BUF_SIZE], junk[2];
- X float tx_size, tx_height, tx_length;
- X! extern PIX_ROT_FONT lookfont();
- X
- X if ((t = create_text()) == NULL)
- X return (NULL);
- X--- 711,717 ----
- X int ignore = 0;
- X char s[BUF_SIZE], s_temp[BUF_SIZE], junk[2];
- X float tx_size, tx_height, tx_length;
- X! extern PIX_FONT lookfont();
- X
- X if ((t = create_text()) == NULL)
- X return (NULL);
- X***************
- X*** 726,737 ****
- X * We read text size, height and length as floats because TransFig uses
- X * floats for these, but they are rounded to ints internally to xfig.
- X */
- X! /* read the leading blanks for the string, but delete the first later */
- X n = sscanf(buf, "%*d%d%d%f%d%d%d%f%d%f%f%d%d%[^\1]%[\1]",
- X! &t->type, &t->font, &tx_size, &t->pen,
- X! &t->color, &t->depth, &t->angle,
- X! &t->flags, &tx_height, &tx_length,
- X! &t->base_x, &t->base_y, s, junk);
- X if (n != 13 && n != 14) {
- X file_msg(Err_incomp, "text", line_no);
- X free((char *) t);
- X--- 726,773 ----
- X * We read text size, height and length as floats because TransFig uses
- X * floats for these, but they are rounded to ints internally to xfig.
- X */
- X! /* read the leading blanks for the string, but delete the first one later */
- X! #ifdef linux
- X! {
- X! char replaced;
- X! int pos;
- X! register int len;
- X! pos = 0;
- X! len = strlen(buf);
- X! while (((unsigned char) buf[pos] <= 'e' ) &&
- X! ((unsigned char) buf[pos] >= ' ' ) && buf[pos] )
- X! pos++;
- X! replaced = buf[pos];
- X! buf[pos]='f';
- X! n = sscanf(buf, "%*d%d%d%f%d%d%d%f%d%f%f%d%d%[^f]%[f]",
- X! &t->type, &t->font, &tx_size, &t->pen,
- X! &t->color, &t->depth, &t->angle,
- X! &t->flags, &tx_height, &tx_length,
- X! &t->base_x, &t->base_y, s, junk);
- X! n--;
- X! if ( n < 13 ) {
- X! file_msg(Err_incomp, "text", line_no);
- X! free((char *) t);
- X! return (NULL);
- X! }
- X! buf[pos]=replaced;
- X! strcpy( s, buf+pos-strlen(s));
- X! len=strlen(s);
- X! if ( len && (s[len-1] == '\n') )
- X! s[len-1]='\0';
- X! len=strlen(s);
- X! if ( len && (s[len-1] == 1) ) {
- X! n++;
- X! s[len-1]='\0';
- X! }
- X! }
- X! #else
- X n = sscanf(buf, "%*d%d%d%f%d%d%d%f%d%f%f%d%d%[^\1]%[\1]",
- X! &t->type, &t->font, &tx_size, &t->pen,
- X! &t->color, &t->depth, &t->angle,
- X! &t->flags, &tx_height, &tx_length,
- X! &t->base_x, &t->base_y, s, junk);
- X! #endif
- X if (n != 13 && n != 14) {
- X file_msg(Err_incomp, "text", line_no);
- X free((char *) t);
- X***************
- X*** 742,754 ****
- X t->size = DEFAULT;
- X else
- X t->size = round(tx_size);
- X! while (t->angle < 0.0)
- X! t->angle += M_2PI;
- X! while (t->angle > M_2PI)
- X! t->angle -= M_2PI;
- X /* get the font struct */
- X t->fontstruct = lookfont(x_fontnum(t->flags, t->font),
- X! round(t->size*zoomscale), t->angle);
- X t->height = round(tx_height);
- X t->length = round(tx_length);
- X fixdepth(&t->depth);
- X--- 778,790 ----
- X t->size = DEFAULT;
- X else
- X t->size = round(tx_size);
- X!
- X! /* make sure angle is 0 to 2PI */
- X! fixangle(&t->angle);
- X!
- X /* get the font struct */
- X t->fontstruct = lookfont(x_fontnum(t->flags, t->font),
- X! round(t->size*zoomscale));
- X t->height = round(tx_height);
- X t->length = round(tx_length);
- X fixdepth(&t->depth);
- X***************
- X*** 843,848 ****
- X--- 879,895 ----
- X }
- X }
- X
- X+ /* make sure angle is 0 to 2PI */
- X+
- X+ fixangle(angle)
- X+ float *angle;
- X+ {
- X+ while (*angle < 0.0)
- X+ *angle += M_2PI;
- X+ while (*angle >= M_2PI)
- X+ *angle -= M_2PI;
- X+ }
- X+
- X fixdepth(depth)
- X int *depth;
- X {
- X***************
- X*** 858,863 ****
- X--- 905,912 ----
- X }
- X }
- X
- X+ char shift_msg[] = "The figure has objects which have negative coordinates,\ndo you wish to shift it back on the page?";
- X+
- X shift_figure(obj)
- X F_compound *obj;
- X {
- X***************
- X*** 900,907 ****
- X }
- X for (t = obj->texts; t != NULL; t = t->next) {
- X int dum;
- X! text_bound_actual(t, t->angle, &llx, &lly, &urx, &ury,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X lowx = min2(llx,lowx);
- X lowy = min2(lly,lowy);
- X }
- X--- 949,956 ----
- X }
- X for (t = obj->texts; t != NULL; t = t->next) {
- X int dum;
- X! text_bound(t, &llx, &lly, &urx, &ury,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X lowx = min2(llx,lowx);
- X lowy = min2(lly,lowy);
- X }
- X***************
- X*** 908,913 ****
- X--- 957,966 ----
- X /* check if any part of the figure has negative coords */
- X if (lowx >= 0 && lowy >= 0)
- X return; /* no, ok */
- X+
- X+ /* ask the user */
- X+ if (popup_query(QUERY_YESNO, shift_msg)==RESULT_NO)
- X+ return;
- X
- X /* shift the whole figure to keep it "on the page" */
- X dx = dy = 0;
- Xdiff -rc xfig.2.1.7a/f_util.c xfig.2.1.8/f_util.c
- X*** xfig.2.1.7a/f_util.c Mon Mar 22 14:12:25 1993
- X--- xfig.2.1.8/f_util.c Tue Sep 14 09:08:25 1993
- X***************
- X*** 21,27 ****
- X char name[];
- X
- X {
- X! if (*name == '\0') {
- X return (1);
- X } else {
- X return (0);
- X--- 21,27 ----
- X char name[];
- X
- X {
- X! if (name == NULL || *name == '\0') {
- X return (1);
- X } else {
- X return (0);
- X***************
- X*** 74,80 ****
- X change_directory(path)
- X char *path;
- X {
- X! if (path == NULL) {
- X *cur_dir = '\0';
- X return (0);
- X }
- X--- 74,80 ----
- X change_directory(path)
- X char *path;
- END_OF_FILE
- if test 30182 -ne `wc -c <'xfig.03'`; then
- echo shar: \"'xfig.03'\" unpacked with wrong size!
- fi
- # end of 'xfig.03'
- fi
- echo shar: End of archive 9 \(of 16\).
- cp /dev/null ark9isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 16 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- echo Creating merged patch file xfig.p2
- cat xfig.[01][0-9] > xfig.p2
- rm -f xfig.[01][0-9]
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
- --
- // chris@Sterling.COM | Send comp.sources.x submissions to:
- \X/ Amiga - The only way to fly! | sources-x@sterling.com
- "It's intuitively obvious to the |
- most casual observer..." | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
-