~ubuntu-branches/ubuntu/raring/xfig/raring

« back to all changes in this revision

Viewing changes to u_redraw.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2007-05-20 23:33:59 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070520233359-4ejk0ave70m2ihlz
Tags: 1:3.2.5-rel-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu change:
  - .desktop added.
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include "w_util.h"
35
35
#include "w_zoom.h"
36
36
 
 
37
#include "d_text.h"
 
38
#include "u_bound.h"
 
39
#include "u_elastic.h"
 
40
#include "u_markers.h"
 
41
#include "w_cursor.h"
 
42
#include "w_rulers.h"
 
43
 
37
44
/* EXPORTS */
38
45
 
39
46
/* set in redisplay_region if called when preview_in_progress is true */
61
68
 * Function to clear the array of object counts with file load or new command.
62
69
 */
63
70
 
 
71
 
 
72
void redisplay_arcobject (F_arc *arcs, int depth);
 
73
void redisplay_compoundobject (F_compound *compounds, int depth);
 
74
void redisplay_ellipseobject (F_ellipse *ellipses, int depth);
 
75
void redisplay_lineobject (F_line *lines, int depth);
 
76
void redisplay_splineobject (F_spline *splines, int depth);
 
77
void redisplay_textobject (F_text *texts, int depth);
 
78
void redraw_pageborder (void);
 
79
void draw_pb (int x, int y, int w, int h);
 
80
 
64
81
void
65
 
clearallcounts()
 
82
clearallcounts(void)
66
83
{
67
84
    register struct counts *cp;
68
85
 
81
98
 */
82
99
 
83
100
void
84
 
clearcounts()
 
101
clearcounts(void)
85
102
{
86
103
    register struct counts *cp;
87
104
 
94
111
    }
95
112
}
96
113
 
97
 
redisplay_objects(active_objects)
98
 
    F_compound     *active_objects;
 
114
void redisplay_objects(F_compound *active_objects)
99
115
{
100
116
    int             depth;
101
117
    F_compound     *objects, *save_objects;
178
194
 * the counts array.
179
195
 */
180
196
 
181
 
redisplay_arcobject(arcs, depth)
182
 
    F_arc          *arcs;
183
 
    int             depth;
 
197
void redisplay_arcobject(F_arc *arcs, int depth)
184
198
{
185
199
    F_arc          *arc;
186
200
    struct counts  *cp;
205
219
 * appropriate depth in the counts array.
206
220
 */
207
221
 
208
 
redisplay_ellipseobject(ellipses, depth)
209
 
    F_ellipse      *ellipses;
210
 
    int             depth;
 
222
void redisplay_ellipseobject(F_ellipse *ellipses, int depth)
211
223
{
212
224
    F_ellipse      *ep;
213
225
    struct counts  *cp;
233
245
 * depth in the counts array.
234
246
 */
235
247
 
236
 
redisplay_lineobject(lines, depth)
237
 
    F_line         *lines;
238
 
    int             depth;
 
248
void redisplay_lineobject(F_line *lines, int depth)
239
249
{
240
250
    F_line         *lp;
241
251
    struct counts  *cp;
261
271
 * appropriate depth in the counts array.
262
272
 */
263
273
 
264
 
redisplay_splineobject(splines, depth)
265
 
    F_spline       *splines;
266
 
    int             depth;
 
274
void redisplay_splineobject(F_spline *splines, int depth)
267
275
{
268
276
    F_spline       *spline;
269
277
    struct counts  *cp;
288
296
 * array.
289
297
 */
290
298
 
291
 
redisplay_textobject(texts, depth)
292
 
    F_text         *texts;
293
 
    int             depth;
 
299
void redisplay_textobject(F_text *texts, int depth)
294
300
{
295
301
    F_text         *text;
296
302
    struct counts  *cp;
314
320
 * work out to the objects contained in the compound.
315
321
 */
316
322
 
317
 
redisplay_compoundobject(compounds, depth)
318
 
    F_compound     *compounds;
319
 
    int             depth;
 
323
void redisplay_compoundobject(F_compound *compounds, int depth)
320
324
{
321
325
    F_compound     *c;
322
326
 
334
338
 * Redisplay the entire drawing.
335
339
 */
336
340
void
337
 
redisplay_canvas()
 
341
redisplay_canvas(void)
338
342
{
339
343
    /* turn off Compose key LED */
340
344
    setCompLED(0);
345
349
 
346
350
/* redisplay the object currently being created by the user (if any) */
347
351
 
348
 
redisplay_curobj()
 
352
void redisplay_curobj(void)
349
353
{
350
354
    F_point     *p;
351
355
    int          rx,ry,i;
438
442
    }
439
443
}
440
444
 
441
 
redisplay_region(xmin, ymin, xmax, ymax)
442
 
    int             xmin, ymin, xmax, ymax;
 
445
void redisplay_region(int xmin, int ymin, int xmax, int ymax)
443
446
{
444
447
    /* if we're generating a preview, don't redisplay the canvas 
445
448
       but set request flag so preview will call us with full canvas 
466
469
 
467
470
/* update page border with new page size */
468
471
 
469
 
update_pageborder()
 
472
void update_pageborder(void)
470
473
{
471
474
    if (appres.show_pageborder) {
472
475
        clear_canvas();
478
481
/* also make light blue lines vertically and horizontally through 0,0 if
479
482
   showaxislines is true */
480
483
 
481
 
redisplay_pageborder()
 
484
void redisplay_pageborder(void)
482
485
{
483
486
 
484
487
    set_clip_window(clip_xmin, clip_ymin, clip_xmax, clip_ymax);
496
499
        redraw_pageborder();
497
500
}
498
501
 
499
 
redraw_pageborder()
 
502
void redraw_pageborder(void)
500
503
{
501
504
    int            pwd, pht, ux;
502
505
    int            x, y;
519
522
    }
520
523
    /* if multiple page mode, draw all page borders that are visible */
521
524
    if (appres.multiple) {
522
 
        int     wd, ht, xoff, yoff;
 
525
        int     wd, ht;
523
526
 
524
527
        wd = CANVAS_WD/zoomscale;
525
528
        ht = CANVAS_HT/zoomscale;
562
565
    XDrawString(tool_d,canvas_win,border_gc,ZOOMX(pwd)+3,ZOOMY(pht),pname,strlen(pname));
563
566
}
564
567
 
565
 
draw_pb(x, y, w, h)
566
 
    int            x, y, w, h;
 
568
void draw_pb(int x, int y, int w, int h)
567
569
{
568
570
        zXDrawLine(tool_d, canvas_win, border_gc, x,   y,   x+w, y);
569
571
        zXDrawLine(tool_d, canvas_win, border_gc, x+w, y,   x+w, y+h);
571
573
        zXDrawLine(tool_d, canvas_win, border_gc, x,   y+h, x,   y);
572
574
}
573
575
 
574
 
redisplay_zoomed_region(xmin, ymin, xmax, ymax)
575
 
    int             xmin, ymin, xmax, ymax;
 
576
void redisplay_zoomed_region(int xmin, int ymin, int xmax, int ymax)
576
577
{
577
578
    redisplay_region(ZOOMX(xmin), ZOOMY(ymin), ZOOMX(xmax), ZOOMY(ymax));
578
579
}
579
580
 
580
 
redisplay_ellipse(e)
581
 
    F_ellipse      *e;
 
581
void redisplay_ellipse(F_ellipse *e)
582
582
{
583
583
    int             xmin, ymin, xmax, ymax;
584
584
 
586
586
    redisplay_zoomed_region(xmin, ymin, xmax, ymax);
587
587
}
588
588
 
589
 
redisplay_ellipses(e1, e2)
590
 
    F_ellipse      *e1, *e2;
 
589
void redisplay_ellipses(F_ellipse *e1, F_ellipse *e2)
591
590
{
592
591
    int             xmin1, ymin1, xmax1, ymax1;
593
592
    int             xmin2, ymin2, xmax2, ymax2;
597
596
    redisplay_regions(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2);
598
597
}
599
598
 
600
 
redisplay_arc(a)
601
 
    F_arc          *a;
 
599
void redisplay_arc(F_arc *a)
602
600
{
603
601
    int             xmin, ymin, xmax, ymax;
604
602
    int             cx, cy;
627
625
    redisplay_zoomed_region(xmin, ymin, xmax, ymax);
628
626
}
629
627
 
630
 
redisplay_arcs(a1, a2)
631
 
    F_arc          *a1, *a2;
 
628
void redisplay_arcs(F_arc *a1, F_arc *a2)
632
629
{
633
630
    int             xmin1, ymin1, xmax1, ymax1;
634
631
    int             xmin2, ymin2, xmax2, ymax2;
638
635
    redisplay_regions(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2);
639
636
}
640
637
 
641
 
redisplay_spline(s)
642
 
    F_spline       *s;
 
638
void redisplay_spline(F_spline *s)
643
639
{
644
640
    int             xmin, ymin, xmax, ymax;
645
641
 
647
643
    redisplay_zoomed_region(xmin, ymin, xmax, ymax);
648
644
}
649
645
 
650
 
redisplay_splines(s1, s2)
651
 
    F_spline       *s1, *s2;
 
646
void redisplay_splines(F_spline *s1, F_spline *s2)
652
647
{
653
648
    int             xmin1, ymin1, xmax1, ymax1;
654
649
    int             xmin2, ymin2, xmax2, ymax2;
658
653
    redisplay_regions(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2);
659
654
}
660
655
 
661
 
redisplay_line(l)
662
 
    F_line         *l;
 
656
void redisplay_line(F_line *l)
663
657
{
664
658
    int             xmin, ymin, xmax, ymax;
665
659
 
667
661
    redisplay_zoomed_region(xmin, ymin, xmax, ymax);
668
662
}
669
663
 
670
 
redisplay_lines(l1, l2)
671
 
    F_line         *l1, *l2;
 
664
void redisplay_lines(F_line *l1, F_line *l2)
672
665
{
673
666
    int             xmin1, ymin1, xmax1, ymax1;
674
667
    int             xmin2, ymin2, xmax2, ymax2;
678
671
    redisplay_regions(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2);
679
672
}
680
673
 
681
 
redisplay_compound(c)
682
 
    F_compound     *c;
 
674
void redisplay_compound(F_compound *c)
683
675
{
684
676
    redisplay_zoomed_region(c->nwcorner.x, c->nwcorner.y,
685
677
                            c->secorner.x, c->secorner.y);
686
678
}
687
679
 
688
 
redisplay_compounds(c1, c2)
689
 
    F_compound     *c1, *c2;
 
680
void redisplay_compounds(F_compound *c1, F_compound *c2)
690
681
{
691
682
    redisplay_regions(c1->nwcorner.x, c1->nwcorner.y,
692
683
                      c1->secorner.x, c1->secorner.y,
694
685
                      c2->secorner.x, c2->secorner.y);
695
686
}
696
687
 
697
 
redisplay_text(t)
698
 
    F_text         *t;
 
688
void redisplay_text(F_text *t)
699
689
{
700
690
    int             xmin, ymin, xmax, ymax;
701
691
    int             dum;
705
695
    redisplay_zoomed_region(xmin, ymin, xmax, ymax);
706
696
}
707
697
 
708
 
redisplay_texts(t1, t2)
709
 
    F_text         *t1, *t2;
 
698
void redisplay_texts(F_text *t1, F_text *t2)
710
699
{
711
700
    int             xmin1, ymin1, xmax1, ymax1;
712
701
    int             xmin2, ymin2, xmax2, ymax2;
720
709
                      xmin2, ymin2, xmax2, ymax2);
721
710
}
722
711
 
723
 
redisplay_regions(xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2)
724
 
    int             xmin1, ymin1, xmax1, ymax1, xmin2, ymin2, xmax2, ymax2;
 
712
void redisplay_regions(int xmin1, int ymin1, int xmax1, int ymax1, int xmin2, int ymin2, int xmax2, int ymax2)
725
713
{
726
714
    if (xmin1 == xmin2 && ymin1 == ymin2 && xmax1 == xmax2 && ymax1 == ymax2) {
727
715
        redisplay_zoomed_region(xmin1, ymin1, xmax1, ymax1);