home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-21 | 30.5 KB | 1,001 lines |
- ! for (i = 1; i < NUM_PS_FONTS + 1; i++)
- ! if (ps_fontinfo[i].xfontnum == f)
- ! {
- ! sprintf(fn, "%s-%d", ps_fontinfo[i].name, s);
- ! break;
- ! }
- !
- ! for (i = strlen(fn) - 1; i >= 0; i--)
- ! if (isupper(fn[i]))
- ! fn[i] = tolower(fn[i]);
- ! if (appres.DEBUG)
- ! fprintf(stderr, "Loading font %s\n", fn);
- ! set_temp_cursor(wait_cursor);
- ! app_flush();
- ! fontst = XRotLoadFont(tool_d, fn, angle);
- ! if (fontst == NULL) {
- ! fprintf(stderr, "xfig: Can't load font %s ?!, using %s\n",
- ! fn, appres.normalFont);
- ! fontst = XRotLoadFont(tool_d, appres.normalFont, angle);
- ! }
- ! reset_cursor();
- ! return (fontst);
- ! }
- !
- ! #else
- ! {
- char fn[128];
- char template[200];
- Boolean found;
- struct xfont *newfont, *nf, *oldnf;
- - struct flist *lp, *nlp, *oldlp;
-
- ! /* see if we've already loaded that font size 's' at angle 'angle'
- from the font family 'f' */
- ! /* actually, we've reduced the number of angles to four - 0, 90, 180 and 270 */
- ! if (angle < 0.0)
- ! angle += 2.0*M_PI;
- ! dir = (int)(angle/M_PI_2+0.0001);
- ! if (dir > 3)
- ! dir -= 4;
- found = False;
- ! /* start with the basic font name (e.g. adobe-times-medium-r-normal-...) */
- nf = x_fontinfo[f].xfontlist;
- oldnf = nf;
- if (nf != NULL) {
- --- 199,232 ----
- }
-
- /*
- ! * Lookup an X font, "f" corresponding to a Postscript font style that is
- ! * close in size to "s"
- */
-
- ! PIX_FONT
- ! lookfont(f, s)
- int f, s;
- {
- ! PIX_FONT fontst;
- char fn[128];
- char template[200];
- Boolean found;
- struct xfont *newfont, *nf, *oldnf;
-
- !
- ! if (f == DEFAULT)
- ! f = 0; /* pass back the -normal font font */
- ! if (s < 0)
- ! s = DEF_FONTSIZE; /* default font size */
- !
- ! /* see if we've already loaded that font size 's'
- from the font family 'f' */
- !
- found = False;
- !
- ! /* start with the basic font name (e.g. adobe-times-medium-r-normal-...
- ! OR times-roman for OpenWindows fonts) */
- !
- nf = x_fontinfo[f].xfontlist;
- oldnf = nf;
- if (nf != NULL) {
- ***************
- *** 268,278 ****
- strcpy(fn,nf->fname); /* put the name in fn */
- if (s < nf->size)
- put_msg("Font size %d not found, using larger %d point",s,nf->size);
- } else if (!appres.SCALABLEFONTS) { /* not found, use largest available */
- nf = oldnf;
- ! strcpy(fn,nf->fname); /* put the name in fn */
- if (s > nf->size)
- put_msg("Font size %d not found, using smaller %d point",s,nf->size);
- } else { /* SCALABLE; none yet of that size, alloc one and put it in the list */
- newfont = (struct xfont *) malloc(sizeof(struct xfont));
- /* add it on to the end of the list */
- --- 246,260 ----
- strcpy(fn,nf->fname); /* put the name in fn */
- if (s < nf->size)
- put_msg("Font size %d not found, using larger %d point",s,nf->size);
- + if (appres.DEBUG)
- + fprintf(stderr, "Located font %s\n", fn);
- } else if (!appres.SCALABLEFONTS) { /* not found, use largest available */
- nf = oldnf;
- ! strcpy(fn,nf->fname); /* put the name in fn */
- if (s > nf->size)
- put_msg("Font size %d not found, using smaller %d point",s,nf->size);
- + if (appres.DEBUG)
- + fprintf(stderr, "Using font %s for size %d\n", fn, s);
- } else { /* SCALABLE; none yet of that size, alloc one and put it in the list */
- newfont = (struct xfont *) malloc(sizeof(struct xfont));
- /* add it on to the end of the list */
- ***************
- *** 282,369 ****
- oldnf->next = newfont;
- nf = newfont; /* keep current ptr */
- nf->size = s; /* store the size here */
- ! nf->list = NULL;
- nf->next = NULL;
-
- ! /* create a full XLFD font name */
- ! strcpy(template,x_fontinfo[f].template);
- ! /* attach pointsize to font name */
- ! strcat(template,"%d-*-*-*-*-*-");
- ! /* add ISO8859 (if not Symbol font or ZapfDingbats) to font name */
- ! if (strstr(template,"symbol") == NULL &&
- strstr(template,"zapfdingbats") == NULL)
- strcat(template,"ISO8859-*");
- ! else
- strcat(template,"*-*");
- ! /* use the pixel field instead of points in the fontname so that the
- font scales with screen size */
- ! sprintf(fn, template, s);
- /* allocate space for the name and put it in the structure */
- ! nf->fname = (char *) malloc(strlen(fn));
- strcpy(nf->fname, fn);
- ! } /* if (!found) */
- ! if (appres.DEBUG)
- ! fprintf(stderr, "Loading font %s at angle %f (%f)\n",
- ! fn, (float) dir*90.0, angle);
- ! lp = nf->list;
- ! oldlp = lp;
- ! found = False;
- ! while (lp) {
- ! if (lp->dir == dir) {
- ! found = True;
- ! break;
- ! }
- ! oldlp = lp;
- ! lp = lp->next;
- ! } /* while (lp) */
- ! if (!found) {
- ! nlp = (struct flist *) malloc(sizeof(struct flist));
- ! nlp->next = NULL;
- ! if (oldlp)
- ! oldlp->next = nlp; /* add this to the list */
- ! else
- ! nf->list = nlp; /* first on the list */
- ! nlp->dir = dir;
- ! set_temp_cursor(wait_cursor);
- ! app_flush();
- ! fontst = XRotLoadFont(tool_d, fn, (float) dir*90.0);
- ! reset_cursor();
- ! if (fontst == NULL) {
- ! fprintf(stderr, "xfig: Can't load font %s ?!, using %s\n",
- fn, appres.normalFont);
- ! fontst = XRotLoadFont(tool_d, appres.normalFont, (float) dir*90.0);
- ! nf->fname = fn; /* keep actual name */
- ! }
- ! /* put the structure in the list */
- ! nlp->fstruct = fontst;
- ! lp = nlp;
- ! } /* if (!found) */
- ! fontst = lp->fstruct;
- ! return (fontst);
- ! }
-
- ! #endif /* !OPENWIN */
- !
- }
-
- ! /* print "string" in window "w" using font specified in fstruct at (x,y) */
-
- ! pw_text(w, x, y, op, fstruct, string, color)
- Window w;
- int x, y, op;
- ! PIX_ROT_FONT fstruct;
- char *string;
- Color color;
- {
- if (fstruct == NULL)
- fprintf(stderr,"Error, in pw_text, fstruct==NULL\n");
- ! pwx_text(w, x, y, op, fstruct, string, color);
- }
-
- ! pwx_text(w, x, y, op, fstruct, string, color)
- Window w;
- int x, y, op;
- ! PIX_ROT_FONT fstruct;
- char *string;
- Color color;
- {
- --- 264,335 ----
- oldnf->next = newfont;
- nf = newfont; /* keep current ptr */
- nf->size = s; /* store the size here */
- ! nf->fstruct = NULL;
- nf->next = NULL;
-
- ! if (openwinfonts) {
- ! /* OpenWindows fonts, create font name like times-roman-13 */
- ! sprintf(fn, "%s-%d", x_fontinfo[f].template, s);
- ! } else {
- ! /* X11 fonts, create a full XLFD font name */
- ! strcpy(template,x_fontinfo[f].template);
- ! /* attach pointsize to font name */
- ! strcat(template,"%d-*-*-*-*-*-");
- ! /* add ISO8859 (if not Symbol font or ZapfDingbats) to font name */
- ! if (strstr(template,"symbol") == NULL &&
- strstr(template,"zapfdingbats") == NULL)
- strcat(template,"ISO8859-*");
- ! else
- strcat(template,"*-*");
- ! /* use the pixel field instead of points in the fontname so that the
- font scales with screen size */
- ! sprintf(fn, template, s);
- ! }
- /* allocate space for the name and put it in the structure */
- ! nf->fname = (char *) malloc(strlen(fn)+1);
- strcpy(nf->fname, fn);
- ! } /* scalable */
- ! if (nf->fstruct == NULL) {
- ! if (appres.DEBUG)
- ! fprintf(stderr, "Loading font %s\n", fn);
- ! set_temp_cursor(wait_cursor);
- ! app_flush();
- ! fontst = XLoadQueryFont(tool_d, fn);
- ! reset_cursor();
- ! if (fontst == NULL) {
- ! fprintf(stderr, "xfig: Can't load font %s ?!, using %s\n",
- fn, appres.normalFont);
- ! fontst = XLoadQueryFont(tool_d, appres.normalFont);
- ! nf->fname = fn; /* keep actual name */
- ! }
- ! /* put the structure in the list */
- ! nf->fstruct = fontst;
- ! } /* if (nf->fstruct == NULL) */
-
- ! return (nf->fstruct);
- }
-
- ! /* print "string" in window "w" using font specified in fstruct at angle
- ! "angle" (radians) at (x,y) */
-
- ! pw_text(w, x, y, op, fstruct, angle, string, color)
- Window w;
- int x, y, op;
- ! PIX_FONT fstruct;
- ! float angle;
- char *string;
- Color color;
- {
- if (fstruct == NULL)
- fprintf(stderr,"Error, in pw_text, fstruct==NULL\n");
- ! pwx_text(w, x, y, op, fstruct, angle, string, color);
- }
-
- ! pwx_text(w, x, y, op, fstruct, angle, string, color)
- Window w;
- int x, y, op;
- ! PIX_FONT fstruct;
- ! float angle;
- char *string;
- Color color;
- {
- ***************
- *** 385,404 ****
- gc_color[op] = writing_bitmap? color : x_color(color);
- }
- }
- ! zXRotDrawString(tool_d, w, fstruct, gccache[op], x, y,
- ! string, strlen(string));
- }
-
- pr_size
- pf_textwidth(fstruct, n, s)
- ! PIX_ROT_FONT fstruct;
- int n;
- char *s;
- {
- pr_size ret;
-
- ! ret.x = XRotTextWidth(fstruct, s, n);
- ! ret.y = XRotTextHeight(fstruct, s, n);
- return (ret);
- }
-
- --- 351,370 ----
- gc_color[op] = writing_bitmap? color : x_color(color);
- }
- }
- ! zXRotDrawString(tool_d, fstruct, angle, w, gccache[op],
- ! x, y, string);
- }
-
- pr_size
- pf_textwidth(fstruct, n, s)
- ! PIX_FONT fstruct;
- int n;
- char *s;
- {
- pr_size ret;
-
- ! ret.x = XTextWidth(fstruct, s, n);
- ! ret.y = char_height(fstruct);
- return (ret);
- }
-
- ***************
- *** 476,487 ****
- gcv.arc_mode = ArcPieSlice; /* fill mode for arcs */
- gcv.fill_rule = EvenOddRule /* WindingRule */ ;
- for (i = 0; i < NUMFILLPATS; i++) {
- ! /* make color fill pattern with black bg (fg is set later in set_x_color() */
- fill_gc[i] = makegc(PAINT, x_fg_color.pixel, x_color(BLACK));
- ! un_fill_gc[i] = makegc(ERASE, x_fg_color.pixel, x_color(BLACK));
- /* make black fill pattern with default background */
- black_fill_gc[i] = makegc(PAINT, x_fg_color.pixel, x_bg_color.pixel);
- ! black_un_fill_gc[i] = makegc(ERASE, x_fg_color.pixel, x_bg_color.pixel);
- gcv.stipple = fill_pm[i];
- XChangeGC(tool_d, fill_gc[i],
- GCStipple | GCFillStyle | GCFillRule | GCArcMode, &gcv);
- --- 442,454 ----
- gcv.arc_mode = ArcPieSlice; /* fill mode for arcs */
- gcv.fill_rule = EvenOddRule /* WindingRule */ ;
- for (i = 0; i < NUMFILLPATS; i++) {
- ! /* make color fill pattern with black bg - fg is set later in set_fillgc() */
- fill_gc[i] = makegc(PAINT, x_fg_color.pixel, x_color(BLACK));
- ! /* make un-fill gc's with canvas background color as foreground */
- ! un_fill_gc[i] = makegc(PAINT, x_bg_color.pixel, x_color(BLACK));
- /* make black fill pattern with default background */
- black_fill_gc[i] = makegc(PAINT, x_fg_color.pixel, x_bg_color.pixel);
- ! black_un_fill_gc[i] = makegc(PAINT, x_bg_color.pixel, x_fg_color.pixel);
- gcv.stipple = fill_pm[i];
- XChangeGC(tool_d, fill_gc[i],
- GCStipple | GCFillStyle | GCFillRule | GCArcMode, &gcv);
- ***************
- *** 744,755 ****
- Color color;
- {
- short xmin, ymin;
- ! unsigned short wd, ht;
-
- ! xmin = (short) min2(xstart, xend);
- ! ymin = (short) min2(ystart, yend);
- ! wd = (unsigned short) abs(xstart - xend);
- ! ht = (unsigned short) abs(ystart - yend);
-
- /* if it's a fill pat we know about */
- if (fill_style >= 1 && fill_style <= NUMFILLPATS) {
- --- 711,722 ----
- Color color;
- {
- short xmin, ymin;
- ! unsigned int wd, ht;
-
- ! xmin = min2(xstart, xend);
- ! ymin = min2(ystart, yend);
- ! wd = (unsigned int) abs(xstart - xend);
- ! ht = (unsigned int) abs(ystart - yend);
-
- /* if it's a fill pat we know about */
- if (fill_style >= 1 && fill_style <= NUMFILLPATS) {
- ***************
- *** 891,899 ****
- Color color;
- {
- if (op == PAINT) {
- ! fillgc = ((color==BLACK ||
- ! (color==DEFAULT_COLOR && x_fg_color.pixel==appres.color[BLACK]) ||
- ! (!all_colors_available && color!=WHITE))?
- black_fill_gc[fill_style - 1]: fill_gc[fill_style - 1]);
- if (writing_bitmap)
- {
- --- 858,865 ----
- Color color;
- {
- if (op == PAINT) {
- ! fillgc = (color==BLACK ||
- ! (color==DEFAULT_COLOR && x_fg_color.pixel==appres.color[BLACK])?
- black_fill_gc[fill_style - 1]: fill_gc[fill_style - 1]);
- if (writing_bitmap)
- {
- ***************
- *** 904,915 ****
- XSetForeground(tool_d,fillgc,color);
- }
- else
- ! set_x_color(fillgc, color);
- } else
- ! fillgc = ((color==BLACK ||
- ! (color==DEFAULT_COLOR && x_fg_color.pixel==appres.color[BLACK]) ||
- ! (!all_colors_available && color!=WHITE))?
- ! black_un_fill_gc[fill_style - 1]: un_fill_gc[fill_style - 1]);
- XSetClipRectangles(tool_d, fillgc, 0, 0, clip, 1, YXBanded);
- }
-
- --- 870,880 ----
- XSetForeground(tool_d,fillgc,color);
- }
- else
- ! set_fill_color(fillgc, color);
- } else
- ! fillgc = (color==BLACK ||
- ! (color==DEFAULT_COLOR && x_fg_color.pixel==appres.color[BLACK])?
- ! black_un_fill_gc[NUMFILLPATS-1]: un_fill_gc[NUMFILLPATS-1]);
- XSetClipRectangles(tool_d, fillgc, 0, 0, clip, 1, YXBanded);
- }
-
- ***************
- *** 920,926 ****
- {
- XGCValues gcv;
- unsigned long mask;
- ! static unsigned char dash_list[2] = {-1, -1};
-
- switch (style) {
- case RUBBER_LINE:
- --- 885,891 ----
- {
- XGCValues gcv;
- unsigned long mask;
- ! static unsigned char dash_list[2] = {255, 255};
-
- switch (style) {
- case RUBBER_LINE:
- ***************
- *** 952,958 ****
-
- if (width == gc_thickness[op] && style == gc_line_style[op] &&
- (writing_bitmap? color == gc_color[op] : x_color(color) == gc_color[op]) &&
- ! (style != DASH_LINE && style != DOTTED_LINE ||
- dash_list[1] == (char) round(style_val * zoomscale)))
- return; /* no need to change anything */
-
- --- 917,923 ----
-
- if (width == gc_thickness[op] && style == gc_line_style[op] &&
- (writing_bitmap? color == gc_color[op] : x_color(color) == gc_color[op]) &&
- ! ((style != DASH_LINE && style != DOTTED_LINE) ||
- dash_list[1] == (char) round(style_val * zoomscale)))
- return; /* no need to change anything */
-
- diff -rc xfig.2.1.7a/w_drawprim.h xfig.2.1.8/w_drawprim.h
- *** xfig.2.1.7a/w_drawprim.h Wed Jan 6 11:26:39 1993
- --- xfig.2.1.8/w_drawprim.h Fri Sep 3 11:14:29 1993
- ***************
- *** 14,20 ****
- extern PIX_FONT bold_font;
- extern PIX_FONT roman_font;
- extern PIX_FONT button_font;
- ! extern PIX_ROT_FONT canvas_font;
-
- /* Maximum number of points for polygons etc */
- #define MAXNUMPTS 10000
- --- 14,20 ----
- extern PIX_FONT bold_font;
- extern PIX_FONT roman_font;
- extern PIX_FONT button_font;
- ! extern PIX_FONT canvas_font;
-
- /* Maximum number of points for polygons etc */
- #define MAXNUMPTS 10000
- ***************
- *** 26,44 ****
- #define char_height(font) \
- ((font)->max_bounds.ascent + (font)->max_bounds.descent)
-
- ! #define rot_char_width(rotfont) ((rotfont)->width)
- ! #define rot_char_height(rotfont) \
- ! ((rotfont)->max_ascent + (rotfont)->max_descent)
-
- ! #define rot_char_advance(font,char) \
- (((font)->per_char)?\
- ! ((font)->per_char[(char)-(font)->min_char].width):\
- ! ((font)->width))
-
- #define set_x_color(gc,col) XSetForeground(tool_d,gc,\
- (!all_colors_available? (col==WHITE?x_bg_color.pixel:x_fg_color.pixel): \
- ! (col<0||col>=NUMCOLORS)? x_fg_color.pixel:appres.color[col]))
-
- #define x_color(col)\
- (!all_colors_available? (col==WHITE?x_bg_color.pixel:x_fg_color.pixel): \
- ! (col<0||col>=NUMCOLORS)? x_fg_color.pixel:appres.color[col])
- --- 26,46 ----
- #define char_height(font) \
- ((font)->max_bounds.ascent + (font)->max_bounds.descent)
-
- ! #define char_width(font) ((font)->max_bounds.width)
-
- ! #define char_advance(font,char) \
- (((font)->per_char)?\
- ! ((font)->per_char[(char)-(font)->min_char_or_byte2].width):\
- ! ((font)->max_bounds.width))
-
- #define set_x_color(gc,col) XSetForeground(tool_d,gc,\
- (!all_colors_available? (col==WHITE?x_bg_color.pixel:x_fg_color.pixel): \
- ! (col<0||col>=NUMCOLORS)? x_fg_color.pixel:appres.color[col]))
-
- + #define set_fill_color(gc,col) XSetForeground(tool_d,gc,\
- + (!all_colors_available? (col==BLACK?x_fg_color.pixel:x_bg_color.pixel): \
- + (col<0||col>=NUMCOLORS)? x_fg_color.pixel:appres.color[col]))
- +
- #define x_color(col)\
- (!all_colors_available? (col==WHITE?x_bg_color.pixel:x_fg_color.pixel): \
- ! (col<0||col>=NUMCOLORS)? x_fg_color.pixel:appres.color[col])
- diff -rc xfig.2.1.7a/w_export.c xfig.2.1.8/w_export.c
- *** xfig.2.1.7a/w_export.c Fri Apr 16 10:35:46 1993
- --- xfig.2.1.8/w_export.c Tue Aug 24 14:21:33 1993
- ***************
- *** 22,27 ****
- --- 22,28 ----
- extern String text_translations;
- extern Widget make_popup_menu();
- extern char *panel_get_value();
- + extern Boolean query_save();
- extern Widget file_popup;
- extern Widget file_dir;
-
- ***************
- *** 31,36 ****
- --- 32,41 ----
-
- /* LOCAL */
-
- + static String file_list_translations =
- + "<Btn1Down>,<Btn1Up>: Set()Notify()\n\
- + <Btn1Down>(2): export()\n\
- + <Key>Return: ExportFile()\n";
- static String file_name_translations =
- "<Key>Return: ExportFile()\n";
- void do_export();
- ***************
- *** 104,109 ****
- --- 109,115 ----
- }
-
- static char export_msg[] = "EXPORT";
- + static char exp_msg[] = "The current figure is modified.\nDo you want to save it before exporting?";
-
- void
- do_export(w)
- ***************
- *** 116,121 ****
- --- 122,131 ----
- if (emptyfigure_msg(export_msg))
- return;
-
- + /* if modified (and non-empty) ask to save first */
- + if (!query_save(exp_msg))
- + return; /* cancel, do not export */
- +
- if (!export_popup)
- create_export_panel(w);
- FirstArg(XtNstring, &fval);
- ***************
- *** 123,130 ****
- if (emptyname(fval)) { /* output filename is empty, use default */
- fval = default_export_file;
- warnexist = False; /* don't warn if this file exists */
- ! } else {
- ! warnexist = True; /* otherwise warn if the file exists */
- }
-
- /* if not absolute path, change directory */
- --- 133,140 ----
- if (emptyname(fval)) { /* output filename is empty, use default */
- fval = default_export_file;
- warnexist = False; /* don't warn if this file exists */
- ! } else if (strcmp(fval,default_export_file) != 0) {
- ! warnexist = True; /* warn if the file exists and is diff. from default */
- }
-
- /* if not absolute path, change directory */
- ***************
- *** 394,402 ****
-
- create_dirinfo(export_panel, exp_selfile, &beside, &below,
- &exp_mask, &exp_dir, &exp_flist, &exp_dlist);
- ! /* make <return> in the file list window export the file */
- XtOverrideTranslations(exp_flist,
- ! XtParseTranslationTable(file_name_translations));
-
- FirstArg(XtNlabel, "Cancel");
- NextArg(XtNfromHoriz, beside);
- --- 404,412 ----
-
- create_dirinfo(export_panel, exp_selfile, &beside, &below,
- &exp_mask, &exp_dir, &exp_flist, &exp_dlist);
- ! /* make <return> or double click in the file list window export the file */
- XtOverrideTranslations(exp_flist,
- ! XtParseTranslationTable(file_list_translations));
-
- FirstArg(XtNlabel, "Cancel");
- NextArg(XtNfromHoriz, beside);
- ***************
- *** 463,467 ****
- --- 473,479 ----
- FirstArg(XtNstring, &dval);
- GetValues(file_dir);
- strcpy(export_dir,dval);
- + } else {
- + strcpy(export_dir,cur_dir);
- }
- }
- diff -rc xfig.2.1.7a/w_file.c xfig.2.1.8/w_file.c
- *** xfig.2.1.7a/w_file.c Mon Mar 22 14:41:00 1993
- --- xfig.2.1.8/w_file.c Tue Aug 31 13:40:00 1993
- ***************
- *** 33,38 ****
- --- 33,42 ----
- static Widget cancel, save, merge, load;
- static Widget file_w;
- static Position xposn, yposn;
- + static String file_list_translations =
- + "<Btn1Down>,<Btn1Up>: Set()Notify()\n\
- + <Btn1Down>(2): load()\n\
- + <Key>Return: load()\n";
- static String file_name_translations =
- "<Key>Return: load()\n";
- static void file_panel_cancel(), do_merge();
- ***************
- *** 79,85 ****
- Widget w;
- XButtonEvent *ev;
- {
- ! char filename[100];
- char *fval, *dval;
-
- FirstArg(XtNstring, &fval);
- --- 83,89 ----
- Widget w;
- XButtonEvent *ev;
- {
- ! char filename[200];
- char *fval, *dval;
-
- FirstArg(XtNstring, &fval);
- ***************
- *** 107,112 ****
- --- 111,126 ----
- {
- char *fval, *dval;
-
- + /* first check if the figure was modified before reloading it */
- + if (!emptyfigure() && figure_modified) {
- + if (file_popup)
- + XtSetSensitive(load, False);
- + if (!popup_query(QUERY_YESCAN, load_msg)) {
- + if (file_popup)
- + XtSetSensitive(load, True);
- + return;
- + }
- + }
- if (file_popup) {
- FirstArg(XtNstring, &dval);
- GetValues(file_dir);
- ***************
- *** 113,131 ****
- FirstArg(XtNstring, &fval);
- GetValues(file_selfile); /* check the ascii widget for a filename */
- if (emptyname(fval))
- ! fval = cur_filename; /* "Filename" widget empty, use current filename */
- !
- if (emptyname_msg(fval, "LOAD"))
- return;
- -
- - if (!emptyfigure() && figure_modified) {
- - XtSetSensitive(load, False);
- - if (!popup_query(QUERY_YES, load_msg)) {
- - XtSetSensitive(load, True);
- - return;
- - }
- - XtSetSensitive(load, True);
- - }
- if (change_directory(dval) == 0) {
- if (load_file(fval) == 0) {
- FirstArg(XtNlabel, fval);
- --- 127,135 ----
- FirstArg(XtNstring, &fval);
- GetValues(file_selfile); /* check the ascii widget for a filename */
- if (emptyname(fval))
- ! fval = cur_filename; /* Filename widget empty, use current filename */
- if (emptyname_msg(fval, "LOAD"))
- return;
- if (change_directory(dval) == 0) {
- if (load_file(fval) == 0) {
- FirstArg(XtNlabel, fval);
- ***************
- *** 133,138 ****
- --- 137,143 ----
- if (fval != cur_filename)
- update_cur_filename(fval); /* and update cur_filename */
- update_def_filename(); /* and the default export filename */
- + XtSetSensitive(load, True);
- file_panel_dismiss();
- }
- }
- ***************
- *** 191,196 ****
- --- 196,223 ----
- }
- }
-
- + Boolean
- + query_save(msg)
- + char *msg;
- + {
- + int qresult;
- + if (!emptyfigure() && figure_modified && !aborting) {
- + if ((qresult = popup_query(QUERY_YESNOCAN, msg)) == RESULT_CANCEL)
- + return False;
- + else if (qresult == RESULT_YES) {
- + do_save((Widget) 0);
- + /*
- + * if saving was not successful, figure_modified is still true:
- + * do not quit!
- + */
- + if (figure_modified)
- + return False;
- + }
- + }
- + /* ok */
- + return True;
- + }
- +
- static void
- file_panel_cancel(w, ev)
- Widget w;
- ***************
- *** 230,236 ****
- create_file_panel(w)
- Widget w;
- {
- ! Widget file, dir, beside, below;
- PIX_FONT temp_font;
- static int actions_added=0;
- file_w = w;
- --- 257,263 ----
- create_file_panel(w)
- Widget w;
- {
- ! Widget file, beside, below;
- PIX_FONT temp_font;
- static int actions_added=0;
- file_w = w;
- ***************
- *** 314,328 ****
- XtAppAddActions(tool_app, file_name_actions, XtNumber(file_name_actions));
- }
-
- /* make <return> in the filename window load the file */
- XtOverrideTranslations(file_selfile,
- XtParseTranslationTable(file_name_translations));
-
- ! create_dirinfo(file_panel, file_selfile, &beside, &below,
- ! &file_mask, &file_dir, &file_flist, &file_dlist);
- ! /* make <return> in the file list window load the file */
- ! XtOverrideTranslations(file_flist,
- ! XtParseTranslationTable(file_name_translations));
- FirstArg(XtNlabel, "Cancel");
- NextArg(XtNvertDistance, 15);
- NextArg(XtNhorizDistance, 25);
- --- 341,356 ----
- XtAppAddActions(tool_app, file_name_actions, XtNumber(file_name_actions));
- }
-
- + create_dirinfo(file_panel, file_selfile, &beside, &below,
- + &file_mask, &file_dir, &file_flist, &file_dlist);
- +
- /* make <return> in the filename window load the file */
- XtOverrideTranslations(file_selfile,
- XtParseTranslationTable(file_name_translations));
-
- ! /* make <return> and a double click in the file list window load the file */
- ! XtAugmentTranslations(file_flist,
- ! XtParseTranslationTable(file_list_translations));
- FirstArg(XtNlabel, "Cancel");
- NextArg(XtNvertDistance, 15);
- NextArg(XtNhorizDistance, 25);
- diff -rc xfig.2.1.7a/w_fontbits3.c xfig.2.1.8/w_fontbits3.c
- *** xfig.2.1.7a/w_fontbits3.c Wed Dec 9 17:26:05 1992
- --- xfig.2.1.8/w_fontbits3.c Mon Aug 23 15:26:38 1993
- ***************
- *** 771,780 ****
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
- ! Pixmap psfont_menu_bitmaps[NUM_PS_FONTS + 1];
- Pixmap latexfont_menu_bitmaps[NUM_LATEX_FONTS];
-
- ! unsigned char *psfont_menu_bits[NUM_PS_FONTS + 1] = {
- PS_Default_bits,
- Times_Roman_bits,
- Times_Italic_bits,
- --- 771,780 ----
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
- ! Pixmap psfont_menu_bitmaps[NUM_FONTS + 1];
- Pixmap latexfont_menu_bitmaps[NUM_LATEX_FONTS];
-
- ! unsigned char *psfont_menu_bits[NUM_FONTS + 1] = {
- PS_Default_bits,
- Times_Roman_bits,
- Times_Italic_bits,
- diff -rc xfig.2.1.7a/w_fontpanel.c xfig.2.1.8/w_fontpanel.c
- *** xfig.2.1.7a/w_fontpanel.c Sat Jan 2 18:42:19 1993
- --- xfig.2.1.8/w_fontpanel.c Mon Aug 23 16:22:59 1993
- ***************
- *** 24,31 ****
- extern Pixmap psfont_menu_bitmaps[];
- extern Pixmap latexfont_menu_bitmaps[];
- extern Atom wm_delete_window;
- ! extern struct _fstruct ps_fontinfo[]; /* font names */
- ! extern struct _fstruct latex_fontinfo[]; /* font names */
-
- /* LOCAL VARIABLES */
-
- --- 24,31 ----
- extern Pixmap psfont_menu_bitmaps[];
- extern Pixmap latexfont_menu_bitmaps[];
- extern Atom wm_delete_window;
- ! extern struct _fstruct ps_fontinfo[]; /* PostScript/OpenWindows font names */
- ! extern struct _fstruct latex_fontinfo[]; /* LaTeX font names */
-
- /* LOCAL VARIABLES */
-
- ***************
- *** 37,43 ****
-
- /******************** local variables ***************************/
-
- ! static MenuItemRec ps_fontmenu_items[NUM_PS_FONTS + 1];
- static MenuItemRec latex_fontmenu_items[NUM_LATEX_FONTS];
-
- static void fontpane_select();
- --- 37,43 ----
-
- /******************** local variables ***************************/
-
- ! static MenuItemRec ps_fontmenu_items[NUM_FONTS + 1];
- static MenuItemRec latex_fontmenu_items[NUM_LATEX_FONTS];
-
- static void fontpane_select();
- ***************
- *** 59,65 ****
-
- static TOOL ps_fontpanes, ps_buttons;
- static TOOL latex_fontpanes, latex_buttons;
- ! static TOOL ps_fontpane[NUM_PS_FONTS + 1];
- static TOOL latex_fontpane[NUM_LATEX_FONTS];
-
- init_fontmenu(tool)
- --- 59,65 ----
-
- static TOOL ps_fontpanes, ps_buttons;
- static TOOL latex_fontpanes, latex_buttons;
- ! static TOOL ps_fontpane[NUM_FONTS+1];
- static TOOL latex_fontpane[NUM_LATEX_FONTS];
-
- init_fontmenu(tool)
- ***************
- *** 96,102 ****
- latex_fontpanes = XtCreateManagedWidget("menu", boxWidgetClass,
- latex_fontmenu, Args, ArgCount);
-
- ! for (i = 0; i < NUM_PS_FONTS + 1; i++) {
- ps_fontmenu_items[i].type = MENU_IMAGESTRING; /* put the fontnames in
- * menu */
- ps_fontmenu_items[i].label = ps_fontinfo[i].name;
- --- 96,102 ----
- latex_fontpanes = XtCreateManagedWidget("menu", boxWidgetClass,
- latex_fontmenu, Args, ArgCount);
-
- ! for (i = 0; i < NUM_FONTS + 1; i++) {
- ps_fontmenu_items[i].type = MENU_IMAGESTRING; /* put the fontnames in
- * menu */
- ps_fontmenu_items[i].label = ps_fontinfo[i].name;
- ***************
- *** 161,167 ****
- NextArg(XtNborderWidth, INTERNAL_BW);
- NextArg(XtNresize, False); /* don't allow resize */
-
- ! for (i = 0; i < NUM_PS_FONTS + 1; ++i) {
- mi = &ps_fontmenu_items[i];
- pane_callbacks[0].closure = (caddr_t) mi;
- ps_fontpane[i] = XtCreateManagedWidget("pane", commandWidgetClass,
- --- 161,167 ----
- NextArg(XtNborderWidth, INTERNAL_BW);
- NextArg(XtNresize, False); /* don't allow resize */
-
- ! for (i = 0; i < NUM_FONTS + 1; ++i) {
- mi = &ps_fontmenu_items[i];
- pane_callbacks[0].closure = (caddr_t) mi;
- ps_fontpane[i] = XtCreateManagedWidget("pane", commandWidgetClass,
- ***************
- *** 197,203 ****
-
- /* Create the bitmaps */
-
- ! for (i = 0; i < NUM_PS_FONTS + 1; i++)
- psfont_menu_bitmaps[i] = XCreatePixmapFromBitmapData(tool_d,
- XtWindow(ind_panel), (char *) psfont_menu_bits[i],
- PS_FONTPANE_WD, PS_FONTPANE_HT, fg, bg,
- --- 197,203 ----
-
- /* Create the bitmaps */
-
- ! for (i = 0; i < NUM_FONTS + 1; i++)
- psfont_menu_bitmaps[i] = XCreatePixmapFromBitmapData(tool_d,
- XtWindow(ind_panel), (char *) psfont_menu_bits[i],
- PS_FONTPANE_WD, PS_FONTPANE_HT, fg, bg,
- ***************
- *** 210,216 ****
- XDefaultDepthOfScreen(tool_s));
-
- /* Store the bitmaps in the menu panes */
- ! for (i = 0; i < NUM_PS_FONTS + 1; i++) {
- FirstArg(XtNbitmap, psfont_menu_bitmaps[i]);
- SetValues(ps_fontpane[i]);
- }
- --- 210,216 ----
- XDefaultDepthOfScreen(tool_s));
-
- /* Store the bitmaps in the menu panes */
- ! for (i = 0; i < NUM_FONTS + 1; i++) {
- FirstArg(XtNbitmap, psfont_menu_bitmaps[i]);
- SetValues(ps_fontpane[i]);
- }
- diff -rc xfig.2.1.7a/w_indpanel.c xfig.2.1.8/w_indpanel.c
- *** xfig.2.1.7a/w_indpanel.c Thu Oct 21 10:23:00 1993
- --- xfig.2.1.8/w_indpanel.c Tue Sep 14 09:14:06 1993
- ***************
- *** 25,30 ****
- --- 25,31 ----
- #include "w_util.h"
- #include "w_zoom.h"
-
- + #define MAX_SCROLL_WD 50
- extern Pixmap psfont_menu_bitmaps[], latexfont_menu_bitmaps[];
- extern Atom wm_delete_window;
- extern struct _fstruct ps_fontinfo[], latex_fontinfo[];
- ***************
- *** 88,93 ****
- --- 89,95 ----
-
- static int popup_fonts();
- static void note_state();
- + static void set_all_update(), clr_all_update(), tog_all_update();
-
- static char indbuf[12];
- static float old_zoomscale = -1.0;
- ***************
- *** 94,99 ****
- --- 96,103 ----
- static int old_rotnangle = -1;
- static float old_elltextangle = -1.0;
-
- + Widget upd_ctrl, set_upd, upd_tog,
- + clr_upd, tog_upd, upd_ctrl_lab, upd_ctrl_btns;
- #define DEF_IND_SW_HT 32
- #define DEF_IND_SW_WD 64
- #define FONT_IND_SW_WD (40+PS_FONTPANE_WD)
- ***************
- *** 115,133 ****
- #define NUM_ANGLEGEOM_CHOICES (sizeof(anglegeom_choices)/sizeof(choice_info))
-
- static choice_info valign_choices[] = {
- ! {NONE, &none_ic,},
- ! {TOP, &valignt_ic,},
- ! {CENTER, &valignc_ic,},
- ! {BOTTOM, &valignb_ic,},
- };
-
- #define NUM_VALIGN_CHOICES (sizeof(valign_choices)/sizeof(choice_info))
-
- static choice_info halign_choices[] = {
- ! {NONE, &none_ic,},
- ! {LEFT, &halignl_ic,},
- ! {CENTER, &halignc_ic,},
- ! {RIGHT, &halignr_ic,},
- };
-
- #define NUM_HALIGN_CHOICES (sizeof(halign_choices)/sizeof(choice_info))
- --- 119,137 ----
- #define NUM_ANGLEGEOM_CHOICES (sizeof(anglegeom_choices)/sizeof(choice_info))
-
- static choice_info valign_choices[] = {
- ! {ALIGN_NONE, &none_ic,},
- ! {ALIGN_TOP, &valignt_ic,},
- ! {ALIGN_CENTER, &valignc_ic,},
- ! {ALIGN_BOTTOM, &valignb_ic,},
-