The R Project SVN R

Rev

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

Rev 19500 Rev 22913
Line 1... Line 1...
1
#ifndef R_X11_MODULE_H
1
#ifndef R_X11_MODULE_H
2
#define R_X11_MODULE_H
2
#define R_X11_MODULE_H
3
 
3
 
4
#include <R_ext/Boolean.h>
4
#include <Rinternals.h>
5
 
-
 
6
/*
-
 
7
 We have problems here in that the X11 and relevant R header files 
-
 
8
 may not have been included at this point.
-
 
9
 So to give the full and complete declarations so that they are visible
-
 
10
 to the X11.c file in src/unix and the module in src/modules/X11/devX11.c
-
 
11
 requires that we have these header files.
-
 
12
 
-
 
13
 We can chose to provide only partial declarations and avoid referring
-
 
14
 to data types that are not yet defined here.  For example, we could have
-
 
15
 
-
 
16
  typedef  Rboolean (*R_X11DeviceDriverRoutine)();
-
 
17
  typedef  SEXP     (*R_X11DataEntryRoutine)();
-
 
18
  typedef  Rboolean (*R_GetX11ImageRoutine)();
-
 
19
 
-
 
20
 However, then we risk having mismatched routines in the two locations
-
 
21
 We can even have minimal type information by defining the routine
-
 
22
 pointers simply as DL_FUNC (taken from R_ext/Rdynload.h)
-
 
23
 
-
 
24
 For the moment, we use the full declarations and assume the X11.h and Xlib.h
-
 
25
 files are available. Perhaps this should also be contained within a
-
 
26
 conditional block determined by whether HAVE_X11 is defined. Is RX11.h
-
 
27
 used when X11 is not available?
-
 
28
 
-
 
29
 */
-
 
30
#if 1
-
 
31
 
-
 
32
  /* Header files needed for the different types in these prototypes.
-
 
33
     We skip X_COLORTYPE and make it an int. That is defined in
-
 
34
     src/modules/X11/devX11.h
-
 
35
   */
-
 
36
#include <X11/X.h>
-
 
37
#include <X11/Xlib.h> /* XImage */
-
 
38
#include "Graphics.h"
-
 
39
 
-
 
40
typedef Rboolean (*R_X11DeviceDriverRoutine)(DevDesc *dd,
-
 
41
					     char *disp_name,
-
 
42
					     double width,
-
 
43
					     double height,
-
 
44
					     double pointsize,
-
 
45
					     double gamma_fac,
-
 
46
					     int colormodel, /* really enum of X_COLORTYPE */
-
 
47
					     int maxcube, 
-
 
48
					     int canvascolor);
-
 
49
 
5
 
-
 
6
typedef SEXP (*R_do_X11)(SEXP call, SEXP op, SEXP args, SEXP rho);
50
typedef SEXP (*R_X11DataEntryRoutine)(SEXP call, SEXP op, SEXP args, SEXP rho);
7
typedef SEXP (*R_X11DataEntryRoutine)(SEXP call, SEXP op, SEXP args, SEXP rho);
51
typedef Rboolean (*R_GetX11ImageRoutine)(int d, XImage **pximage, int *pwidth, int *pheight);
8
typedef Rboolean (*R_GetX11ImageRoutine)(int d, void *pximage, 
52
#else
-
 
53
 
-
 
54
#include <R_ext/Rdynload.h>
-
 
55
 
-
 
56
typedef DL_FUNC R_X11DeviceDriverRoutine;
-
 
57
typedef DL_FUNC R_X11DataEntryRoutine;
-
 
58
typedef DL_FUNC R_GetX11ImageRoutine;
9
					 int *pwidth, int *pheight);
59
 
-
 
60
#endif
-
 
61
 
-
 
62
 
10
 
-
 
11
typedef struct {
-
 
12
    R_do_X11 X11;
-
 
13
    R_X11DataEntryRoutine de;
-
 
14
    R_GetX11ImageRoutine  image;
-
 
15
} R_X11Routines;
63
 
16
 
64
void R_setX11Routines(R_X11DeviceDriverRoutine dev, R_X11DataEntryRoutine dataEntry, R_GetX11ImageRoutine image);
17
R_X11Routines *R_setX11Routines(R_X11Routines *routines);
65
 
18
 
66
 
19
 
67
#endif /* R_X11_MODULE_H */
20
#endif /* R_X11_MODULE_H */