ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/driver.h
(Generate patch)

Comparing ray/src/rt/driver.h (file contents):
Revision 1.1 by greg, Thu Feb 2 10:41:13 1989 UTC vs.
Revision 2.2 by greg, Mon Apr 5 15:16:46 1993 UTC

# Line 15 | Line 15 | struct driver {                                /* driver functions */
15          int  (*getcur)();                       /* get cursor position */
16          int  (*comout)();                       /* command line output */
17          int  (*comin)();                        /* command line input */
18 +        int  (*flush)();                        /* flush output */
19 +        double  pixaspect;                      /* pixel aspect ratio */
20          int  xsiz, ysiz;                        /* device size */
21          int  inpready;                          /* input ready on device */
22   };
# Line 22 | Line 24 | struct driver {                                /* driver functions */
24   extern int  stderr_v();                 /* error vectors */
25   extern int  (*wrnvec)(), (*errvec)(), (*cmdvec)();
26  
27 < extern struct driver  *comm_init();     /* stream interface */
27 >                                        /* stream interface */
28 > extern struct driver  *comm_init(), *slave_init();
29 >                                        /* magic numbers for verification */
30 > #define COM_SENDM               0x6f37
31 > #define COM_RECVM               0x51da
32                                          /* stream commands */
33   #define COM_CLEAR               0
34   #define COM_PAINTR              1
35   #define COM_GETCUR              2
36   #define COM_COMOUT              3
37   #define COM_COMIN               4
38 < #define NREQUESTS               5       /* number of valid requests */
38 > #define COM_FLUSH               5
39 > #define NREQUESTS               6       /* number of valid requests */
40  
41 < struct device {                         /* interactive device */
41 > extern struct device {                  /* interactive device */
42          char  *name;                            /* device name */
43          char  *descrip;                         /* description */
44          struct driver  *(*init)();              /* initialize device */
45 < };
45 > }  devtable[];                          /* supported devices */
46  
47 < extern struct device  devtable[];       /* supported devices */
47 > extern char  dev_default[];             /* default device name */
48  
49   #define  MB1            ('\n')          /* mouse button 1 */
50   #define  MB2            ('\r')          /* mouse button 2 */
51   #define  MB3            (' ')           /* mouse button 3 */
52   #define  ABORT          ('C'-'@')       /* abort key */
53  
47 #define  MAXRES         4000            /* preposterous display resolution */
48
54   /*
55   *  struct driver *
56 < *  dname_init(name)
57 < *  char  *name;
56 > *  dname_init(name, id)
57 > *  char  *name, *id;
58   *  {
59   *      Initialize device and return pointer to driver
60   *      functions.  Returns NULL if an error occurred.
61 < *      The name string is used to identify the client.
61 > *      The name string identifies the driver,
62 > *      and the id string identifies the client.
63   *      A device can be open by at most one client.
64   *      Be verbose in error reports; call stderr_v().
65 < *      If device has its own error output, set errvec.
65 > *      If device has its own error output, set errvec,
66 > *      cmdvec and wrnvec.
67   *  }
68   *  (*dev->close)()
69   *  {
70 < *      Close the device.  Reset errvec to stderr_v.
70 > *      Close the device.  Reset error vectors.
71   *  }
72   *  (*dev->clear)(xres, yres)
73   *  int  xres, yres;
74   *  {
75 < *      Clear the device for xres by yres output.  This call must
75 > *      Clear the device for xres by yres output.  This call will
76   *      be made prior to any output.
77   *  }
78   *  (*dev->paintr)(col, xmin, ymin, xmax, ymax)
# Line 73 | Line 80 | extern struct device  devtable[];      /* supported devices
80   *  int  xmin, ymin, xmax, ymax;
81   *  {
82   *      Paint a half-open rectangle from (xmin,ymin) to (xmax,ymax)
83 < *      with the color col.  Can call repaint() if necessary.
83 > *      with the color col.
84   *  }
85   *  (*dev->getcur)(xp, yp)
86   *  int  *xp, *yp;
# Line 90 | Line 97 | extern struct device  devtable[];      /* supported devices
97   *      string ends with '\n', the message is considered complete,
98   *      and the next call can erase it.
99   *  }
100 < *  (*dev->comin)(in)
101 < *  char  *in;
100 > *  (*dev->comin)(in, prompt)
101 > *  char  *in, *prompt;
102   *  {
103 < *      Read an edited input string from the command line.  If
104 < *      an unrecognized control character is entered, terminate
105 < *      input and return the string with only that character.
106 < *      The input string should not contain a newline ('\n').
107 < *      Must work in consort with comout.
103 > *      Print a prompt then read an edited input command line
104 > *      assuming the in buffer is big enough.  Unless prompt is NULL,
105 > *      the driver may substitute its own rview command.  This is
106 > *      the most reliable way to repaint areas of the screen.
107 > *      If the user enters an unrecognized control character,
108 > *      terminate input and return the string with only that character.
109 > *      The input string should not contain a newline.  The routines in
110 > *      editline.c may be useful.  Comin must work in consort with comout.
111   *  }
112 + *  (*dev->flush)()
113 + *  {
114 + *      Flush output to the display.  This is guaranteed to be called
115 + *      frequently enough to keep the display up to date.
116 + *      This is an ideal time to check for device input.
117 + *      This function can be NULL for devices that don't need it.
118 + *  }
119   *  xsiz, ysiz
120   *      The maximum allowable x and y dimensions.  If any
121   *      size is allowable, these should be set to MAXRES.
122   *  inpready
123 < *      This variable should be positive
124 < *      when characters are ready on the input.
123 > *      This variable should be made positive asynchronously
124 > *      when characters are ready on the input.  (Often easiest
125 > *      to check for input during calls to paintr.)
126   */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines