mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-19 17:59:47 +08:00
9e9e204234
2003-04-19 Scott Gilbertson <scottg@mantatest.com> * gnu/awt/xlib/XGraphics.java (XGraphics): Use new GC.create. (dispose): Null metrics. * gnu/awt/xlib/XToolkit.java (sync): Implement. * gnu/gcj/xlib/Clip.java (dispose): Change name of native from finalize. (finalize): Call dispose. * gnu/gcj/xlib/Drawable.java (gcCache): New field. (gcCachedCount): New field. (finalize): New method. (putGCInCache): New method. (getGCFromCache): New method. * gnu/gcj/xlib/GC.java (GC): Make protected. (clone): Get new GC from cache if possible. (create): New static method. (dispose): Save old GC in cache. * gnu/gcj/xlib/natClip.cc (dispose): Check for null before deleting. * gnu/gcj/xlib/natGC.cc (initStructure): Call XCreateGC only if gc is null. * gnu/gcj/xlib/Pixmap.java (Pixmap): Use new GC.create. * java/awt/Container.java (visitChild): Dispose gfx2 when finished. From-SVN: r65827
41 lines
897 B
Java
41 lines
897 B
Java
/* Copyright (C) 2000 Free Software Foundation
|
|
|
|
This file is part of libgcj.
|
|
|
|
This software is copyrighted work licensed under the terms of the
|
|
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
|
details. */
|
|
|
|
package gnu.gcj.xlib;
|
|
|
|
import gnu.gcj.RawData;
|
|
import java.awt.Rectangle;
|
|
|
|
/**
|
|
* Describes a clip that is used to constrain drawing using a GC
|
|
* within a specific region. Currently it supports clip regions
|
|
* consisting of the union of multiple rectangles. Other clip forms
|
|
* may be implented later. This class is used internally by the GC
|
|
* class, and wraps a native XRectVector[].
|
|
*
|
|
* @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
|
|
*/
|
|
final class Clip
|
|
{
|
|
public Clip(Rectangle[] rects)
|
|
{
|
|
init(rects);
|
|
}
|
|
|
|
private native void init(Rectangle[] rects);
|
|
|
|
public void finalize()
|
|
{
|
|
dispose ();
|
|
}
|
|
|
|
public native void dispose();
|
|
|
|
RawData xrects;
|
|
}
|