version 1.5, 2002/07/14 03:57:24 |
version 1.8, 2002/08/03 23:59:14 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/lib/glib,v 1.4 2002/07/10 08:40:58 takayama Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/lib/glib,v 1.7 2002/07/15 02:14:48 takayama Exp $ */ |
/* $Id$ */ |
/* $Id$ */ |
|
|
|
|
|
|
*/ |
*/ |
|
|
/* ---------------------------------------------- */ |
/* ---------------------------------------------- */ |
def ox_get_errors(P) { |
def glib_ox_get_errors(P) { |
ox_push_cmd(P,276); |
ox_push_cmd(P,276); |
return(ox_pop_cmo(P)); |
return(ox_pop_cmo(P)); |
} |
} |
Line 58 def open_Canvas(P,S) { |
|
Line 58 def open_Canvas(P,S) { |
|
open_canvas(P,S); |
open_canvas(P,S); |
R = ox_pop_cmo(P); |
R = ox_pop_cmo(P); |
/* |
/* |
if (ox_get_errors(P) == []) { |
if (glib_ox_get_errors(P) == []) { |
R = ox_pop_cmo(P); |
R = ox_pop_cmo(P); |
}else{ |
}else{ |
debug; |
debug; |
Line 67 def open_Canvas(P,S) { |
|
Line 67 def open_Canvas(P,S) { |
|
return(R); |
return(R); |
} |
} |
|
|
|
/*&usage begin: glib_open() |
|
It starts the ox_plot server and opens a canvas. |
|
The canvas size is set to {Glib_canvas_x} X {Glib_canvas_y} |
|
(the default value is 400). |
|
This function is automatically called when the user calls glib |
|
functions. |
|
end: */ |
|
|
def glib_open() { |
def glib_open() { |
extern Glib_canvas_x, Glib_canvas_y, |
extern Glib_canvas_x, Glib_canvas_y, |
Glib_process, Glib_canvas; |
Glib_process, Glib_canvas; |
Line 98 def glib_check_strict() { |
|
Line 106 def glib_check_strict() { |
|
if (Glib_canvas < 0) { |
if (Glib_canvas < 0) { |
glib_open(); |
glib_open(); |
} |
} |
E = ox_get_errors(Glib_process); |
E = glib_ox_get_errors(Glib_process); |
if (E != []) { |
if (E != []) { |
ox_pops(Glib_process,200); |
ox_pops(Glib_process,200); |
print(E); |
print(E); |
Line 147 def glib_check_arg(X,Y) { |
|
Line 155 def glib_check_arg(X,Y) { |
|
} |
} |
} |
} |
|
|
/*&usage begin: glib_putpixel(X,Y | color) |
/*&usage begin: glib_putpixel(X,Y|color) |
It puts a pixel at [{X},{Y}] with {color} |
It puts a pixel at [{X},{Y}] with {color} |
example: glib_putpixel(1,2 | color=0xffff00); |
example: glib_putpixel(1,2 | color=0xffff00); |
end: */ |
end: */ |
Line 169 def glib_putpixel(X,Y) { |
|
Line 177 def glib_putpixel(X,Y) { |
|
} |
} |
} |
} |
|
|
/*&usage begin: glib_line(X0,Y0,X1,Y1 | color) |
/*&usage begin: glib_line(X0,Y0,X1,Y1|color) |
It draw the line [{X0},{Y0}]-- [{X1},{Y1}]with {color} |
It draws the line [{X0},{Y0}]-- [{X1},{Y1}] with {color} |
example: glib_line(0,0,5,3/2 | color=0xff00ff); |
example: glib_line(0,0,5,3/2 | color=0xff00ff); |
end: */ |
end: */ |
def glib_line(X0,Y0,X1,Y1) { |
def glib_line(X0,Y0,X1,Y1) { |
Line 281 def glib_clip1_y(X0,Y0,X1,Y1,Clip) { |
|
Line 289 def glib_clip1_y(X0,Y0,X1,Y1,Clip) { |
|
return([X0,Y0,X1,Y1]); |
return([X0,Y0,X1,Y1]); |
} |
} |
|
|
/*&usage begin:glib_print(X,Y,Text|color) |
/*&usage begin: glib_print(X,Y,Text|color) |
It put a string {Text} at [{X},{Y}] on the glib canvas. |
It put a string {Text} at [{X},{Y}] on the glib canvas. |
example: glib_print(100,100,"Hello Worlds" | color=0xff0000); |
example: glib_print(100,100,"Hello Worlds" | color=0xff0000); |
end: */ |
end: */ |
Line 317 def glib_history(L) { |
|
Line 325 def glib_history(L) { |
|
return 0; |
return 0; |
} |
} |
|
|
/*&usage begin:glib_tops() |
/*&usage begin: glib_tops() |
If Glib_ps is set to 1, |
If Glib_ps is set to 1, |
it returns a postscript program to draw the picture on the canvas. |
it returns a postscript program to draw the picture on the canvas. |
|
ref: print_output |
end: */ |
end: */ |
def glib_tops() { |
def glib_tops() { |
extern Glib_h; |
extern Glib_h; |