home *** CD-ROM | disk | FTP | other *** search
- /*
- * FIG : Facility for Interactive Generation of figures
- *
- * Copyright (c) 1988 by Supoj Sutanthavibul (supoj@sally.UTEXAS.EDU)
- * Febuary 1988.
- *
- * %W% %G%
- */
- #include "fig.h"
- #include "resources.h"
- #include "object.h"
- #include "paintop.h"
-
- extern int pointmarker_shown;
- extern int compoundbox_shown;
- extern int foreground_color, background_color;
-
- redisplay_objects(objects)
- F_compound *objects;
- {
- int fill;
-
- if (objects == NULL)
- return;
- for (fill=1; fill >= 0; fill--)
- {
- redisplay_arcobject(objects->arcs,fill);
- redisplay_compoundobject(objects->compounds,fill);
- redisplay_ellipseobject(objects->ellipses,fill);
- redisplay_lineobject(objects->lines,fill);
- redisplay_splineobject(objects->splines,fill);
- }
- if (pointmarker_shown) /* show the point markers if they are on */
- toggle_pointmarker();
- if (compoundbox_shown) {
- F_compound *c;
- for (c = objects->compounds; c != NULL; c = c->next)
- draw_compoundbox(c, INV_PAINT); /* show the compound boxes */
- }
- /* text doesn't have fill mode */
- redisplay_textobject(objects->texts);
- }
-
- redisplay_arcobject(arcs,fill)
- F_arc *arcs;
- int fill;
- {
- F_arc *arc;
-
- for (arc = arcs; arc != NULL; arc = arc->next)
- {
- if ((fill && arc->area_fill) ||
- (fill==0 && arc->area_fill == 0))
- draw_arc(arc, foreground_color);
- }
- }
-
- redisplay_ellipseobject(ellipses,fill)
- F_ellipse *ellipses;
- int fill;
- {
- F_ellipse *e;
-
- for (e = ellipses; e != NULL; e = e->next)
- {
- if ((fill && e->area_fill) ||
- (fill==0 && e->area_fill == 0))
- draw_ellipse(e, foreground_color);
- }
- }
-
- redisplay_lineobject(lines,fill)
- F_line *lines;
- int fill;
- {
- F_line *line;
-
- for (line = lines; line != NULL; line = line->next)
- {
- if ((fill && line->area_fill) ||
- (fill==0 && line->area_fill == 0))
- draw_line(line, PAINT);
- }
- }
-
- redisplay_splineobject(splines,fill)
- F_spline *splines;
- int fill;
- {
- F_spline *s;
-
- for (s = splines; s != NULL; s = s->next)
- {
- if ((fill && s->area_fill) ||
- (fill==0 && s->area_fill == 0))
- draw_spline(s, PAINT);
- }
- }
-
- redisplay_textobject(texts)
- F_text *texts;
- {
- F_text *t;
-
- for (t = texts; t != NULL; t = t->next)
- draw_text(t, PAINT);
- }
-
- redisplay_compoundobject(compounds,fill)
- F_compound *compounds;
- int fill;
- {
- F_compound *c;
-
- for(c = compounds; c != NULL; c = c->next) {
- redisplay_arcobject(c->arcs,fill);
- redisplay_compoundobject(c->compounds,fill);
- redisplay_ellipseobject(c->ellipses,fill);
- redisplay_lineobject(c->lines,fill);
- redisplay_splineobject(c->splines,fill);
-
- /* no filled text mode, just do text on non-filled pass */
- if(fill==0) {
- redisplay_textobject(c->texts);
- }
- }
- }
-
- redisplay_canvas()
- {
- extern F_compound objects;
-
- clear_canvas();
- set_temp_cursor(&wait_cursor);
- redisplay_objects(&objects);
- redisplay_grid();
- reset_cursor();
- }
-