1 /* Copyright (C) 2000 Free Software Foundation
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
12 #include <gnu/gcj/RawData.h>
14 #include <gnu/gcj/xlib/XException.h>
15 #include <gnu/gcj/xlib/Display.h>
16 #include <gnu/gcj/xlib/Drawable.h>
17 #include <gnu/gcj/xlib/XImage.h>
19 #include <java/awt/Rectangle.h>
21 jboolean
gnu::gcj::xlib::Drawable::copyIntoXImageImpl(XImage
* image
,
23 jint width
, jint height
,
24 jint destX
, jint destY
)
26 ::Display
* dpy
= (::Display
*) (getDisplay()->display
);
27 ::XImage
* ximage
= (::XImage
*) image
->structure
;
28 int format
= image
->getFormat();
31 ::XImage
* result
= XGetSubImage(dpy
, xid
,
41 throw new XException(MSG_XGETSUBIMAGE_FAILED
);
46 jint
gnu::gcj::xlib::Drawable::getDepth ()
48 ::Display
* dpy
= (::Display
*) (getDisplay ()->display
);
51 unsigned int w
, h
, bw
, depth
;
53 Status status
= XGetGeometry (dpy
, getXID(), &root
,
59 throw new XException (display
, status
);
67 gnu::gcj::xlib::Drawable::getBounds(::java::awt::Rectangle
* rv
)
69 ::Display
* dpy
= (::Display
*) (getDisplay()->display
);
73 unsigned int w
, h
, bw
, depth
;
75 Status status
= XGetGeometry(dpy
, getXID(), &root
,
82 throw new XException(display
, status
);
89 rv
= new ::java::awt::Rectangle(x
, y
, w
, h
);