Alpha conversion: autoflush devient auto_flush.
Modification mineure de la doc. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2852 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
ca9d41866a
commit
9b33f24596
|
@ -21,7 +21,7 @@ value gr_plot(value vx, value vy)
|
|||
int y = Int_val(vy);
|
||||
gr_check_open();
|
||||
XDrawPoint(grdisplay, grbstore.win, grbstore.gc, x, Bcvt(y));
|
||||
if(grautoflush) {
|
||||
if(grauto_flush) {
|
||||
XDrawPoint(grdisplay, grwindow.win, grwindow.gc, x, Wcvt(y));
|
||||
XFlush(grdisplay);
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ value gr_lineto(value vx, value vy)
|
|||
gr_check_open();
|
||||
XDrawLine(grdisplay, grbstore.win, grbstore.gc,
|
||||
grx, Bcvt(gry), x, Bcvt(y));
|
||||
if(grautoflush) {
|
||||
if(grauto_flush) {
|
||||
XDrawLine(grdisplay, grwindow.win, grwindow.gc,
|
||||
grx, Wcvt(gry), x, Wcvt(y));
|
||||
XFlush(grdisplay);
|
||||
|
@ -73,7 +73,7 @@ value gr_draw_arc_nat(value vx, value vy, value vrx, value vry, value va1, value
|
|||
gr_check_open();
|
||||
XDrawArc(grdisplay, grbstore.win, grbstore.gc,
|
||||
x - rx, Bcvt(y) - ry, rx * 2, ry * 2, a1 * 64, (a2 - a1) * 64);
|
||||
if(grautoflush) {
|
||||
if(grauto_flush) {
|
||||
XDrawArc(grdisplay, grwindow.win, grwindow.gc,
|
||||
x - rx, Wcvt(y) - ry, rx * 2, ry * 2, a1 * 64, (a2 - a1) * 64);
|
||||
XFlush(grdisplay);
|
||||
|
|
|
@ -25,7 +25,7 @@ value gr_fill_rect(value vx, value vy, value vw, value vh)
|
|||
gr_check_open();
|
||||
XFillRectangle(grdisplay, grbstore.win, grbstore.gc,
|
||||
x, Bcvt(y) - h + 1, w, h);
|
||||
if(grautoflush) {
|
||||
if(grauto_flush) {
|
||||
XFillRectangle(grdisplay, grwindow.win, grwindow.gc,
|
||||
x, Wcvt(y) - h + 1, w, h);
|
||||
XFlush(grdisplay);
|
||||
|
@ -47,7 +47,7 @@ value gr_fill_poly(value array)
|
|||
}
|
||||
XFillPolygon(grdisplay, grbstore.win, grbstore.gc, points,
|
||||
npoints, Complex, CoordModeOrigin);
|
||||
if(grautoflush) {
|
||||
if(grauto_flush) {
|
||||
for (i = 0; i < npoints; i++)
|
||||
points[i].y = BtoW(points[i].y);
|
||||
XFillPolygon(grdisplay, grwindow.win, grwindow.gc, points,
|
||||
|
@ -70,7 +70,7 @@ value gr_fill_arc_nat(value vx, value vy, value vrx, value vry, value va1, value
|
|||
gr_check_open();
|
||||
XFillArc(grdisplay, grbstore.win, grbstore.gc,
|
||||
x - rx, Bcvt(y) - ry, rx * 2, ry * 2, a1 * 64, (a2 - a1) * 64);
|
||||
if(grautoflush) {
|
||||
if(grauto_flush) {
|
||||
XFillArc(grdisplay, grwindow.win, grwindow.gc,
|
||||
x - rx, Wcvt(y) - ry, rx * 2, ry * 2, a1 * 64, (a2 - a1) * 64);
|
||||
XFlush(grdisplay);
|
||||
|
|
|
@ -45,7 +45,7 @@ external size_y : unit -> int = "gr_size_y"
|
|||
|
||||
(* Double-buffering *)
|
||||
|
||||
external autoflush : bool -> unit = "gr_autoflush"
|
||||
external auto_flush : bool -> unit = "gr_auto_flush"
|
||||
external flush : unit -> unit = "gr_flush"
|
||||
|
||||
(* Colors *)
|
||||
|
|
|
@ -38,21 +38,21 @@ external size_y : unit -> int = "gr_size_y"
|
|||
Drawings outside of this rectangle are clipped, without causing
|
||||
an error. The origin (0,0) is at the lower left corner. *)
|
||||
|
||||
(*** Double-buffering *)
|
||||
(*** Double buffering *)
|
||||
|
||||
external autoflush : bool -> unit = "gr_autoflush"
|
||||
external auto_flush : bool -> unit = "gr_auto_flush"
|
||||
(* Set auto-flush mode on/off. When turned off, drawings are done
|
||||
in the backing store window but no more in the graphics window
|
||||
itself. This creates a simple effect of double-buffering, by
|
||||
itself. This creates a simple effect of double buffering, by
|
||||
allowing the user to do complex drawings in the backing store
|
||||
while keeping older drawings on the screen. The contents
|
||||
of the backing-store is copied onto the graphics window by
|
||||
of the backing store is copied onto the graphics window by
|
||||
a call to [flush] (see below). By default, auto-flush mode is
|
||||
on, and all drawings are done both in the backing-store and in
|
||||
on, and all drawings are done both in the backing store and in
|
||||
the graphics window. *)
|
||||
|
||||
external flush : unit -> unit = "gr_flush"
|
||||
(* Flush the contents of the backing-store onto the graphics
|
||||
(* Flush the contents of the backing store onto the graphics
|
||||
window. This function is automatically called each time
|
||||
auto-flush mode is enabled. *)
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ value gr_draw_image(value im, value vx, value vy)
|
|||
if (Mask_im(im) != None) {
|
||||
XSetClipOrigin(grdisplay, grbstore.gc, x, by);
|
||||
XSetClipMask(grdisplay, grbstore.gc, Mask_im(im));
|
||||
if(grautoflush) {
|
||||
if(grauto_flush) {
|
||||
XSetClipOrigin(grdisplay, grwindow.gc, x, wy);
|
||||
XSetClipMask(grdisplay, grwindow.gc, Mask_im(im));
|
||||
}
|
||||
|
@ -84,17 +84,17 @@ value gr_draw_image(value im, value vx, value vy)
|
|||
0, 0,
|
||||
Width_im(im), Height_im(im),
|
||||
x, by);
|
||||
if(grautoflush)
|
||||
if(grauto_flush)
|
||||
XCopyArea(grdisplay, Data_im(im), grwindow.win, grwindow.gc,
|
||||
0, 0,
|
||||
Width_im(im), Height_im(im),
|
||||
x, wy);
|
||||
if (Mask_im(im) != None) {
|
||||
XSetClipMask(grdisplay, grbstore.gc, None);
|
||||
if(grautoflush)
|
||||
if(grauto_flush)
|
||||
XSetClipMask(grdisplay, grwindow.gc, None);
|
||||
}
|
||||
if(grautoflush)
|
||||
if(grauto_flush)
|
||||
XFlush(grdisplay);
|
||||
return Val_unit;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ extern Colormap grcolormap; /* The color map */
|
|||
extern struct canvas grwindow; /* The graphics window */
|
||||
extern struct canvas grbstore; /* The pixmap used for backing store */
|
||||
extern int grwhite, grblack; /* Black and white pixels */
|
||||
extern Bool grautoflush; /* Auto-flush flag */
|
||||
extern Bool grauto_flush; /* Auto-flush flag */
|
||||
extern int grx, gry; /* Coordinates of the current point */
|
||||
extern unsigned long grcolor; /* Current drawing color */
|
||||
extern XFontStruct * grfont; /* Current font */
|
||||
|
|
|
@ -29,7 +29,7 @@ Colormap grcolormap;
|
|||
int grwhite, grblack;
|
||||
struct canvas grwindow;
|
||||
struct canvas grbstore;
|
||||
Bool grautoflush ;
|
||||
Bool grauto_flush ;
|
||||
int grx, gry;
|
||||
unsigned long grcolor;
|
||||
extern XFontStruct * grfont;
|
||||
|
@ -140,7 +140,7 @@ value gr_open_graph(value arg)
|
|||
XSetForeground(grdisplay, grbstore.gc, grcolor);
|
||||
|
||||
/* Set the auto-flush flag */
|
||||
grautoflush = True ;
|
||||
grauto_flush = True ;
|
||||
|
||||
/* The global data structures are now correctly initialized.
|
||||
In particular, gr_sigio_handler can now handle events safely. */
|
||||
|
@ -216,7 +216,7 @@ value gr_clear_graph(void)
|
|||
XFillRectangle(grdisplay, grbstore.win, grbstore.gc,
|
||||
0, 0, grbstore.w, grbstore.h);
|
||||
XSetForeground(grdisplay, grbstore.gc, grcolor);
|
||||
if(grautoflush) {
|
||||
if(grauto_flush) {
|
||||
XSetForeground(grdisplay, grwindow.gc, grwhite);
|
||||
XFillRectangle(grdisplay, grwindow.win, grwindow.gc,
|
||||
0, 0, grwindow.w, grwindow.h);
|
||||
|
@ -249,11 +249,11 @@ value gr_flush(void)
|
|||
return Val_unit ;
|
||||
}
|
||||
|
||||
value gr_autoflush(value v)
|
||||
value gr_auto_flush(value v)
|
||||
{
|
||||
Bool old = grautoflush ;
|
||||
grautoflush = Bool_val(v) ;
|
||||
if(old == False && grautoflush == True)
|
||||
Bool old = grauto_flush ;
|
||||
grauto_flush = Bool_val(v) ;
|
||||
if(old == False && grauto_flush == True)
|
||||
return gr_flush() ;
|
||||
else
|
||||
return Val_unit ;
|
||||
|
|
|
@ -44,7 +44,7 @@ static void gr_draw_text(char *txt, int len)
|
|||
if (grfont == NULL) gr_font(DEFAULT_FONT);
|
||||
XDrawString(grdisplay, grbstore.win, grbstore.gc,
|
||||
grx, Bcvt(gry) - grfont->descent + 1, txt, len);
|
||||
if(grautoflush) {
|
||||
if(grauto_flush) {
|
||||
XDrawString(grdisplay, grwindow.win, grwindow.gc,
|
||||
grx, Wcvt(gry) - grfont->descent + 1, txt, len);
|
||||
XFlush(grdisplay);
|
||||
|
|
Loading…
Reference in New Issue