source: tags/initial/fig2dev/dev/genbox.c

Last change on this file was 2, checked in by oldcode, 24 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1/*
2 * TransFig: Facility for Translating Fig code
3 * Copyright (c) 1985 Supoj Sutantavibul
4 * Copyright (c) 1991 Micah Beck
5 *
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation. The authors make no representations about the suitability
11 * of this software for any purpose.  It is provided "as is" without express
12 * or implied warranty.
13 *
14 * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 * PERFORMANCE OF THIS SOFTWARE.
21 *
22 */
23
24/*
25 *      genbox : Empty box driver for fig2dev translator
26 *
27*/
28#include <stdio.h>
29#include "object.h"
30#include "fig2dev.h"
31
32void genbox_option(opt, optarg)
33char opt, *optarg;
34{
35        switch (opt) {
36
37        case 's':
38        case 'f':
39        case 'm':
40        case 'L':
41                break;
42
43        default:
44                put_msg(Err_badarg, opt, "box");
45                exit(1);
46        }
47}
48
49void genbox_start(objects)
50F_compound      *objects;
51{
52        double ppi;
53
54        if (0 == (ppi = (double)objects->nwcorner.x)) {
55            fprintf(stderr, "Resolution is zero!! default to 80 ppi\n");
56            ppi = 80.0;
57            }
58
59        /* draw box */
60        fprintf(tfp, "\\makebox[%.3fin]{\\rule{0in}{%.3fin}}\n",
61                (urx-llx)*mag/ppi, (ury-lly)*mag/ppi);
62        }
63
64struct driver dev_box = {
65        genbox_option,
66        genbox_start,
67        gendev_null,
68        gendev_null,
69        gendev_null,
70        gendev_null,
71        gendev_null,
72        gendev_null,
73        INCLUDE_TEXT
74};
Note: See TracBrowser for help on using the repository browser.