The R Project SVN R

Rev

Rev 17323 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17323 Rev 17511
Line 15... Line 15...
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: rproxy_dev.c,v 1.4 2001/12/10 09:35:34 ripley Exp $
20
 *  $Id: rproxy_dev.c,v 1.5 2001/12/21 06:55:37 ripley Exp $
21
 */
21
 */
22
 
22
 
23
// virtual device size
23
// virtual device size
24
#define DEV_X 500
24
#define DEV_X 500
25
#define DEV_Y 500
25
#define DEV_Y 500
Line 79... Line 79...
79
		    int col, int fill, double gamma, int lty, double lwd,
79
		    int col, int fill, double gamma, int lty, double lwd,
80
		    NewDevDesc *dd);
80
		    NewDevDesc *dd);
81
static void R_Proxy_Graphics_Size(double *left, double *right,
81
static void R_Proxy_Graphics_Size(double *left, double *right,
82
		    double *bottom, double *top,
82
		    double *bottom, double *top,
83
		    NewDevDesc *dd);
83
		    NewDevDesc *dd);
-
 
84
#ifdef UNUSED
84
static void R_Proxy_Graphics_Resize(NewDevDesc *dd);
85
static void R_Proxy_Graphics_Resize(NewDevDesc *dd);
-
 
86
#endif
85
static double R_Proxy_Graphics_StrWidth(char *str, int font,
87
static double R_Proxy_Graphics_StrWidth(char *str, int font,
86
			  double cex, double ps, NewDevDesc *dd);
88
			  double cex, double ps, NewDevDesc *dd);
87
static void R_Proxy_Graphics_Text(double x, double y, char *str, 
89
static void R_Proxy_Graphics_Text(double x, double y, char *str, 
88
		    double rot, double hadj, 
90
		    double rot, double hadj, 
89
		    int col, double gamma, int font, double cex, double ps,
91
		    int col, double gamma, int font, double cex, double ps,
Line 107... Line 109...
107
				     double pLwd,
109
				     double pLwd,
108
				     NewDevDesc* pDD)
110
				     NewDevDesc* pDD)
109
{
111
{
110
  if (__graphics_device)
112
  if (__graphics_device)
111
    {
113
    {
112
      // convert coordinates here
-
 
113
      double lTmp = 0.0;
-
 
114
 
-
 
115
      __graphics_device->vtbl->circle (__graphics_device,
114
      __graphics_device->vtbl->circle (__graphics_device,
116
				       pX,
115
				       pX,
117
				       pY,
116
				       pY,
118
				       pRad,
117
				       pRad,
119
				       pFill,
118
				       pFill,
Line 260... Line 259...
260
    {
259
    {
261
      // convert coordinates here: don't use alloca() -> overflow?
260
      // convert coordinates here: don't use alloca() -> overflow?
262
      double* lX = (double*) malloc (pCount * sizeof (double));
261
      double* lX = (double*) malloc (pCount * sizeof (double));
263
      double* lY = (double*) malloc (pCount * sizeof (double));
262
      double* lY = (double*) malloc (pCount * sizeof (double));
264
      int i = 0;
263
      int i = 0;
265
      char x[1000];
-
 
266
 
264
 
267
      // could use memcpy() for speed
265
      // could use memcpy() for speed
268
      for (i = 0;i < pCount;i++)
266
      for (i = 0;i < pCount;i++)
269
	{
267
	{
270
	  lX[i] = pX[i];
268
	  lX[i] = pX[i];
Line 356... Line 354...
356
    *left = pDD->left;
354
    *left = pDD->left;
357
    *right = pDD->right;
355
    *right = pDD->right;
358
    *bottom = pDD->bottom;
356
    *bottom = pDD->bottom;
359
    *top = pDD->top;
357
    *top = pDD->top;
360
}
358
}
-
 
359
 
-
 
360
#ifdef UNUSED
361
static void R_Proxy_Graphics_Resize (NewDevDesc* pDD)
361
static void R_Proxy_Graphics_Resize (NewDevDesc* pDD)
362
{
362
{
363
  if (__graphics_device)
363
  if (__graphics_device)
364
    {
364
    {
365
      __graphics_device->vtbl->resize (__graphics_device);
365
      __graphics_device->vtbl->resize (__graphics_device);
366
      return;
366
      return;
367
    }
367
    }
368
 
368
 
369
  MessageBox (GetDesktopWindow (),"Resize()","R_Proxy_Graphics",MB_OK);
369
  MessageBox (GetDesktopWindow (),"Resize()","R_Proxy_Graphics",MB_OK);
370
}
370
}
-
 
371
#endif
-
 
372
 
371
// 00-06-22 | baier | added font and size parameters
373
// 00-06-22 | baier | added font and size parameters
372
static double R_Proxy_Graphics_StrWidth (char* pString,
374
static double R_Proxy_Graphics_StrWidth (char* pString,
373
					 int pFont,
375
					 int pFont,
374
					 double pCex,
376
					 double pCex,
375
					 double pPs,
377
					 double pPs,