#!perl

require "./xbase.pl";
require "./xwdhead.pl";

$xopen = &xlib::x_open_display($ENV{"DISPLAY"});
die $xlib::status if not defined $xopen;

$dowind = $xlib::root_window;
# $dowind = $ENV{"WINDOWID"};

# print &xlib::x_beep($xopen,25),"\n";

$GC = &xlib::x_create_gc($xopen, $dowind,
			 $X::defines{"GCForeground"}
			 | $X::defines{"GCBackground"},
			 $xlib::root_white, $xlib::root_black);
for $i (20..30) {
  xlib::xdrawpoints($xopen, $X::defines{"CoordModeOrigin"}, $dowind, $GC,
		    $xopen->{"Roots"}[0]->{"pixWidth"}-$i,
		    $xopen->{"Roots"}[0]->{"pixHeight"}-10);
}

$SIG{"INT"} = sub {
    xlib::x_closedisplay($xopen);
    exit;
  };

print "waiting...\n";
while(defined($st = xlib::handle_event($xopen))) { # assume error for now?
    print "event: $st\n";
}

# sun server gives:
# imageByteOrder: 1
# bitmapBitOrder: 1
# bitmapScanlineUnit: 32
# bitmapScanlinePad: 32
