Return to if.c CVS log | Up to [local] / OpenXM_contrib2 / asir2000 / plot |
version 1.7, 2001/10/09 01:36:27 | version 1.9, 2002/07/10 05:29:35 | ||
---|---|---|---|
|
|
||
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, | * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, | ||
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. | * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. | ||
* | * | ||
* $OpenXM: OpenXM_contrib2/asir2000/plot/if.c,v 1.6 2001/08/22 09:19:21 noro Exp $ | * $OpenXM: OpenXM_contrib2/asir2000/plot/if.c,v 1.8 2001/12/25 02:39:07 noro Exp $ | ||
*/ | */ | ||
#include "ca.h" | #include "ca.h" | ||
#include "parse.h" | #include "parse.h" | ||
#include "ox.h" | #include "ox.h" | ||
#include "ifplot.h" | #include "ifplot.h" | ||
extern jmp_buf ox_env; | extern JMP_BUF ox_env; | ||
int open_canvas(NODE arg) | int open_canvas(NODE arg) | ||
{ | { | ||
|
|
||
return 0; | return 0; | ||
} | } | ||
int draw_string(NODE arg) | |||
{ | |||
int index,x,y; | |||
char *str; | |||
NODE pos; | |||
struct canvas *can; | |||
int color; | |||
index = QTOS((Q)ARG0(arg)); | |||
can = canvas[index]; | |||
if ( !can || !can->window ) { | |||
set_lasterror("draw_string : canvas does not exist"); | |||
return -1; | |||
} | |||
pos = BDY((LIST)ARG1(arg)); | |||
str = BDY((STRING)ARG2(arg)); | |||
if ( argc(arg) == 4 ) | |||
color = QTOS((Q)ARG3(arg)); | |||
else | |||
color = 0; /* black */ | |||
x = (int)ToReal((Q)ARG0(pos)); | |||
y = (int)ToReal((Q)ARG1(pos)); | |||
draw_character_string(display,can,x,y,str,color); | |||
return 0; | |||
} | |||
int clear_canvas(NODE arg) | int clear_canvas(NODE arg) | ||
{ | { | ||
int index; | int index; | ||
|
|
||
width = can->width; height = can->height; | width = can->width; height = can->height; | ||
tabe = (char **)ALLOCA(width*sizeof(char *)+width*height*sizeof(char)); | tabe = (char **)ALLOCA(width*sizeof(char *)+width*height*sizeof(char)); | ||
bzero(tabe,width*sizeof(char *)+width*height*sizeof(char)); | bzero((void *)tabe,width*sizeof(char *)+width*height*sizeof(char)); | ||
for ( i = 0, tabeb = (char *)(tabe+width); i < width; i++ ) | for ( i = 0, tabeb = (char *)(tabe+width); i < width; i++ ) | ||
tabe[i] = tabeb + height*i; | tabe[i] = tabeb + height*i; | ||
define_cursor(can->window,runningcur); | define_cursor(can->window,runningcur); |