home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-21 | 30.7 KB | 1,062 lines |
- Newsgroups: comp.sources.x
- From: envbvs@epb12.lbl.gov (Brian V. Smith)
- Subject: v21i035: xfig - Draw amd manipulate objects in an X-Window, Patch02o/16
- Message-ID: <1993Oct21.190000.7618@sparky.sterling.com>
- X-Md4-Signature: 7a2be6d7cd5cec74a682a444e018e2e4
- Sender: chris@sparky.sterling.com (Chris Olson)
- Organization: Sterling Software
- Date: Thu, 21 Oct 1993 19:00:00 GMT
- Approved: chris@sterling.com
-
- Submitted-by: envbvs@epb12.lbl.gov (Brian V. Smith)
- Posting-number: Volume 21, Issue 35
- Archive-name: xfig/patch02o
- 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.06
- # Wrapped by chris@sparky on Thu Oct 21 13:40:08 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 15 (of 16)."'
- if test -f 'xfig.06' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xfig.06'\"
- else
- echo shar: Extracting \"'xfig.06'\" \(28226 characters\)
- sed "s/^X//" >'xfig.06' <<'END_OF_FILE'
- X! text_bound(t, &xmin, &ymin, &xmax, &ymax,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X redisplay_zoomed_region(xmin, ymin, xmax, ymax);
- X }
- X
- X***************
- X*** 536,551 ****
- X int xmin2, ymin2, xmax2, ymax2;
- X int dum;
- X
- X! if (appres.textoutline) {
- X! text_bound_both(t1, &xmin1, &ymin1, &xmax1, &ymax1,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X! text_bound_both(t2, &xmin2, &ymin2, &xmax2, &ymax2,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X! } else {
- X! text_bound(t1, &xmin1, &ymin1, &xmax1, &ymax1);
- X! text_bound(t2, &xmin2, &ymin2, &xmax2, &ymax2);
- X! }
- X! redisplay_regions(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2);
- X }
- X
- X redisplay_regions(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2)
- X--- 532,543 ----
- X int xmin2, ymin2, xmax2, ymax2;
- X int dum;
- X
- X! text_bound(t1, &xmin1, &ymin1, &xmax1, &ymax1,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X! text_bound(t2, &xmin2, &ymin2, &xmax2, &ymax2,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X! redisplay_regions(xmin1, ymin1, xmax1, ymax1,
- X! xmin2, ymin2, xmax2, ymax2);
- X }
- X
- X redisplay_regions(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2)
- Xdiff -rc xfig.2.1.7a/u_search.c xfig.2.1.8/u_search.c
- X*** xfig.2.1.7a/u_search.c Fri Jan 8 11:20:18 1993
- X--- xfig.2.1.8/u_search.c Tue Aug 31 13:38:01 1993
- X***************
- X*** 27,32 ****
- X--- 27,33 ----
- X static long objectcount;
- X static long n;
- X static int csr_x, csr_y;
- X+ Boolean in_text_bound();
- X
- X static F_point point1, point2;
- X
- X***************
- X*** 215,222 ****
- X int x, y, tolerance, *px, *py;
- X int shift;
- X {
- X- int halflen, dx, dy;
- X int txmin, txmax, tymin, tymax;
- X
- X if (!anytext_in_mask())
- X return (0);
- X--- 216,223 ----
- X int x, y, tolerance, *px, *py;
- X int shift;
- X {
- X int txmin, txmax, tymin, tymax;
- X+ int dum;
- X
- X if (!anytext_in_mask())
- X return (0);
- X***************
- X*** 228,234 ****
- X for (; t != NULL; t = prev_text(objects.texts, t))
- X if (validtext_in_mask(t)) {
- X n++;
- X! text_bound(t, &txmin, &tymin, &txmax, &tymax);
- X if (x >= txmin-tolerance && x <= txmax+tolerance &&
- X y >= tymin-tolerance && y <= tymax+tolerance) {
- X *px = x;
- X--- 229,236 ----
- X for (; t != NULL; t = prev_text(objects.texts, t))
- X if (validtext_in_mask(t)) {
- X n++;
- X! text_bound(t, &txmin, &tymin, &txmax, &tymax,
- X! &dum, &dum, &dum, &dum, &dum, &dum, &dum, &dum);
- X if (x >= txmin-tolerance && x <= txmax+tolerance &&
- X y >= tymin-tolerance && y <= tymax+tolerance) {
- X *px = x;
- X***************
- X*** 752,775 ****
- X do_point_search(x, y, shift);
- X }
- X
- X- /* =============================================================== */
- X-
- X- /* These are some of the original search subroutines which are still in use */
- X-
- X F_text *
- X! text_search(x, y)
- X! int x, y;
- X {
- X F_text *t;
- X- int xmin, xmax, ymin, ymax;
- X
- X for (t = objects.texts; t != NULL; t = t->next) {
- X! text_bound(t, &xmin, &ymin, &xmax, &ymax);
- X! if (x >= xmin && x <= xmax &&
- X! y >= ymin && y <= ymax)
- X return(t);
- X }
- X return (NULL);
- X }
- X
- X F_compound *
- X--- 754,821 ----
- X do_point_search(x, y, shift);
- X }
- X
- X F_text *
- X! text_search(x, y, posn)
- X! int x, y, *posn;
- X {
- X F_text *t;
- X
- X for (t = objects.texts; t != NULL; t = t->next) {
- X! if (in_text_bound(t, x, y, posn))
- X return(t);
- X }
- X return (NULL);
- X+ }
- X+
- X+ /* return true if (x,y) is in the text rectangle by rotating the point (x,y)
- X+ around the text base point by it's negative angle and seeing if that is
- X+ in the rectangle.
- X+ Additionally, set posn to the pixel position of the mouse from the beginning
- X+ of the string
- X+ */
- X+
- X+ Boolean
- X+ in_text_bound(t, x, y, posn)
- X+ F_text *t;
- X+ int x,y,*posn;
- X+ {
- X+ double cost, sint;
- X+ int xo,yo, xr,yr;
- X+ int x1,y1, x2,y2;
- X+ int l, h;
- X+
- X+ cost = cos((double) -t->angle);
- X+ sint = sin((double) -t->angle);
- X+ xo = t->base_x;
- X+ yo = t->base_y;
- X+ /* rotate the point (x,y) about (xo,yo) giving (xr,yr) */
- X+ xr = xo + (x-xo)*cost - (yo-y)*sint;
- X+ yr = yo - (yo-y)*cost - (x-xo)*sint;
- X+ /* now see if that point is in the text bounds of the unrotated text */
- X+ l = text_length(t);
- X+ h = t->height;
- X+ x1 = t->base_x;
- X+ y1 = t->base_y;
- X+ if (t->type == T_CENTER_JUSTIFIED) {
- X+ x2 = x1 + l/2;
- X+ x1 = x1 - l/2;
- X+ y2 = y1 - h;
- X+ }
- X+ else if (t->type == T_RIGHT_JUSTIFIED) {
- X+ x2 = x1;
- X+ x1 = x1 - l;
- X+ y2 = y1 - h;
- X+ }
- X+ else {
- X+ x2 = x1 + l;
- X+ y2 = y1 - h;
- X+ }
- X+ if (xr >= x1 && xr <= x2 && yr <= y1 && yr >= y2) {
- X+ /* return the pixel position from the beginning of the string */
- X+ *posn = xr-x1;
- X+ return True;
- X+ }
- X+ return False;
- X }
- X
- X F_compound *
- Xdiff -rc xfig.2.1.7a/u_undo.c xfig.2.1.8/u_undo.c
- X*** xfig.2.1.7a/u_undo.c Thu Feb 11 12:11:05 1993
- X--- xfig.2.1.8/u_undo.c Tue Aug 31 13:38:23 1993
- X***************
- X*** 39,49 ****
- X NULL, NULL, NULL, NULL, NULL, NULL, NULL};
- X F_compound object_tails = {0, { 0, 0 }, { 0, 0 },
- X NULL, NULL, NULL, NULL, NULL, NULL, NULL};
- X
- X /*************** LOCAL *****************/
- X
- X static int last_object;
- X- static int last_action = F_NULL;
- X static F_pos last_position, new_position;
- X static int last_arcpointnum;
- X static F_point *last_prev_point, *last_selected_point, *last_next_point;
- X--- 39,49 ----
- X NULL, NULL, NULL, NULL, NULL, NULL, NULL};
- X F_compound object_tails = {0, { 0, 0 }, { 0, 0 },
- X NULL, NULL, NULL, NULL, NULL, NULL, NULL};
- X+ int last_action = F_NULL;
- X
- X /*************** LOCAL *****************/
- X
- X static int last_object;
- X static F_pos last_position, new_position;
- X static int last_arcpointnum;
- X static F_point *last_prev_point, *last_selected_point, *last_next_point;
- X***************
- X*** 116,122 ****
- X
- X if (last_object == O_POLYLINE)
- X linepoint_adding(saved_objects.lines, last_prev_point,
- X! last_selected_point, last_next_point);
- X else
- X splinepoint_adding(saved_objects.splines, last_prev_point,
- X last_selected_point, last_next_point);
- X--- 116,122 ----
- X
- X if (last_object == O_POLYLINE)
- X linepoint_adding(saved_objects.lines, last_prev_point,
- X! last_selected_point);
- X else
- X splinepoint_adding(saved_objects.splines, last_prev_point,
- X last_selected_point, last_next_point);
- X***************
- X*** 203,209 ****
- X
- X undo_change()
- X {
- X- int xmin, ymin, xmax, ymax;
- X F_compound swp_comp;
- X
- X last_action = F_NULL; /* to avoid a clean-up during "unchange" */
- X--- 203,208 ----
- X***************
- X*** 372,388 ****
- X xmin2, ymin2, xmax2, ymax2);
- X break;
- X case O_TEXT:
- X! if (appres.textoutline) {
- X! text_bound_both(saved_objects.texts, &xmin1, &ymin1, &xmax1, &ymax1,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X! translate_text(saved_objects.texts, dx, dy);
- X! text_bound_both(saved_objects.texts, &xmin2, &ymin2, &xmax2, &ymax2,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X! } else {
- X! text_bound(saved_objects.texts, &xmin1, &ymin1, &xmax1, &ymax1);
- X! translate_text(saved_objects.texts, dx, dy);
- X! text_bound(saved_objects.texts, &xmin2, &ymin2, &xmax2, &ymax2);
- X! }
- X redisplay_regions(xmin1, ymin1, xmax1, ymax1,
- X xmin2, ymin2, xmax2, ymax2);
- X break;
- X--- 371,381 ----
- X xmin2, ymin2, xmax2, ymax2);
- X break;
- X case O_TEXT:
- X! text_bound(saved_objects.texts, &xmin1, &ymin1, &xmax1, &ymax1,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X! translate_text(saved_objects.texts, dx, dy);
- X! text_bound(saved_objects.texts, &xmin2, &ymin2, &xmax2, &ymax2,
- X! &dum,&dum,&dum,&dum,&dum,&dum,&dum,&dum);
- X redisplay_regions(xmin1, ymin1, xmax1, ymax1,
- X xmin2, ymin2, xmax2, ymax2);
- X break;
- X***************
- X*** 415,421 ****
- X undo_load()
- X {
- X F_compound temp;
- X! char ctemp[128];
- X
- X temp = objects;
- X objects = saved_objects;
- X--- 408,414 ----
- X undo_load()
- X {
- X F_compound temp;
- X! char ctemp[200];
- X
- X temp = objects;
- X objects = saved_objects;
- Xdiff -rc xfig.2.1.7a/w_canvas.c xfig.2.1.8/w_canvas.c
- X*** xfig.2.1.7a/w_canvas.c Wed Apr 28 11:29:27 1993
- X--- xfig.2.1.8/w_canvas.c Wed Sep 15 13:48:48 1993
- X***************
- X*** 25,31 ****
- X #include "w_util.h"
- X #include "w_zoom.h"
- X #ifndef SYSV
- X! #include "sys/time.h"
- X #endif
- X #include <X11/Xatom.h>
- X
- X--- 25,31 ----
- X #include "w_util.h"
- X #include "w_zoom.h"
- X #ifndef SYSV
- X! #include <sys/time.h>
- X #endif
- X #include <X11/Xatom.h>
- X
- X***************
- X*** 125,130 ****
- X--- 125,131 ----
- X <Key>F18: PasteCanv()\n\
- X <EnterWindow>:EnterCanv()\n\
- X <LeaveWindow>:LeaveCanv()EraseRulerMark()\n\
- X+ <KeyUp>:EventCanv()\n\
- X ~Meta<Key>:EventCanv()\n\
- X <Expose>:ExposeCanv()\n";
- X
- X***************
- X*** 210,216 ****
- X
- X switch (event->type) {
- X case MotionNotify:
- X! #if defined(SMOOTHMOTION) || defined(OPENWIN)
- X /* translate from zoomed coords to object coords */
- X x = BACKX(event->x);
- X y = BACKY(event->y);
- X--- 211,217 ----
- X
- X switch (event->type) {
- X case MotionNotify:
- X! #if defined(SMOOTHMOTION)
- X /* translate from zoomed coords to object coords */
- X x = BACKX(event->x);
- X y = BACKY(event->y);
- X***************
- X*** 244,250 ****
- X x = sx = cx; /* these are zoomed */
- X y = sy = cy; /* coordinates! */
- X }
- X! #endif /* SMOOTHMOTION || OPENWIN */
- X set_rulermark(x, y);
- X (*canvas_locmove_proc) (x, y);
- X break;
- X--- 245,251 ----
- X x = sx = cx; /* these are zoomed */
- X y = sy = cy; /* coordinates! */
- X }
- X! #endif /* SMOOTHMOTION */
- X set_rulermark(x, y);
- X (*canvas_locmove_proc) (x, y);
- X break;
- X***************
- X*** 285,337 ****
- X key == XK_Home ||
- X key == XK_Multi_key ||
- X key == XK_Alt_L ) {
- X! switch (key) {
- X! case XK_Left:
- X! pan_left();
- X! break;
- X! case XK_Right:
- X! pan_right();
- X! break;
- X! case XK_Up:
- X! pan_up();
- X! break;
- X! case XK_Down:
- X! pan_down();
- X! break;
- X! case XK_Home:
- X! pan_origin();
- X! break;
- X! case XK_Multi_key:
- X! case XK_Alt_L:
- X! compose_key = 1;
- X! break;
- X! }
- X } else {
- X! switch (compose_key) {
- X! case 0:
- X! if (XLookupString(ke, buf, sizeof(buf), NULL, NULL) > 0)
- X! (*canvas_kbd_proc) ((unsigned char) buf[0]);
- X! break;
- X! case 1:
- X! if (XLookupString(ke, &compose_buf[0], 1, NULL, NULL)
- X! > 0)
- X! compose_key = 2;
- X! break;
- X! case 2:
- X! if (XLookupString(ke, &compose_buf[1], 1, NULL, NULL)
- X! > 0) {
- X! if ((c = getComposeKey(compose_buf)) != '\0')
- X! (*canvas_kbd_proc) (c);
- X! else {
- X! (*canvas_kbd_proc) ((unsigned char) compose_buf[0]);
- X! (*canvas_kbd_proc) ((unsigned char) compose_buf[1]);
- X }
- X! compose_key = 0;
- X }
- X! break;
- X }
- X }
- X break;
- X }
- X }
- X
- X--- 286,363 ----
- X key == XK_Home ||
- X key == XK_Multi_key ||
- X key == XK_Alt_L ) {
- X! switch (key) {
- X! case XK_Left:
- X! pan_left();
- X! break;
- X! case XK_Right:
- X! pan_right();
- X! break;
- X! case XK_Up:
- X! pan_up();
- X! break;
- X! case XK_Down:
- X! pan_down();
- X! break;
- X! case XK_Home:
- X! pan_origin();
- X! break;
- X! case XK_Multi_key:
- X! case XK_Alt_L:
- X! compose_key = 1;
- X! break;
- X! }
- X! } else if (key == XK_Control_L || key == XK_Control_R) {
- X! /* show the control-key actions */
- X! draw_mousefun("Zoom area", "Pan to origin", "Unzoom");
- X! } else if (key == XK_Shift_L || key == XK_Shift_R) {
- X! /* show the shift-key function, but only if an edit mode */
- X! if (cur_mode >= FIRST_EDIT_MODE)
- X! draw_mousefun("Locate object", "Locate object", "");
- X } else {
- X! if (canvas_kbd_proc != null_proc) {
- X! switch (compose_key) {
- X! case 0:
- X! if (XLookupString(ke, buf, sizeof(buf), NULL, NULL) > 0)
- X! (*canvas_kbd_proc) ((unsigned char) buf[0]);
- X! break;
- X! case 1:
- X! if (XLookupString(ke, &compose_buf[0], 1, NULL, NULL)
- X! > 0)
- X! compose_key = 2;
- X! break;
- X! case 2:
- X! if (XLookupString(ke, &compose_buf[1], 1, NULL, NULL)
- X! > 0) {
- X! if ((c = getComposeKey(compose_buf)) != '\0')
- X! (*canvas_kbd_proc) (c);
- X! else {
- X! (*canvas_kbd_proc) ((unsigned char) compose_buf[0]);
- X! (*canvas_kbd_proc) ((unsigned char) compose_buf[1]);
- X! }
- X! compose_key = 0;
- X }
- X! break;
- X }
- X! } else {
- X! /* Be cheeky... we aren't going to do anything, so pass the
- X! * key on to the mode_panel window by rescheduling the event
- X! * The message window might treat it as a hotkey!
- X! */
- X! ke->window = XtWindow(mode_panel);
- X! ke->subwindow = 0;
- X! XPutBackEvent(ke->display,(XEvent *)ke);
- X }
- X }
- X break;
- X+
- X+ case KeyRelease:
- X+ /* if user is releasing Control or Shift keys redisplay original function */
- X+ key = XLookupKeysym(ke, 0);
- X+ if (key == XK_Control_L || key == XK_Control_R ||
- X+ key == XK_Shift_L || key == XK_Shift_R)
- X+ draw_mousefun_canvas();
- X+ break;
- X }
- X }
- X
- X***************
- X*** 363,373 ****
- X event_time = paste_event->time;
- X else
- X time((time_t *) &event_time);
- X- /***
- X- This doesn't seem to work:
- X- XtGetSelectionValue(w, XInternAtom(XtDisplay(w), "XA_PRIMARY", False),
- X- XA_STRING, get_canvas_clipboard, NULL, event_time);
- X- ***/
- X XtGetSelectionValue(w, XA_PRIMARY,
- X XA_STRING, get_canvas_clipboard, NULL, event_time);
- X }
- X--- 389,394 ----
- Xdiff -rc xfig.2.1.7a/w_cmdpanel.c xfig.2.1.8/w_cmdpanel.c
- X*** xfig.2.1.7a/w_cmdpanel.c Mon Feb 22 17:47:03 1993
- X--- xfig.2.1.8/w_cmdpanel.c Tue Aug 31 10:02:33 1993
- X***************
- X*** 22,27 ****
- X--- 22,28 ----
- X
- X extern erase_objecthighlight();
- X extern emptyfigure();
- X+ extern Boolean query_save();
- X extern do_print(), do_print_batch(), do_export(), do_save();
- X extern void undo(), redisplay_canvas();
- X extern void popup_print_panel(), popup_file_panel(), popup_export_panel();
- X***************
- X*** 158,166 ****
- X sw = &cmd_switches[i];
- X FirstArg(XtNfont, button_font); /* label font */
- X SetValues(sw->widget);
- X- /* install the keyboard accelerators for this command button
- X- from the resources */
- X- /*XtInstallAllAccelerators(sw->widget, tool);*/
- X }
- X }
- X
- X--- 159,164 ----
- X***************
- X*** 172,178 ****
- X Boolean* continue_to_dispatch;
- X {
- X cmd_sw_info *sw = (cmd_sw_info *) closure;
- X- clear_mousefun();
- X draw_mousefun(sw->mousefun_l, "", sw->mousefun_r);
- X }
- X
- X--- 170,175 ----
- X***************
- X*** 216,240 ****
- X quit(w)
- X Widget w;
- X {
- X! int qresult;
- X!
- X! if (!emptyfigure() && figure_modified && !aborting) {
- X! XtSetSensitive(w, False);
- X! if ((qresult = popup_query(QUERY_YESNO, quit_msg)) == RESULT_CANCEL) {
- X! XtSetSensitive(w, True);
- X! return;
- X! } else if (qresult == RESULT_YES) {
- X! do_save(w);
- X! /*
- X! * if saving was not successful, figure_modified is still true:
- X! * do not quit!
- X! */
- X! if (figure_modified) {
- X! XtSetSensitive(w, True);
- X! return;
- X! }
- X! }
- X }
- X /* delete the cut buffer only if it is in a temporary directory */
- X if (strncmp(cut_buf_name, TMPDIR, strlen(TMPDIR)) == 0)
- X unlink(cut_buf_name);
- X--- 213,229 ----
- X quit(w)
- X Widget w;
- X {
- X! XtSetSensitive(w, False);
- X! /* if modified (and non-empty) ask to save first */
- X! if (!query_save(quit_msg)) {
- X! XtSetSensitive(w, True);
- X! return; /* cancel, do not quit */
- X }
- X+ goodbye(); /* finish up and exit */
- X+ }
- X+
- X+ goodbye()
- X+ {
- X /* delete the cut buffer only if it is in a temporary directory */
- X if (strncmp(cut_buf_name, TMPDIR, strlen(TMPDIR)) == 0)
- X unlink(cut_buf_name);
- Xdiff -rc xfig.2.1.7a/w_dir.c xfig.2.1.8/w_dir.c
- X*** xfig.2.1.7a/w_dir.c Fri Feb 5 09:19:31 1993
- X--- xfig.2.1.8/w_dir.c Tue Sep 14 09:08:36 1993
- X***************
- X*** 52,58 ****
- X /* Static variables */
- X
- X DeclareStaticArgs(10);
- X- static Boolean errorInProgress;
- X static String dir_translations =
- X "<Key>Return: SetDir()\n\
- X Ctrl<Key>X: EmptyTextKey()\n\
- X--- 52,57 ----
- X***************
- X*** 59,64 ****
- X--- 58,64 ----
- X <Key>F18: PastePanelKey()\n";
- X static String list_panel_translations =
- X "<Btn3Up>: ParentDir()\n";
- X+
- X static char CurrentSelectionName[PATH_MAX];
- X static int file_entry_cnt, dir_entry_cnt;
- X static char **file_list, **dir_list;
- X***************
- X*** 100,114 ****
- X
- X strcpy(CurrentSelectionName, ret_struct->string);
- X FirstArg(XtNstring, CurrentSelectionName);
- X! /* I don't know why this doesn't work? */
- X! /* NextArg(XtNinsertPosition, strlen(CurrentSelectionName));*/
- X! if (export_up) {
- X SetValues(exp_selfile);
- X XawTextSetInsertionPoint(exp_selfile, strlen(CurrentSelectionName));
- X! } else {
- X SetValues(file_selfile);
- X XawTextSetInsertionPoint(file_selfile, strlen(CurrentSelectionName));
- X! }
- X }
- X
- X /* Function: DirSelected() is called when the user selects a directory.
- X--- 100,112 ----
- X
- X strcpy(CurrentSelectionName, ret_struct->string);
- X FirstArg(XtNstring, CurrentSelectionName);
- X! if (export_up) {
- X SetValues(exp_selfile);
- X XawTextSetInsertionPoint(exp_selfile, strlen(CurrentSelectionName));
- X! } else {
- X SetValues(file_selfile);
- X XawTextSetInsertionPoint(file_selfile, strlen(CurrentSelectionName));
- X! }
- X }
- X
- X /* Function: DirSelected() is called when the user selects a directory.
- X***************
- X*** 163,171 ****
- X
- X /* get the string from the widget */
- X FirstArg(XtNstring, &ndir);
- X! if (file_up)
- X GetValues(file_dir);
- X! else {
- X GetValues(exp_dir);
- X strcpy(export_dir,ndir); /* save in global var */
- X }
- X--- 161,169 ----
- X
- X /* get the string from the widget */
- X FirstArg(XtNstring, &ndir);
- X! if (file_up) {
- X GetValues(file_dir);
- X! } else {
- X GetValues(exp_dir);
- X strcpy(export_dir,ndir); /* save in global var */
- X }
- X***************
- X*** 184,219 ****
- X parseuserpath(path,longpath)
- X char *path,*longpath;
- X {
- X! char *home,*p;
- X struct passwd *who;
- X
- X /* this user's home */
- X! if (strlen(path)==1 || path[1]=='/')
- X! {
- X strcpy(longpath,getenv("HOME"));
- X if (strlen(path)==1) /* nothing after the ~, we have the full path */
- X return;
- X strcat(longpath,&path[1]); /* append the rest of the path */
- X return;
- X! }
- X /* another user name after ~ */
- X strcpy(longpath,&path[1]);
- X! p=index(longpath,'/');
- X if (p)
- X *p='\0';
- X who = getpwnam(longpath);
- X! if (!who)
- X! {
- X file_msg("No such user: %s",longpath);
- X strcpy(longpath,path);
- X! }
- X! else
- X! {
- X strcpy(longpath,who->pw_dir);
- X p=index(path,'/');
- X if (p)
- X strcat(longpath,p); /* attach stuff after the / */
- X! }
- X }
- X
- X static String mask_text_translations =
- X--- 182,213 ----
- X parseuserpath(path,longpath)
- X char *path,*longpath;
- X {
- X! char *p;
- X struct passwd *who;
- X
- X /* this user's home */
- X! if (strlen(path)==1 || path[1]=='/') {
- X strcpy(longpath,getenv("HOME"));
- X if (strlen(path)==1) /* nothing after the ~, we have the full path */
- X return;
- X strcat(longpath,&path[1]); /* append the rest of the path */
- X return;
- X! }
- X /* another user name after ~ */
- X strcpy(longpath,&path[1]);
- X! p=strchr(longpath,'/');
- X if (p)
- X *p='\0';
- X who = getpwnam(longpath);
- X! if (!who) {
- X file_msg("No such user: %s",longpath);
- X strcpy(longpath,path);
- X! } else {
- X strcpy(longpath,who->pw_dir);
- X p=index(path,'/');
- X if (p)
- X strcat(longpath,p); /* attach stuff after the / */
- X! }
- X }
- X
- X static String mask_text_translations =
- X***************
- X*** 278,284 ****
- X NextArg(XtNborderWidth, INTERNAL_BW);
- X NextArg(XtNscrollVertical, XawtextScrollNever);
- X NextArg(XtNresize, XawtextResizeWidth);
- X! NextArg(XtNwidth, 100);
- X NextArg(XtNfromHoriz, w);
- X NextArg(XtNfromVert, file_viewport);
- X *mask_w = XtCreateManagedWidget("mask", asciiTextWidgetClass,
- X--- 272,278 ----
- X NextArg(XtNborderWidth, INTERNAL_BW);
- X NextArg(XtNscrollVertical, XawtextScrollNever);
- X NextArg(XtNresize, XawtextResizeWidth);
- X! NextArg(XtNwidth, 350);
- X NextArg(XtNfromHoriz, w);
- X NextArg(XtNfromVert, file_viewport);
- X *mask_w = XtCreateManagedWidget("mask", asciiTextWidgetClass,
- X***************
- X*** 342,351 ****
- X FirstArg(XtNlist, file_list);
- X *flist_w = XtCreateManagedWidget("file_list_panel", listWidgetClass,
- X file_viewport, Args, ArgCount);
- X- XtOverrideTranslations(*flist_w,
- X- XtParseTranslationTable(list_panel_translations));
- X XtAddCallback(*flist_w, XtNcallback, FileSelected,
- X (XtPointer) NULL);
- X
- X FirstArg(XtNlist, dir_list);
- X *dlist_w = XtCreateManagedWidget("dir_list_panel", listWidgetClass,
- X--- 336,345 ----
- X FirstArg(XtNlist, file_list);
- X *flist_w = XtCreateManagedWidget("file_list_panel", listWidgetClass,
- X file_viewport, Args, ArgCount);
- X XtAddCallback(*flist_w, XtNcallback, FileSelected,
- X (XtPointer) NULL);
- X+ XtOverrideTranslations(*flist_w,
- X+ XtParseTranslationTable(list_panel_translations));
- X
- X FirstArg(XtNlist, dir_list);
- X *dlist_w = XtCreateManagedWidget("dir_list_panel", listWidgetClass,
- X***************
- X*** 425,430 ****
- X--- 419,426 ----
- X */
- X app_flush();
- X
- X+ if ((mask == NULL) || (*mask == '\0'))
- X+ mask = "*";
- X for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
- X /* skip over '.' (current dir) */
- X if (!strcmp(dp->d_name, "."))
- X***************
- X*** 441,448 ****
- X }
- X } else {
- X /* check if matches regular expression */
- X- if ((mask == NULL) || (*mask == '\0'))
- X- mask = "*";
- X if (wild_match(dp->d_name, mask) == 0)
- X continue; /* no, do next */
- X if (mask[0] == '*' && dp->d_name[0] == '.')
- X--- 437,442 ----
- X***************
- X*** 499,509 ****
- X DoChangeDir(dir)
- X char *dir;
- X {
- X- char **file_list;
- X- char **dir_list;
- X char *p;
- X- Arg args[10];
- X- Cardinal arg_cnt;
- X char ndir[PATH_MAX], tmpdir[PATH_MAX];
- X
- X
- X--- 493,499 ----
- X***************
- X*** 604,611 ****
- X--- 594,605 ----
- X Widget listwidget;
- X String *list;
- X {
- X+ int n;
- X+ /* make the scrollbar reset to the top */
- X XawListChange(listwidget, null_list, 1, 0, True);
- X XawListChange(listwidget, list, 0, 0, True);
- X+ FirstArg(XtNnumberStrings, &n);
- X+ GetValues(listwidget);
- X }
- X
- X
- Xdiff -rc xfig.2.1.7a/w_drawprim.c xfig.2.1.8/w_drawprim.c
- X*** xfig.2.1.7a/w_drawprim.c Tue Mar 30 10:56:19 1993
- X--- xfig.2.1.8/w_drawprim.c Fri Sep 3 11:06:25 1993
- X***************
- X*** 40,47 ****
- X #include "w_util.h"
- X #include "w_zoom.h"
- X
- X! extern struct _xfstruct x_fontinfo[NUM_X_FONTS];
- X! extern struct _fstruct ps_fontinfo[]; /* font names */
- X extern choice_info fillstyle_choices[];
- X
- X /* EXPORTS */
- X--- 40,47 ----
- X #include "w_util.h"
- X #include "w_zoom.h"
- X
- X! extern struct _xfstruct x_fontinfo[]; /* X11 fontnames */
- X! extern struct _fstruct ps_fontinfo[]; /* PostScript/OpenWindow font names */
- X extern choice_info fillstyle_choices[];
- X
- X /* EXPORTS */
- X***************
- X*** 49,62 ****
- X PIX_FONT bold_font;
- X PIX_FONT roman_font;
- X PIX_FONT button_font;
- X! PIX_ROT_FONT canvas_font;
- X
- X /* LOCAL */
- X
- X static Pixel gc_color[NUMOPS];
- X static XRectangle clip[1];
- X- static pr_size pfx_textwidth();
- X static int parsesize();
- X
- X #define MAXNAMES 35
- X
- X--- 49,62 ----
- X PIX_FONT bold_font;
- X PIX_FONT roman_font;
- X PIX_FONT button_font;
- X! PIX_FONT canvas_font;
- X
- X /* LOCAL */
- X
- X static Pixel gc_color[NUMOPS];
- X static XRectangle clip[1];
- X static int parsesize();
- X+ static Boolean openwinfonts;
- X
- X #define MAXNAMES 35
- X
- X***************
- X*** 79,85 ****
- X if (appres.buttonFont == NULL || *appres.buttonFont == '\0')
- X appres.buttonFont = BUTTON_FONT;
- X
- X! roman_font = XLoadQueryFont(tool_d, appres.normalFont);
- X hidden_text_length = 4 * roman_font->max_bounds.width;
- X if ((bold_font = XLoadQueryFont(tool_d, appres.boldFont)) == 0) {
- X fprintf(stderr, "Can't load font: %s, using %s\n",
- X--- 79,94 ----
- X if (appres.buttonFont == NULL || *appres.buttonFont == '\0')
- X appres.buttonFont = BUTTON_FONT;
- X
- X! while ((roman_font = XLoadQueryFont(tool_d, appres.normalFont)) == 0) {
- X! if (strcmp(appres.normalFont,"fixed") == 0) {
- X! fprintf(stderr, "Can't load 'fixed' font, something is wrong");
- X! fprintf(stderr," with your server - quitting.\n");
- X! exit(1);
- X! }
- X! fprintf(stderr, "Can't load font: %s, using 'fixed'\n",
- X! appres.normalFont);
- X! appres.normalFont = "fixed";
- X! } /* now loop to load "fixed" */
- X hidden_text_length = 4 * roman_font->max_bounds.width;
- X if ((bold_font = XLoadQueryFont(tool_d, appres.boldFont)) == 0) {
- X fprintf(stderr, "Can't load font: %s, using %s\n",
- X***************
- X*** 98,116 ****
- X * it.
- X */
- X
- X! #ifndef OPENWIN
- X! /* if the user asked for scalable fonts, check that the server
- X! really has them by checking for font of 0-0 size */
- X if (appres.SCALABLEFONTS) {
- X! strcpy(template,x_fontinfo[0].template); /* just check the first font */
- X! strcat(template,"0-0-*-*-*-*-*-*");
- X! if ((fontlist = XListFonts(tool_d, template, 1, &count))==0)
- X! appres.SCALABLEFONTS = False; /* none, turn off request for them */
- X }
- X
- X! /* X11R5 has scalable fonts - skip next section in that case */
- X if (!appres.SCALABLEFONTS) {
- X! for (f = 0; f < NUM_X_FONTS; f++) {
- X nf = NULL;
- X strcpy(template,x_fontinfo[f].template);
- X strcat(template,"*-*-*-*-*-*-");
- X--- 107,134 ----
- X * it.
- X */
- X
- X! /* if the user hasn't disallowed off scalable fonts, check that the
- X! server really has them by checking for font of 0-0 size */
- X! openwinfonts = False;
- X if (appres.SCALABLEFONTS) {
- X! /* first look for OpenWindow style font names (e.g. times-roman) */
- X! if ((fontlist = XListFonts(tool_d, ps_fontinfo[1].name, 1, &count))!=0) {
- X! openwinfonts = True; /* yes, use them */
- X! for (f=0; f<NUM_FONTS; f++) /* copy the OpenWindow font names */
- X! x_fontinfo[f].template = ps_fontinfo[f+1].name;
- X! } else {
- X! strcpy(template,x_fontinfo[0].template); /* nope, check for font size 0 */
- X! strcat(template,"0-0-*-*-*-*-*-*");
- X! if ((fontlist = XListFonts(tool_d, template, 1, &count))==0)
- X! appres.SCALABLEFONTS = False; /* none, turn off request for them */
- X! }
- X }
- X
- X! /* no scalable fonts - query the server for all the font
- X! names and sizes and build a list of them */
- X!
- X if (!appres.SCALABLEFONTS) {
- X! for (f = 0; f < NUM_FONTS; f++) {
- X nf = NULL;
- X strcpy(template,x_fontinfo[f].template);
- X strcat(template,"*-*-*-*-*-*-");
- X***************
- X*** 150,162 ****
- X nf = newfont; /* keep current ptr */
- X nf->size = ss; /* store the size here */
- X nf->fname = flist[i].fn; /* keep actual name */
- X! nf->list = NULL;
- X nf->next = NULL;
- X }
- X } /* next size */
- X } /* next font, f */
- X } /* !appres.SCALABLEFONTS */
- X- #endif /* OPENWIN */
- X }
- X
- X /* parse the point size of font 'name' */
- X--- 168,179 ----
- X nf = newfont; /* keep current ptr */
- X nf->size = ss; /* store the size here */
- X nf->fname = flist[i].fn; /* keep actual name */
- X! nf->fstruct = NULL;
- X nf->next = NULL;
- X }
- X } /* next size */
- X } /* next font, f */
- X } /* !appres.SCALABLEFONTS */
- X }
- X
- X /* parse the point size of font 'name' */
- X***************
- X*** 182,254 ****
- X }
- X
- X /*
- X! * Lookup an X font corresponding to a Postscript font style that is close in
- X! * size and with angle "angle"
- X */
- X
- X! PIX_ROT_FONT
- X! lookfont(f, s, angle)
- X int f, s;
- X- float angle;
- X {
- X! struct xfont *xf;
- X! PIX_ROT_FONT fontst;
- X! int dir;
- X!
- X! /*** Must fix the following to actually return the "-normal font" ROTATED font */
- X! if (f == DEFAULT)
- X! f = 0; /* pass back the -normal font font */
- X! if (s < 0)
- X! s = DEF_FONTSIZE; /* default font size */
- X!
- X! #ifdef OPENWIN
- X! {
- X! /* to search for OpenWindows font - see below */
- X! char fn[128];
- X! int i;
- X!
- END_OF_FILE
- if test 28226 -ne `wc -c <'xfig.06'`; then
- echo shar: \"'xfig.06'\" unpacked with wrong size!
- fi
- # end of 'xfig.06'
- fi
- echo shar: End of archive 15 \(of 16\).
- cp /dev/null ark15isdone
- 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+
-