2001-05-14 06:34:02 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
2011-07-27 07:17:02 -07:00
|
|
|
/* OCaml */
|
2001-05-14 06:34:02 -07:00
|
|
|
/* */
|
|
|
|
/* Jun Furuse, projet Cristal, INRIA Rocquencourt */
|
|
|
|
/* */
|
|
|
|
/* Copyright 2001 Institut National de Recherche en Informatique et */
|
|
|
|
/* en Automatique. All rights reserved. This file is distributed */
|
2001-12-07 05:41:02 -08:00
|
|
|
/* under the terms of the GNU Library General Public License, with */
|
|
|
|
/* the special exception on linking described in file ../../LICENSE. */
|
2001-05-14 06:34:02 -07:00
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
#include "libgraph.h"
|
|
|
|
|
2004-03-24 07:02:06 -08:00
|
|
|
value caml_gr_open_subwindow(value vx, value vy, value width, value height)
|
2001-05-14 06:34:02 -07:00
|
|
|
{
|
|
|
|
Window win;
|
|
|
|
|
2001-12-07 02:49:30 -08:00
|
|
|
int h = Int_val(height);
|
|
|
|
int w = Int_val(width);
|
2002-05-07 00:41:12 -07:00
|
|
|
int x = Int_val(vx);
|
|
|
|
int y = Int_val(vy);
|
2001-12-07 02:49:30 -08:00
|
|
|
|
2004-03-24 07:02:06 -08:00
|
|
|
caml_gr_check_open();
|
|
|
|
win = XCreateSimpleWindow(caml_gr_display, caml_gr_window.win,
|
2002-05-07 00:41:12 -07:00
|
|
|
x, Wcvt(y + h), w, h,
|
2004-03-24 07:02:06 -08:00
|
|
|
0, caml_gr_black, caml_gr_background);
|
|
|
|
XMapWindow(caml_gr_display, win);
|
|
|
|
XFlush(caml_gr_display);
|
|
|
|
return (caml_gr_id_of_window (win));
|
2001-05-14 06:34:02 -07:00
|
|
|
}
|
|
|
|
|
2004-03-24 07:02:06 -08:00
|
|
|
value caml_gr_close_subwindow(value wid)
|
2001-05-14 06:34:02 -07:00
|
|
|
{
|
|
|
|
Window win;
|
|
|
|
|
2004-03-24 07:02:06 -08:00
|
|
|
caml_gr_check_open();
|
2001-05-14 06:34:02 -07:00
|
|
|
sscanf( String_val(wid), "%lu", (unsigned long *)(&win) );
|
2004-03-24 07:02:06 -08:00
|
|
|
XDestroyWindow(caml_gr_display, win);
|
|
|
|
XFlush(caml_gr_display);
|
2001-05-14 06:34:02 -07:00
|
|
|
return Val_unit;
|
|
|
|
}
|