2003-12-05 Scott Gilbertson <scottg@mantatest.com>
authorsgilbertson <sgilbertson@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Dec 2003 22:10:16 +0000 (22:10 +0000)
committersgilbertson <sgilbertson@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Dec 2003 22:10:16 +0000 (22:10 +0000)
* gnu/gcj/xlib/GC.java (updateClip): Added rectangles argument.
(clip): Removed field
(clipRectangles): New field.
(clone): Use new updateClip.
(setClipRectangles): Use new updateClip.
* gnu/gcj/xlib/natGC.cc (updateClip): Prepare passed rectangles.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74348 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/gnu/gcj/xlib/GC.java
libjava/gnu/gcj/xlib/natGC.cc

index 5a3de58..74c4099 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-05  Scott Gilbertson  <scottg@mantatest.com>
+
+       * gnu/gcj/xlib/GC.java (updateClip): Added rectangles argument.
+       (clip): Removed field
+       (clipRectangles): New field.
+       (clone): Use new updateClip.
+       (setClipRectangles): Use new updateClip.
+       * gnu/gcj/xlib/natGC.cc (updateClip): Prepare passed rectangles.
+
 2003-12-04  Michael Koch  <konqueror@gmx.de>
 
        * java/io/FilePermission.java:
        (_Jv_BytecodeVerifier): Initialize it.
        (~_Jv_BytecodeVerifier): Destroy ref_intersection objects. 
 
-2003-07-24  H. Väisänen  <hvaisane@joyx.joensuu.fi>
+2003-07-24  H. Väisänen  <hvaisane@joyx.joensuu.fi>
 
        * java/text/SimpleDateFormat.java (format) [YEAR_FIELD]: Zero pad
        unless field size is 2.
        * java/io/ObjectOutputStream.java
        (PutField.put): Doesnt throws anything.
 
-2003­03-28  Michael Koch  <konqueror@gmx.de>
+2003­03-28  Michael Koch  <konqueror@gmx.de>
 
        * java/io/FileOutputStream.java:
        Merged class documentation and authors with classpath.
index 24cd3bd..da427c9 100644 (file)
@@ -45,7 +45,7 @@ public class GC implements Cloneable
            gcClone.structure = null;
          }
        gcClone.initStructure(this);
-       gcClone.updateClip();
+       gcClone.updateClip(clipRectangles);
        return gcClone;
       } 
     catch (CloneNotSupportedException ex)
@@ -107,8 +107,8 @@ public class GC implements Cloneable
    */
   public void setClipRectangles(Rectangle[] rectangles)
   {
-    clip = new Clip(rectangles);
-    updateClip();
+    clipRectangles = rectangles;
+    updateClip(clipRectangles);
   }
 
   public native void drawString(String text, int x, int y);
@@ -148,10 +148,10 @@ public class GC implements Cloneable
     return target;
   }
 
-  private native void updateClip();
+  private native void updateClip(Rectangle[] rectangles);
 
   private Drawable target;
   private RawData structure;
-  private Clip clip;
+  private Rectangle[] clipRectangles;
 }
 
index 17bcbe6..3819da4 100644 (file)
@@ -217,25 +217,33 @@ void gnu::gcj::xlib::GC::putImage(XImage* image,
   // no fast fail
 }
 
-void gnu::gcj::xlib::GC::updateClip()
+void gnu::gcj::xlib::GC::updateClip(AWTRectArray* rectangles)
 {
-  if (clip == 0)
-    return;
+  int numRect = JvGetArrayLength(rectangles);
+  XRectVector* xrectvector = new XRectVector(numRect);
   
+  for (int i=0; i<numRect; i++)
+  {
+    AWTRect* awtrect = elements(rectangles)[i];
+    XRectangle& xrect = (*xrectvector)[i];
+      
+    xrect.x      = awtrect->x;
+    xrect.y      = awtrect->y;
+    xrect.width  = awtrect->width;
+    xrect.height = awtrect->height;
+  }
+
   Display* display = target->getDisplay();
   ::Display* dpy = (::Display*) (display->display);
   ::GC gc = (::GC) structure;
-  
-  XRectVector* xrectvector = (XRectVector*) (clip->xrects);
-  int numRect = xrectvector->size();
-  
+
   int originX = 0;
   int originY = 0;
   int ordering = Unsorted;
   XSetClipRectangles(dpy, gc, originX, originY,
                     &(xrectvector->front()), numRect,
                     ordering);
-  // no fast fail
+  delete xrectvector;
 }
 
 void gnu::gcj::xlib::GC::copyArea (gnu::gcj::xlib::Drawable * source,