Back to index

radiance  4R0+20100331
Defines | Functions | Variables
metacalls.c File Reference
#include "meta.h"
#include "plot.h"

Go to the source code of this file.

Defines

#define RIGHT   0
#define UP   1
#define LEFT   2
#define DOWN   3
#define pflush()   if (inpoly) closepoly()
#define putdec(v)   if (v) decival(v); else *cap++ = '0';

Functions

static int let_dir (register int c)
static void closepoly (void)
static void polyval (register int x, register int y)
static void decival (register int v)
void mendpage (void)
void mdone (void)
void minclude (char *fname)
void msetpat (int pn, char *pat)
void mopenseg (char *sname)
void mcloseseg (void)
void mline (int x, int y, int type, int thick, int color)
void mrectangle (int xmin, int ymin, int xmax, int ymax, int pat, int color)
void mtriangle (int xmin, int ymin, int xmax, int ymax, int d, int pat, int color)
void mpoly (int x, int y, int border, int pat, int color)
void mtext (int x, int y, char *s, int cpi, int color)
void mvstr (int xmin, int ymin, int xmax, int ymax, char *s, int d, int thick, int color)
void msegment (int xmin, int ymin, int xmax, int ymax, char *sname, int d, int thick, int color)
void mdraw (int x, int y)

Variables

static const char RCSid [] = "$Id: metacalls.c,v 1.5 2004/03/22 02:24:23 greg Exp $"
static int curx = 0
static int cury = 0
static int cura0 = 0
static int inpoly = FALSE
static char curargs [MAXARGS] = ""
static char * cap

Define Documentation

#define DOWN   3

Definition at line 17 of file metacalls.c.

#define LEFT   2

Definition at line 16 of file metacalls.c.

#define pflush ( )    if (inpoly) closepoly()

Definition at line 19 of file metacalls.c.

#define putdec (   v)    if (v) decival(v); else *cap++ = '0';

Definition at line 21 of file metacalls.c.

#define RIGHT   0

Definition at line 14 of file metacalls.c.

#define UP   1

Definition at line 15 of file metacalls.c.


Function Documentation

static void closepoly ( void  ) [static]

Definition at line 234 of file metacalls.c.

{
    *cap = '\0';
    pprim(PPFILL, cura0, 0, 0, XYSIZE-1, XYSIZE-1, curargs);
    inpoly = FALSE;
}

Here is the call graph for this function:

static void decival ( register int  v) [static]

Definition at line 209 of file metacalls.c.

{
    if (!v)
       return;
    decival(v/10);
    *cap++ = v%10 + '0';
}
static int let_dir ( register int  c) [static]

Definition at line 243 of file metacalls.c.

{
    switch (c) {
    case 'R':
    case 'r':
       return(RIGHT);
    case 'U':
    case 'u':
       return(UP);
    case 'L':
    case 'l':
       return(LEFT);
    case 'D':
    case 'd':
       return(DOWN);
    }
    return(0);
}

Here is the caller graph for this function:

void mcloseseg ( void  )

Definition at line 83 of file metacalls.c.

{
    pflush();
    pglob(PCLOSE, 0200, NULL);
}

Here is the call graph for this function:

void mdone ( void  )

Definition at line 46 of file metacalls.c.

{
    pflush();
    pglob(PEOF, 0200, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mdraw ( int  x,
int  y 
)

Definition at line 194 of file metacalls.c.

{
    if (inpoly) {
       polyval(x, y);
    } else if (x != curx || y != cury) {
       plseg(cura0, curx, cury, x, y);
       curx = x;
       cury = y;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mendpage ( void  )

Definition at line 39 of file metacalls.c.

{
    pflush();
    pglob(PEOP, 0200, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void minclude ( char *  fname)

Definition at line 53 of file metacalls.c.

{
    pflush();
    pglob(PINCL, 1, fname);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mline ( int  x,
int  y,
int  type,
int  thick,
int  color 
)

Definition at line 91 of file metacalls.c.

{
    pflush();
    cura0 = (type<<4 & 060) | (thick<<2 & 014) | (color & 03);
    curx = x;
    cury = y;
}

Here is the caller graph for this function:

void mopenseg ( char *  sname)

Definition at line 73 of file metacalls.c.

{
    pflush();
    pglob(POPEN, 0, sname);
}

Here is the call graph for this function:

void mpoly ( int  x,
int  y,
int  border,
int  pat,
int  color 
)

Definition at line 128 of file metacalls.c.

{
    pflush();
    cura0 = (border<<6 & 0100) | (pat<<2 & 014) | (color & 03);
    cap = curargs;
    inpoly = TRUE;
    putdec(x);
    *cap++ = ' ';
    putdec(y);
}
void mrectangle ( int  xmin,
int  ymin,
int  xmax,
int  ymax,
int  pat,
int  color 
)

Definition at line 104 of file metacalls.c.

{
    pflush();
    cura0 = (pat<<2 & 014) | (color & 03);
    pprim(PRFILL, cura0, xmin, ymin, xmax, ymax, NULL);
}

Here is the call graph for this function:

void msegment ( int  xmin,
int  ymin,
int  xmax,
int  ymax,
char *  sname,
int  d,
int  thick,
int  color 
)

Definition at line 181 of file metacalls.c.

{
    pflush();
    cura0 = (let_dir(d)<<4 & 060) | (thick<<2 & 014) | (color & 03);
    pprim(PSEG, cura0, xmin, ymin, xmax, ymax, sname);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void msetpat ( int  pn,
char *  pat 
)

Definition at line 62 of file metacalls.c.

{
    pflush();
    pglob(PSET, pn+4, pat);
}

Here is the call graph for this function:

void mtext ( int  x,
int  y,
char *  s,
int  cpi,
int  color 
)

Definition at line 144 of file metacalls.c.

{
    pflush();
    cura0 = (color & 03);
    if (cpi < 10) {
       cura0 += 04;
       cpi *= 2;
    }
    if (cpi > 11)
       cura0 += 020;
    if (cpi > 14)
       cura0 += 020;
    if (cpi > 18)
       cura0 += 020;
    pprim(PMSTR, cura0, x, y, x, y, s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void mtriangle ( int  xmin,
int  ymin,
int  xmax,
int  ymax,
int  d,
int  pat,
int  color 
)

Definition at line 116 of file metacalls.c.

{
    pflush();
    cura0 = (let_dir(d)<<4 & 060) | (pat<<2 & 014) | (color & 03);
    pprim(PTFILL, cura0, xmin, ymin, xmax, ymax, NULL);
}

Here is the call graph for this function:

void mvstr ( int  xmin,
int  ymin,
int  xmax,
int  ymax,
char *  s,
int  d,
int  thick,
int  color 
)

Definition at line 168 of file metacalls.c.

{
    pflush();
    cura0 = (let_dir(d)<<4 & 060) | (thick<<2 & 014) | (color & 03);
    pprim(PVSTR, cura0, xmin, ymin, xmax, ymax, s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void polyval ( register int  x,
register int  y 
) [static]

Definition at line 221 of file metacalls.c.

{
    *cap++ = ' ';
    putdec(x);
    *cap++ = ' ';
    putdec(y);
}

Here is the caller graph for this function:


Variable Documentation

char* cap [static]

Definition at line 29 of file metacalls.c.

int cura0 = 0 [static]

Definition at line 26 of file metacalls.c.

char curargs[MAXARGS] = "" [static]

Definition at line 28 of file metacalls.c.

int curx = 0 [static]

Definition at line 24 of file metacalls.c.

int cury = 0 [static]

Definition at line 25 of file metacalls.c.

int inpoly = FALSE [static]

Definition at line 27 of file metacalls.c.

const char RCSid[] = "$Id: metacalls.c,v 1.5 2004/03/22 02:24:23 greg Exp $" [static]

Definition at line 2 of file metacalls.c.