The R Project SVN R

Rev

Rev 17323 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17323 Rev 26207
Line 1... Line 1...
1
/*
1
/*
2
 *  StatConn: Connector interface between application and interpreter language
2
 *  StatConn: Connector interface between application and interpreter language
3
 *  Copyright (C) 1999--2001 Thomas Baier
3
 *  Copyright (C) 1999--2001 Thomas Baier
4
 * 
4
 *
5
 *  This library is free software; you can redistribute it and/or
5
 *  This library is free software; you can redistribute it and/or
6
 *  modify it under the terms of the GNU Library General Public
6
 *  modify it under the terms of the GNU Library General Public
7
 *  License as published by the Free Software Foundation; either
7
 *  License as published by the Free Software Foundation; either
8
 *  version 2 of the License, or (at your option) any later version.
8
 *  version 2 of the License, or (at your option) any later version.
9
 * 
9
 *
10
 *  This library is distributed in the hope that it will be useful,
10
 *  This library is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 *  Library General Public License for more details.
13
 *  Library General Public License for more details.
14
 * 
14
 *
15
 *  You should have received a copy of the GNU Library General Public
15
 *  You should have received a copy of the GNU Library General Public
16
 *  License along with this library; if not, write to the Free
16
 *  License along with this library; if not, write to the Free
17
 *  Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
17
 *  Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18
 *  MA 02111-1307, USA
18
 *  MA 02111-1307, USA
19
 *
19
 *
20
 *  $Id: SC_proxy.h,v 1.5 2001/12/10 09:35:34 ripley Exp $
20
 *  $Id: SC_proxy.h,v 1.6 2003/09/13 15:14:09 murdoch Exp $
21
 */
21
 */
22
 
22
 
23
#ifndef _STATCONN_H_
23
#ifndef _STATCONN_H_
24
#define _STATCONN_H_
24
#define _STATCONN_H_
25
 
25
 
26
#include "bdx.h"
26
#include "bdx.h"
27
 
27
 
28
// system-specifics should be moved to some include file
28
/* system-specifics should be moved to some include file */
29
#include <windows.h>
29
#include <windows.h>
30
#define SYSCALL WINAPI
30
#define SYSCALL WINAPI
31
#define EXPORT
31
#define EXPORT
32
 
32
 
33
// forward definition
33
/* forward definition */
34
struct _SC_Proxy_Object;
34
struct _SC_Proxy_Object;
35
struct _SC_CharacterDevice;
35
struct _SC_CharacterDevice;
36
struct _SC_GraphicsDevice;
36
struct _SC_GraphicsDevice;
37
 
37
 
38
// error codes
38
/* error codes */
39
 
39
 
40
// generic error and success codes
40
/* generic error and success codes */
41
#define SC_PROXY_OK                            0x00000000
41
#define SC_PROXY_OK                            0x00000000
42
#define SC_PROXY_ERR_UNKNOWN                   0x80000000
42
#define SC_PROXY_ERR_UNKNOWN                   0x80000000
43
 
43
 
44
#define SC_PROXY_ERR_INVALIDARG                0x80000001
44
#define SC_PROXY_ERR_INVALIDARG                0x80000001
45
#define SC_PROXY_ERR_INVALIDFORMAT             0x80000002
45
#define SC_PROXY_ERR_INVALIDFORMAT             0x80000002
46
#define SC_PROXY_ERR_NOTIMPL                   0x80000003
46
#define SC_PROXY_ERR_NOTIMPL                   0x80000003
47
 
47
 
48
// initialization and termination
48
/* initialization and termination */
49
#define SC_PROXY_ERR_INITIALIZED               0x80000004
49
#define SC_PROXY_ERR_INITIALIZED               0x80000004
50
#define SC_PROXY_ERR_NOTINITIALIZED            0x80000005
50
#define SC_PROXY_ERR_NOTINITIALIZED            0x80000005
51
 
51
 
52
// evaluation, getting and setting symbols
52
/* evaluation, getting and setting symbols */
53
#define SC_PROXY_ERR_INVALIDSYMBOL             0x80000006
53
#define SC_PROXY_ERR_INVALIDSYMBOL             0x80000006
54
#define SC_PROXY_ERR_PARSE_INVALID             0x80000007
54
#define SC_PROXY_ERR_PARSE_INVALID             0x80000007
55
#define SC_PROXY_ERR_PARSE_INCOMPLETE          0x80000008
55
#define SC_PROXY_ERR_PARSE_INCOMPLETE          0x80000008
56
#define SC_PROXY_ERR_UNSUPPORTEDTYPE           0x80000009
56
#define SC_PROXY_ERR_UNSUPPORTEDTYPE           0x80000009
57
#define SC_PROXY_ERR_EVALUATE_STOP             0x8000000a
57
#define SC_PROXY_ERR_EVALUATE_STOP             0x8000000a
58
 
58
 
59
// version mismatch
59
/* version mismatch */
60
#define SC_PROXY_ERR_INVALIDINTERFACEVERSION   0x80000010
60
#define SC_PROXY_ERR_INVALIDINTERFACEVERSION   0x80000010
61
#define SC_PROXY_ERR_INVALIDINTERPRETERVERSION 0x80000011
61
#define SC_PROXY_ERR_INVALIDINTERPRETERVERSION 0x80000011
62
 
62
 
63
// type mask values
63
/* type mask values */
64
#define SC_TM_SCALAR_BOOL   (BDX_BOOL)
64
#define SC_TM_SCALAR_BOOL   (BDX_BOOL)
65
#define SC_TM_SCALAR_INT    (BDX_INT)
65
#define SC_TM_SCALAR_INT    (BDX_INT)
66
#define SC_TM_SCALAR_DOUBLE (BDX_DOUBLE)
66
#define SC_TM_SCALAR_DOUBLE (BDX_DOUBLE)
67
#define SC_TM_SCALAR_STRING (BDX_STRING)
67
#define SC_TM_SCALAR_STRING (BDX_STRING)
68
#define SC_TM_SCALAR_ALL    (SC_TM_SCALAR_BOOL     \
68
#define SC_TM_SCALAR_ALL    (SC_TM_SCALAR_BOOL     \
Line 86... Line 86...
86
#define SC_TM_VECTOR_ALL    (SC_TM_VECTOR_BOOL     \
86
#define SC_TM_VECTOR_ALL    (SC_TM_VECTOR_BOOL     \
87
                             | SC_TM_VECTOR_INT    \
87
                             | SC_TM_VECTOR_INT    \
88
                             | SC_TM_VECTOR_DOUBLE \
88
                             | SC_TM_VECTOR_DOUBLE \
89
                             | SC_TM_VECTOR_STRING)
89
                             | SC_TM_VECTOR_STRING)
90
 
90
 
91
// information main keys
91
/* information main keys */
92
#define SC_INFO_MAIN_CONNECTOR     1
92
#define SC_INFO_MAIN_CONNECTOR     1
93
#define SC_INFO_MAIN_INTERPRETER   2
93
#define SC_INFO_MAIN_INTERPRETER   2
94
 
94
 
95
// information sub keys
95
/* information sub keys */
96
#define SC_INFO_SUB_NAME                  1
96
#define SC_INFO_SUB_NAME                  1
97
#define SC_INFO_SUB_DESCRIPTION           2
97
#define SC_INFO_SUB_DESCRIPTION           2
98
#define SC_INFO_SUB_COPYRIGHT             3
98
#define SC_INFO_SUB_COPYRIGHT             3
99
#define SC_INFO_SUB_LICENSE               4
99
#define SC_INFO_SUB_LICENSE               4
100
#define SC_INFO_SUB_MINORVERSION          5
100
#define SC_INFO_SUB_MINORVERSION          5
101
#define SC_INFO_SUB_MAJORVERSION          6
101
#define SC_INFO_SUB_MAJORVERSION          6
102
 
102
 
103
// function type-defs
103
/* function type-defs */
104
typedef int (SYSCALL *SC_PROXY_GET_VERSION) (struct _SC_Proxy_Object* object,
104
typedef int (SYSCALL *SC_PROXY_GET_VERSION) (struct _SC_Proxy_Object* object,
105
					     unsigned long* version);
105
					     unsigned long* version);
106
typedef int (SYSCALL *SC_PROXY_INIT) (struct _SC_Proxy_Object* object,
106
typedef int (SYSCALL *SC_PROXY_INIT) (struct _SC_Proxy_Object* object,
107
				      char const* parameters);
107
				      char const* parameters);
108
typedef int (SYSCALL *SC_PROXY_TERMINATE) (struct _SC_Proxy_Object* object);
108
typedef int (SYSCALL *SC_PROXY_TERMINATE) (struct _SC_Proxy_Object* object);
Line 139... Line 139...
139
(
139
(
140
  struct _SC_Proxy_Object* object,
140
  struct _SC_Proxy_Object* object,
141
  struct _SC_GraphicsDevice* device
141
  struct _SC_GraphicsDevice* device
142
);
142
);
143
 
143
 
144
// character device function typedefs
144
/* character device function typedefs */
145
typedef int (SYSCALL *SC_CHARACTERDEVICE_GET_VERSION)
145
typedef int (SYSCALL *SC_CHARACTERDEVICE_GET_VERSION)
146
(
146
(
147
  struct _SC_CharacterDevice* object,
147
  struct _SC_CharacterDevice* object,
148
  unsigned long* version
148
  unsigned long* version
149
);
149
);
Line 169... Line 169...
169
  struct _SC_CharacterDevice* object,
169
  struct _SC_CharacterDevice* object,
170
  char const* string,
170
  char const* string,
171
  unsigned long level
171
  unsigned long level
172
);
172
);
173
 
173
 
174
// graphics device function typedefs
174
/* graphics device function typedefs */
175
typedef int (SYSCALL *SC_GRAPHICSDEVICE_GET_VERSION)
175
typedef int (SYSCALL *SC_GRAPHICSDEVICE_GET_VERSION)
176
(
176
(
177
  struct _SC_GraphicsDevice* object,
177
  struct _SC_GraphicsDevice* object,
178
  unsigned long* version
178
  unsigned long* version
179
);
179
);
Line 186... Line 186...
186
typedef int (SYSCALL *SC_GRAPHICSDEVICE_RELEASE)
186
typedef int (SYSCALL *SC_GRAPHICSDEVICE_RELEASE)
187
(
187
(
188
  struct _SC_GraphicsDevice* object
188
  struct _SC_GraphicsDevice* object
189
);
189
);
190
 
190
 
191
// really no data, should not be required
191
/* really no data, should not be required */
192
typedef int (SYSCALL *SC_GRAPHICSDEVICE_OPEN)
192
typedef int (SYSCALL *SC_GRAPHICSDEVICE_OPEN)
193
(
193
(
194
  struct _SC_GraphicsDevice* object,
194
  struct _SC_GraphicsDevice* object,
195
  char const* display,
195
  char const* display,
196
  double w,
196
  double w,
Line 198... Line 198...
198
  double gamma,
198
  double gamma,
199
  int colormodel,
199
  int colormodel,
200
  int maxcupe
200
  int maxcupe
201
);
201
);
202
 
202
 
203
// should not be required
203
/* should not be required */
204
typedef void (SYSCALL *SC_GRAPHICSDEVICE_CLOSE)
204
typedef void (SYSCALL *SC_GRAPHICSDEVICE_CLOSE)
205
(
205
(
206
  struct _SC_GraphicsDevice* object
206
  struct _SC_GraphicsDevice* object
207
);
207
);
208
 
208
 
Line 214... Line 214...
214
typedef void (SYSCALL *SC_GRAPHICSDEVICE_DEACTIVATE)
214
typedef void (SYSCALL *SC_GRAPHICSDEVICE_DEACTIVATE)
215
(
215
(
216
  struct _SC_GraphicsDevice* object
216
  struct _SC_GraphicsDevice* object
217
);
217
);
218
 
218
 
219
// 00-06-22 | baier | added color, line type and width
219
/* 00-06-22 | baier | added color, line type and width */
220
typedef void (SYSCALL *SC_GRAPHICSDEVICE_LINE)
220
typedef void (SYSCALL *SC_GRAPHICSDEVICE_LINE)
221
(
221
(
222
  struct _SC_GraphicsDevice* object,
222
  struct _SC_GraphicsDevice* object,
223
  double x1,
223
  double x1,
224
  double y1,
224
  double y1,
Line 227... Line 227...
227
  int color,
227
  int color,
228
  int line_type,
228
  int line_type,
229
  double line_width
229
  double line_width
230
);
230
);
231
 
231
 
232
// 00-06-22 | baier | added line type and width
232
/* 00-06-22 | baier | added line type and width */
233
typedef void (SYSCALL *SC_GRAPHICSDEVICE_CIRCLE)
233
typedef void (SYSCALL *SC_GRAPHICSDEVICE_CIRCLE)
234
(
234
(
235
  struct _SC_GraphicsDevice* object,
235
  struct _SC_GraphicsDevice* object,
236
  double x,
236
  double x,
237
  double y,
237
  double y,
238
  double r,
238
  double r,
239
  int col,    // border color
239
  int col,    /* border color */
240
  int border, // fill color
240
  int border, /* fill color */
241
  int line_type,
241
  int line_type,
242
  double line_width
242
  double line_width
243
);
243
);
244
 
244
 
245
typedef void (SYSCALL *SC_GRAPHICSDEVICE_POLYGON)
245
typedef void (SYSCALL *SC_GRAPHICSDEVICE_POLYGON)
246
(
246
(
247
  struct _SC_GraphicsDevice* object,
247
  struct _SC_GraphicsDevice* object,
248
  int n,
248
  int n,
249
  double* x,
249
  double* x,
250
  double* y,
250
  double* y,
251
  int bg,     // border color
251
  int bg,     /* border color */
252
  int fg      // fill color
252
  int fg      /* fill color */
253
);
253
);
254
 
254
 
255
// 01-01-23 | baier | added "col" parameter
255
/* 01-01-23 | baier | added "col" parameter */
256
typedef void (SYSCALL *SC_GRAPHICSDEVICE_POLYLINE)
256
typedef void (SYSCALL *SC_GRAPHICSDEVICE_POLYLINE)
257
(
257
(
258
  struct _SC_GraphicsDevice* object,
258
  struct _SC_GraphicsDevice* object,
259
  int n,
259
  int n,
260
  double* x,
260
  double* x,
261
  double* y,
261
  double* y,
262
  int col    // color
262
  int col    /* color */
263
);
263
);
264
 
264
 
265
// 00-06-22 | baier | added line type and width
265
/* 00-06-22 | baier | added line type and width */
266
typedef void (SYSCALL *SC_GRAPHICSDEVICE_RECT)
266
typedef void (SYSCALL *SC_GRAPHICSDEVICE_RECT)
267
(
267
(
268
  struct _SC_GraphicsDevice* object,
268
  struct _SC_GraphicsDevice* object,
269
  double x0,
269
  double x0,
270
  double y0,
270
  double y0,
271
  double x1,
271
  double x1,
272
  double y1,
272
  double y1,
273
  int bg,     // border color
273
  int bg,     /* border color */
274
  int fg,     // fill color
274
  int fg,     /* fill color */
275
  int line_type,
275
  int line_type,
276
  double line_width
276
  double line_width
277
);
277
);
278
 
278
 
279
// 00-06-22 | baier | added color, font and size
279
/* 00-06-22 | baier | added color, font and size */
280
typedef void (SYSCALL *SC_GRAPHICSDEVICE_TEXT)
280
typedef void (SYSCALL *SC_GRAPHICSDEVICE_TEXT)
281
(
281
(
282
  struct _SC_GraphicsDevice* object,
282
  struct _SC_GraphicsDevice* object,
283
  double x,
283
  double x,
284
  double y,
284
  double y,
285
  char const* string,
285
  char const* string,
286
  double rot,          // rotation in degrees
286
  double rot,          /* rotation in degrees */
287
  double hadj,         // horizontal adjustment
287
  double hadj,         /* horizontal adjustment */
288
  int color,
288
  int color,
289
  int font,            // 0-31, one of the predefined fonts
289
  int font,            /* 0-31, one of the predefined fonts */
290
  int size             // 8-64, point size
290
  int size             /* 8-64, point size */
291
);
291
);
292
 
292
 
293
typedef void (SYSCALL *SC_GRAPHICSDEVICE_CLIP)
293
typedef void (SYSCALL *SC_GRAPHICSDEVICE_CLIP)
294
(
294
(
295
  struct _SC_GraphicsDevice* object,
295
  struct _SC_GraphicsDevice* object,
Line 297... Line 297...
297
  double x1,
297
  double x1,
298
  double y0,
298
  double y0,
299
  double y1
299
  double y1
300
);
300
);
301
 
301
 
302
// to be removed. refresh of width and heigth should be done on "newpage"
302
/* to be removed. refresh of width and heigth should be done on "newpage" */
303
typedef void (SYSCALL *SC_GRAPHICSDEVICE_RESIZE)
303
typedef void (SYSCALL *SC_GRAPHICSDEVICE_RESIZE)
304
(
304
(
305
  struct _SC_GraphicsDevice* object
305
  struct _SC_GraphicsDevice* object
306
);
306
);
307
 
307
 
308
// to be removed
308
/* to be removed */
309
typedef void (SYSCALL *SC_GRAPHICSDEVICE_HOLD)
309
typedef void (SYSCALL *SC_GRAPHICSDEVICE_HOLD)
310
(
310
(
311
  struct _SC_GraphicsDevice* object
311
  struct _SC_GraphicsDevice* object
312
);
312
);
313
 
313
 
314
// should clear display AND refresh coordinates
314
/* should clear display AND refresh coordinates */
315
typedef void (SYSCALL *SC_GRAPHICSDEVICE_NEWPAGE)
315
typedef void (SYSCALL *SC_GRAPHICSDEVICE_NEWPAGE)
316
(
316
(
317
  struct _SC_GraphicsDevice* object
317
  struct _SC_GraphicsDevice* object
318
);
318
);
319
 
319
 
Line 325... Line 325...
325
);
325
);
326
 
326
 
327
typedef void (SYSCALL *SC_GRAPHICSDEVICE_MODE)
327
typedef void (SYSCALL *SC_GRAPHICSDEVICE_MODE)
328
(
328
(
329
  struct _SC_GraphicsDevice* object,
329
  struct _SC_GraphicsDevice* object,
330
  int mode   // 1 when starting drawing, 0 when stopping
330
  int mode   /* 1 when starting drawing, 0 when stopping */
331
);
331
);
332
 
332
 
333
// 00-06-22 | baier | added font and size parameters
333
/* 00-06-22 | baier | added font and size parameters */
334
typedef double (SYSCALL *SC_GRAPHICSDEVICE_STRWIDTH)
334
typedef double (SYSCALL *SC_GRAPHICSDEVICE_STRWIDTH)
335
(
335
(
336
  struct _SC_GraphicsDevice* object,
336
  struct _SC_GraphicsDevice* object,
337
  char const* string,
337
  char const* string,
338
  int font,            // 0-31, one of the predefined fonts
338
  int font,            /* 0-31, one of the predefined fonts */
339
  int size             // 8-64, point size
339
  int size             /* 8-64, point size */
340
);
340
);
341
 
341
 
342
// 00-06-22 | baier | added font and size parameters
342
/* 00-06-22 | baier | added font and size parameters */
343
typedef void (SYSCALL *SC_GRAPHICSDEVICE_METRICINFO)
343
typedef void (SYSCALL *SC_GRAPHICSDEVICE_METRICINFO)
344
(
344
(
345
  struct _SC_GraphicsDevice* object,
345
  struct _SC_GraphicsDevice* object,
346
  int character,
346
  int character,
347
  double* ascent,
347
  double* ascent,
348
  double* descent,
348
  double* descent,
349
  double* width,
349
  double* width,
350
  int font,            // 0-31, one of the predefined fonts
350
  int font,            /* 0-31, one of the predefined fonts */
351
  int size             // 8-64, point size
351
  int size             /* 8-64, point size */
352
);
352
);
353
 
353
 
354
 
354
 
355
/*
355
/*
356
 * interface version information:
356
 * interface version information:
Line 375... Line 375...
375
 *
375
 *
376
 * 1 ... first version
376
 * 1 ... first version
377
 */
377
 */
378
#define SC_GRAPHICSDEVICE_VERSION 1
378
#define SC_GRAPHICSDEVICE_VERSION 1
379
 
379
 
380
// used for communication between the COM/CORBA server and R
380
/* used for communication between the COM/CORBA server and R */
381
typedef struct _SC_Proxy_Object_Vtbl
381
typedef struct _SC_Proxy_Object_Vtbl
382
{
382
{
383
  // get interpreter version
383
  /* get interpreter version */
384
  SC_PROXY_GET_VERSION get_version;
384
  SC_PROXY_GET_VERSION get_version;
385
 
385
 
386
  // initialize the interpreter
386
  /* initialize the interpreter */
387
  SC_PROXY_INIT init;
387
  SC_PROXY_INIT init;
388
  // terminate the interpreter
388
  /* terminate the interpreter */
389
  SC_PROXY_TERMINATE terminate;
389
  SC_PROXY_TERMINATE terminate;
390
 
390
 
391
  // increase the reference count to this interface object
391
  /* increase the reference count to this interface object */
392
  SC_PROXY_RETAIN retain;
392
  SC_PROXY_RETAIN retain;
393
  // decrease the reference count to this interface object, object will be
393
  /* decrease the reference count to this interface object, object will be */
394
  // freed when count reaches 0
394
  /* freed when count reaches 0 */
395
  SC_PROXY_RELEASE release;
395
  SC_PROXY_RELEASE release;
396
 
396
 
397
  // set a symbol in the interpreter's global namespace to the BDX data passed
397
  /* set a symbol in the interpreter's global namespace to the BDX data passed */
398
  SC_PROXY_SET_SYMBOL set_symbol;
398
  SC_PROXY_SET_SYMBOL set_symbol;
399
  // return a symbol's value from the interpreter's global namespace
399
  /* return a symbol's value from the interpreter's global namespace */
400
  SC_PROXY_GET_SYMBOL get_symbol;
400
  SC_PROXY_GET_SYMBOL get_symbol;
401
 
401
 
402
  // evaluate an expression, return result in a BDX data buffer (synchronously)
402
  /* evaluate an expression, return result in a BDX data buffer (synchronously) */
403
  SC_PROXY_EVALUATE evaluate;
403
  SC_PROXY_EVALUATE evaluate;
404
  // evaluate an expression, do not return a result (synchronously)
404
  /* evaluate an expression, do not return a result (synchronously) */
405
  SC_PROXY_EVALUATE_NORETURN evaluate_noreturn;
405
  SC_PROXY_EVALUATE_NORETURN evaluate_noreturn;
406
 
406
 
407
  // return information about BDX data types supported by this interface and
407
  /* return information about BDX data types supported by this interface and */
408
  // the interpreter
408
  /* the interpreter */
409
  SC_PROXY_QUERY_TYPES query_supported_types;
409
  SC_PROXY_QUERY_TYPES query_supported_types;
410
  // return information about available functionality in this interface and
410
  /* return information about available functionality in this interface and */
411
  // the interpreter
411
  /* the interpreter */
412
  SC_PROXY_QUERY_OPS query_supported_operations;
412
  SC_PROXY_QUERY_OPS query_supported_operations;
413
 
413
 
414
  // free a BDX data buffer allocated by one of this interface's functions
414
  /* free a BDX data buffer allocated by one of this interface's functions */
415
  SC_PROXY_FREE_DATA_BUFFER free_data_buffer;
415
  SC_PROXY_FREE_DATA_BUFFER free_data_buffer;
416
 
416
 
417
  // set output, error and tracing devices
417
  /* set output, error and tracing devices */
418
  SC_PROXY_SET_CHARACTERDEVICE set_output_device;
418
  SC_PROXY_SET_CHARACTERDEVICE set_output_device;
419
 
419
 
420
  // retrieve information about interface and interpreter
420
  /* retrieve information about interface and interpreter */
421
  SC_PROXY_QUERY_INFO query_info;
421
  SC_PROXY_QUERY_INFO query_info;
422
 
422
 
423
  // add and remove a graphics device
423
  /* add and remove a graphics device */
424
  SC_PROXY_SET_GRAPHICSDEVICE set_graphics_device;
424
  SC_PROXY_SET_GRAPHICSDEVICE set_graphics_device;
425
} SC_Proxy_Object_Vtbl;
425
} SC_Proxy_Object_Vtbl;
426
 
426
 
427
// character device used for output, (textual) error messages and traces
427
/* character device used for output, (textual) error messages and traces */
428
typedef struct _SC_CharacterDevice_Vtbl
428
typedef struct _SC_CharacterDevice_Vtbl
429
{
429
{
430
  // get character device version
430
  /* get character device version */
431
  SC_CHARACTERDEVICE_GET_VERSION get_version;
431
  SC_CHARACTERDEVICE_GET_VERSION get_version;
432
 
432
 
433
  // increase the reference count to this interface object
433
  /* increase the reference count to this interface object */
434
  SC_CHARACTERDEVICE_RETAIN retain;
434
  SC_CHARACTERDEVICE_RETAIN retain;
435
  // decrease the reference count to this interface object, object will be
435
  /* decrease the reference count to this interface object, object will be */
436
  // freed when count reaches 0
436
  /* freed when count reaches 0 */
437
  SC_CHARACTERDEVICE_RELEASE release;
437
  SC_CHARACTERDEVICE_RELEASE release;
438
 
438
 
439
  // write a string to the output device
439
  /* write a string to the output device */
440
  SC_CHARACTERDEVICE_WRITE_STRING write_string;
440
  SC_CHARACTERDEVICE_WRITE_STRING write_string;
441
 
441
 
442
  // write a string to the output device. the string is echoed if the passed
442
  /* write a string to the output device. the string is echoed if the passed */
443
  // level is less or equal to the current output level of the device (used
443
  /* level is less or equal to the current output level of the device (used */
444
  // for conditional output)
444
  /* for conditional output) */
445
  SC_CHARACTERDEVICE_WRITE_STRING_LEVEL write_string_level;
445
  SC_CHARACTERDEVICE_WRITE_STRING_LEVEL write_string_level;
446
} SC_CharacterDevice_Vtbl;
446
} SC_CharacterDevice_Vtbl;
447
 
447
 
448
// graphics device
448
/* graphics device */
449
typedef struct _SC_GraphicsDevice_Vtbl
449
typedef struct _SC_GraphicsDevice_Vtbl
450
{
450
{
451
  // get graphics device version
451
  /* get graphics device version */
452
  SC_GRAPHICSDEVICE_GET_VERSION get_version;
452
  SC_GRAPHICSDEVICE_GET_VERSION get_version;
453
 
453
 
454
  // increase the reference count to this interface object
454
  /* increase the reference count to this interface object */
455
  SC_GRAPHICSDEVICE_RETAIN retain;
455
  SC_GRAPHICSDEVICE_RETAIN retain;
456
  // decrease the reference count to this interface object, object will be
456
  /* decrease the reference count to this interface object, object will be */
457
  // freed when count reaches 0
457
  /* freed when count reaches 0 */
458
  SC_GRAPHICSDEVICE_RELEASE release;
458
  SC_GRAPHICSDEVICE_RELEASE release;
459
 
459
 
460
  // interface-specific functions following here!
460
  /* interface-specific functions following here! */
461
  SC_GRAPHICSDEVICE_OPEN open;
461
  SC_GRAPHICSDEVICE_OPEN open;
462
  SC_GRAPHICSDEVICE_CLOSE close;
462
  SC_GRAPHICSDEVICE_CLOSE close;
463
 
463
 
464
  SC_GRAPHICSDEVICE_ACTIVATE activate;
464
  SC_GRAPHICSDEVICE_ACTIVATE activate;
465
  SC_GRAPHICSDEVICE_DEACTIVATE deactivate;
465
  SC_GRAPHICSDEVICE_DEACTIVATE deactivate;
Line 481... Line 481...
481
  SC_GRAPHICSDEVICE_MODE mode;
481
  SC_GRAPHICSDEVICE_MODE mode;
482
  SC_GRAPHICSDEVICE_STRWIDTH strwidth;
482
  SC_GRAPHICSDEVICE_STRWIDTH strwidth;
483
  SC_GRAPHICSDEVICE_METRICINFO metricinfo;
483
  SC_GRAPHICSDEVICE_METRICINFO metricinfo;
484
} SC_GraphicsDevice_Vtbl;
484
} SC_GraphicsDevice_Vtbl;
485
 
485
 
486
// abstract data type (implementation adds data)
486
/* abstract data type (implementation adds data) */
487
typedef struct _SC_Proxy_Object
487
typedef struct _SC_Proxy_Object
488
{
488
{
489
  SC_Proxy_Object_Vtbl* vtbl;
489
  SC_Proxy_Object_Vtbl* vtbl;
490
} SC_Proxy_Object;
490
} SC_Proxy_Object;
491
 
491
 
Line 497... Line 497...
497
typedef struct _SC_GraphicsDevice
497
typedef struct _SC_GraphicsDevice
498
{
498
{
499
  SC_GraphicsDevice_Vtbl* vtbl;
499
  SC_GraphicsDevice_Vtbl* vtbl;
500
} SC_GraphicsDevice;
500
} SC_GraphicsDevice;
501
 
501
 
502
// entry point: retrieve a proxy object with a given version
502
/* entry point: retrieve a proxy object with a given version */
503
typedef int (SYSCALL* SC_PROXY_GET_OBJECT) (SC_Proxy_Object**,unsigned long);
503
typedef int (SYSCALL* SC_PROXY_GET_OBJECT) (SC_Proxy_Object**,unsigned long);
504
 
504
 
505
// this is valid for Windows only
505
/* this is valid for Windows only */
506
#define SC_PROXY_GET_OBJECT_FUN "SC_Proxy_get_object@8"
506
#define SC_PROXY_GET_OBJECT_FUN "SC_Proxy_get_object@8"
507
 
507
 
508
#endif
508
#endif