[kaffe] Patch: Merge java.awt.Color from Classpath

Benja Fallenstein b.fallenstein@gmx.de
Thu May 15 12:03:02 2003


This is a multi-part message in MIME format.
--------------010608080904050700060009
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit


Hi all,

Kaffe's Color is not yet updated to Java 1.2, which changes the simple 
(red,green,blue) into a more complex scheme where colors can come from 
different color spaces etc. The simplest route to rectify this seemed to 
replace Kaffe's Color by the one from Classpath-- the other 
color-related classes like ColorSpace &c already come from Classpath. In 
the attached patch, I went this route, adding Kaffe's 'nativeValue' 
optimization (which allows the toolkit to store a native representation 
of a color in the Color object).

I tried to add the class ColorPaintContext, which Color depends on, from 
Classpath, but failed somehow (after 'sh developers/autogen.sh; 
./configure' I still get an error that ColorPaintContext is not found). 
In the attached patch, I thus commented out the parts that use 
ColorPaintContext. Maybe someone more in the know can add 
ColorPaintContext to the library.

Suggested changelog message: :-)
Replaced Kaffe's java.awt.Color by the 1.2-compliant one from GNU 
Classpath, adding support for 'nativeValue' to it.

Thanks!
- Benja

--------------010608080904050700060009
Content-Type: text/plain;
 name="color.diff"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="color.diff"

PyBqYXZhL2F3dC9Db2xvclBhaW50Q29udGV4dC5qYXZhCkluZGV4OiBNYWtlZmlsZS5pbgo9
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3ZzL2thZmZlL2thZmZlL2xpYnJhcmllcy9qYXZh
bGliL01ha2VmaWxlLmluLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjE0MQpkaWZmIC11IC1y
MS4xNDEgTWFrZWZpbGUuaW4KLS0tIE1ha2VmaWxlLmluCTE1IE1heSAyMDAzIDE1OjAzOjIx
IC0wMDAwCTEuMTQxCisrKyBNYWtlZmlsZS5pbgkxNSBNYXkgMjAwMyAxODo1MDozMyAtMDAw
MApAQCAtMjU0LD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ZmluYWwgQ29s
b3IgY3lhbiA9IG5ldyBDb2xvcigweDAwZmZmZiwgZmFsc2UpOworCisgIC8qKgorICAgKiBD
b25zdGFudCBmb3IgdGhlIGNvbG9yIGN5YW46IFI9MCwgRz0yNTUsIEI9MjU1LgorICAgKgor
ICAgKiBAc2luY2UgMS40CisgICAqLworICBwdWJsaWMgc3RhdGljIGZpbmFsIENvbG9yIENZ
QU4gPSBjeWFuOworCisgIC8qKiBDb25zdGFudCBmb3IgdGhlIGNvbG9yIGJsdWU6IFI9MCwg
Rz0wLCBCPTI1NS4gKi8KKyAgcHVibGljIHN0YXRpYyBmaW5hbCBDb2xvciBibHVlID0gbmV3
IENvbG9yKDB4MDAwMGZmLCBmYWxzZSk7CisKKyAgLyoqCisgICAqIENvbnN0YW50IGZvciB0
aGUgY29sb3IgYmx1ZTogUj0wLCBHPTAsIEI9MjU1LgorICAgKgorICAgKiBAc2luY2UgMS40
CisgICAqLworICBwdWJsaWMgc3RhdGljIGZpbmFsIENvbG9yIEJMVUUgPSBibHVlOworCisg
IC8qKiBJbnRlcm5hbCBtYXNrIGZvciByZWQuICovCisgIHByaXZhdGUgc3RhdGljIGZpbmFs
IGludCBSRURfTUFTSyA9IDI1NSA8PCAxNjsKKworICAvKiogSW50ZXJuYWwgbWFzayBmb3Ig
Z3JlZW4uICovCisgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBHUkVFTl9NQVNLID0gMjU1
IDw8IDg7CisKKyAgLyoqIEludGVybmFsIG1hc2sgZm9yIGJsdWUuICovCisgIHByaXZhdGUg
c3RhdGljIGZpbmFsIGludCBCTFVFX01BU0sgPSAyNTU7CisKKyAgLyoqIEludGVybmFsIG1h
c2sgZm9yIGFscGhhLiBQYWNrYWdlIHZpc2libGUgZm9yIHVzZSBpbiBzdWJjbGFzcy4gKi8K
KyAgc3RhdGljIGZpbmFsIGludCBBTFBIQV9NQVNLID0gMjU1IDw8IDI0OworCisgIC8qKiBB
bW91bnQgdG8gc2NhbGUgY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Ymx1ZSA8IG1pbikKKyAgICAgIG1pbiA9IGJsdWU7CisgICAgYXJyYXlb
Ml0gPSBtYXggLyAyNTVmOworICAgIC8vIENhbGN1bGF0ZSBzYXR1cmF0aW9uLgorICAgIGlm
IChtYXggPT0gMCkKKyAgICAgIGFycmF5WzFdID0gMDsKKyAgICBlbHNlCisgICAgICBhcnJh
eVsxXSA9IChtYXggLSBtaW4pIC8gbWF4OworICAgIC8vIENhbGN1bGF0ZSBodWUuCisgICAg
aWYgKGFycmF5WzFdID09IDApCisgICAgICBhcnJheVswXSA9IDA7CisgICAgZWxzZQorICAg
ICAgeworICAgICAgICBmbG9hdCBkZWx0YSA9IChtYXggLSBtaW4pICogNjsKKyAgICAgICAg
aWYgKHJlZCA9PSBtYXgpCisgICAgICAgICAgYXJyYXlbMF0gPSAoZ3JlZW4gLSBibHVlKSAv
IGRlbHRhOworICAgICAgICBlbHNlIGlmIChncmVlbiA9PSBtYXgpCisgICAgICAgICAgYXJy
YXlbMF0gPSAxIC8gMyArIChibHVlIC0gcmVkKSAvIGRlbHRhOworICAgICAgICBlbHNlCisg
ICAgICAgICAgYXJyYXlbMF0gPSAyIC8gMyArIChyZWQgLSBncmVlbikgLyBkZWx0YTsKKyAg
ICAgICAgaWYgKGFycmF5WzBdIDwgMCkKKyAgICAgICAgICBhcnJheVswXSsrOworICAgICAg
fQorICAgIHJldHVybiBhcnJheTsKKyAgfQorCisgIC8qKgorICAgKiBSZXR1cm5zIGEgbmV3
IGluc3RhbmNlIG9mIDxjb2RlPkNvbG9yPC9jb2RlPiBiYXNlZCBvbiB0aGUgc3BlY2lmaWVk
CisgICAqIEhTQiB2YWx1ZXMuIFRoZSBodWUgbWF5IGJlIGFueSBmbG9hdGluZyBwb2ludDsg
aXQncyBmcmFjdGlvbmFsIHBvcnRpb24KKyAgICogaXMgdXNlZCB0byBzZWxlY3QgdGhlIGFu
Z2xlIGluIHRoZSBIU0IgbW9kZWwuIFRoZSBzYXR1cmF0aW9uIGFuZAor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c2VyQm91bmRzLAorICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWZmaW5lVHJhbnNmb3JtIHhmb3JtLAor
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVuZGVyaW5nSGludHMgaGlu
dHMpCisgIHsKKyAgICAvLyBYWFggZ2V0IENvbG9yUGFpbnRDb250ZXh0IGluIGZyb20gQ2xh
c3NwYXRoIGFuZCBtZXJnZSBpdCBpbgorICAgIHRocm93IG5ldyBFcnJvcigiY3JlYXRlQ29u
dGV4dCBub3QgaW1wbGVtZW50ZWQiKTsKKyAgICAvL2lmIChjb250ZXh0ID09IG51bGwpCisg
ICAgLy9jb250ZXh0ID0gbmV3IENvbG9yUGFpbnRDb250ZXh0KHZhbHVlKTsKKyAgICAvL3Jl
dHVybiBjb250ZXh0OworICB9CisKKyAgLyoqCisgICAqIFJldHVybnMgdGhlIHRyYW5zcGFy
ZW5jeSBsZXZlbCBvZiB0aGlzIGNvbG9yLgorICAgKgorICAgKiBAcmV0dXJuIG9uZSBvZiB7
QGxpbmsgI09QQVFVRX0sIHtAbGluayAjQklUTUFTS30sIG9yIHtAbGluayAjVFJBTlNMVUNF
TlR9CisgICAqLworICBwdWJsaWMgaW50IGdldFRyYW5zcGFyZW5jeSgpCisgIHsKKyAgICAv
LyBEbyBub3QgaW5saW5lIGdldFJHQigpIHRvIHRoaXMudmFsdWUsIGJlY2F1c2Ugb2YgU3lz
dGVtQ29sb3IuCisgICAgaW50IGFscGhhID0gZ2V0UkdCKCkgJiBBTFBIQV9NQVNLOworICAg
IHJldHVybiBhbHBoYSA9PSAoMjU1IDw8IDI0KSA/IE9QQVFVRSA6IGFscGhhID09IDAgPyBC
SVRNQVNLIDogVFJBTlNMVUNFTlQ7CisgIH0KKworICAvKioKKyAgICogQ29udmVydHMgZmxv
YXQgdmFsdWVzIHRvIGludGVnZXIgdmFsdWUuCisgICAqCisgICAqIEBwYXJhbSByZWQgdGhl
IHJlZCB2YWx1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ICAgICAgICAgICAgICAgICAgICBmZy5uYXRpdmVWYWx1ZSwKLQkgICAgCSAgICAgICAgICAg
ICAgICAgICAgICAgICBiZy5uYXRpdmVWYWx1ZSwKKwkgICAJICAgICAgICAgICAgICAgICAg
ICAgICAgICAgZmcuZ2V0TmF0aXZlVmFsdWUoKSwKKwkgICAgCSAgICAgICAgICAgICAgICAg
ICAgICAgICBiZy5nZXROYXRpdmVWYWx1ZSgpLAogCSAgICAgCSAgICAgICAgICAgICAgICAg
ICAgICAgICBibGFuayk7CiAJCQkJcmV0dXJuIGc7CiAJCQl9CkBAIC01NTUsNyArNTU1LDcg
QEAKIAkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeE9mZnNldCwg
eU9mZnNldCwKIAkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeENs
aXAsIHlDbGlwLCB3Q2xpcCwgaENsaXAsCiAJICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIGZudC5uYXRpdmVEYXRhLAotCSAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICBmZy5uYXRpdmVWYWx1ZSwgYmcubmF0aXZlVmFsdWUsCisJICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZnLmdldE5hdGl2ZVZhbHVl
KCksIGJnLmdldE5hdGl2ZVZhbHVlKCksCiAJICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIGJsYW5rKTsKIAlyZXR1cm4gZzsKIH0KQEAgLTYyMSw3ICs2MjEsNyBA
QAogCWlmICggKGNsciAhPSBudWxsKSAmJiAoY2xyICE9IGJnQ2xyKSApIHsKIAkJYmdDbHIg
PSBjbHI7CiAJCQotCQlUb29sa2l0LmdyYVNldEJhY2tDb2xvciggbmF0aXZlRGF0YSwgYmdD
bHIubmF0aXZlVmFsdWUpOworCQlUb29sa2l0LmdyYVNldEJhY2tDb2xvciggbmF0aXZlRGF0
YSwgYmdDbHIuZ2V0TmF0aXZlVmFsdWUoKSk7CiAJfQogfQogCkBAIC02NTIsNyArNjUyLDcg
QEAKIHB1YmxpYyB2b2lkIHNldENvbG9yICggQ29sb3IgY2xyICl7CiAJaWYgKCAoY2xyICE9
IG51bGwpICYmIChjbHIgIT0gZmdDbHIpICkgewogCQlmZ0NsciA9IGNscjsKLQkJVG9vbGtp
dC5ncmFTZXRDb2xvciggbmF0aXZlRGF0YSwgZmdDbHIubmF0aXZlVmFsdWUpOworCQlUb29s
a2l0LmdyYVNldENvbG9yKCBuYXRpdmVEYXRhLCBmZ0Nsci5nZXROYXRpdmVWYWx1ZSgpKTsK
IAl9CiB9CiAKQEAgLTY4OCw4ICs2ODgsOCBAQAogCSAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgeE9mZnNldCwgeU9mZnNldCwKIAkgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIHhDbGlwLCB5Q2xpcCwgd0NsaXAsIGhDbGlwLAogCSAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9udC5uYXRpdmVEYXRhLAotCSAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmdDbHIubmF0aXZlVmFsdWUs
Ci0JICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZ0Nsci5uYXRpdmVW
YWx1ZSwKKwkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZnQ2xyLmdl
dE5hdGl2ZVZhbHVlKCksCisJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICBiZ0Nsci5nZXROYXRpdmVWYWx1ZSgpLAogCSAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgYmxhbmspOwogfQogCkBAIC03MDMsNyArNzAzLDcgQEAKIHB1YmxpYyB2
b2lkIHNldFhPUk1vZGUgKCBDb2xvciBuZXdYb3JDbHIgKSB7CiAJ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
OwogfQogCiBwdWJsaWMgdm9pZCBmaWxsQXJjICggaW50IHgsIGludCB5LCBpbnQgd2lkdGgs
IGludCBoZWlnaHQsIGludCBzdGFydEFuZ2xlLCBpbnQgYXJjQW5nbGUgKXsKQEAgLTQzNiw4
ICs0MzYsOCBAQAogCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhPZmYsIHlPZmYs
CiAJIAkgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhDbGlwLCB5Q2xpcCwgd0NsaXAs
IGhDbGlwLAogCSAgCSAgICAgICAgICAgICAgICAgICAgICAgICAgIGZudC5uYXRpdmVEYXRh
LAotCSAgIAkgICAgICAgICAgICAgICAgICAgICAgICAgICBmZy5uYXRpdmVWYWx1ZSwKLQkg
ICAgCSAgICAgICAgICAgICAgICAgICAgICAgICBiZy5uYXRpdmVWYWx1ZSwKKwkgICAJICAg
ICAgICAgICAgICAgICAgICAgICAgICAgZmcuZ2V0TmF0aXZlVmFsdWUoKSwKKwkgICAgCSAg
ICAgICAgICAgICAgICAgICAgICAgICBiZy5nZXROYXRpdmVWYWx1ZSgpLAogCSAgICAgCSAg
ICAgICAgICAgICAgICAgICAgICAgICBibGFuayk7CiAJCQkJcmV0dXJuIGc7CiAJCQl9CkBA
IC01MzgsNyArNTM4LDcgQEAKIAkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgeE9mZnNldCwgeU9mZnNldCwKIAkgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgeENsaXAsIHlDbGlwLCB3Q2xpcCwgaENsaXAsCiAJICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGcuZm9udC5uYXRpdmVEYXRhLAotCSAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnLmZnQ2xyLm5hdGl2ZVZhbHVl
LCBnLmJnQ2xyLm5hdGl2ZVZhbHVlLAorCSAgICAgICAgICAgICAgICAgICAgICAgICAgICA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hdGEsCi0JICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmZ0Ns
ci5uYXRpdmVWYWx1ZSwKLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IGJnQ2xyLm5hdGl2ZVZhbHVlLAorCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgZmdDbHIuZ2V0TmF0aXZlVmFsdWUoKSwKKwkgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIGJnQ2xyLmdldE5hdGl2ZVZhbHVlKCksCiAJICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICBibGFuayk7CiB9CiAKQEAgLTY4NCw3ICs2ODQs
NyBAQAogcHVibGljIHZvaWQgc2V0WE9STW9kZSAoIENvbG9yIG5ld1hvckNsciApIHsKIAlp
ZiAoIG5ld1hvckNsciAhPSB4Q2xyICkgewogCQl4Q2xyID0gbmV3WG9yQ2xyOwotCQlUb29s
a2l0LmdyYVNldFhPUk1vZGUoIG5hdGl2ZURhdGEsIHhDbHIubmF0aXZlVmFsdWUpOworCQlU
b29sa2l0LmdyYVNldFhPUk1vZGUoIG5hdGl2ZURhdGEsIHhDbHIuZ2V0TmF0aXZlVmFsdWUo
KSk7CiAJfQogfQogCkluZGV4OiBqYXZhL2F3dC93aW4zMi9XaW5kb3cuamF2YQo9PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09ClJDUyBmaWxlOiAvY3ZzL2thZmZlL2thZmZlL2xpYnJhcmllcy9qYXZhbGliL2ph
dmEvYXd0L3dpbjMyL1dpbmRvdy5qYXZhLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjMKZGlm
ZiAtdSAtcjEuMyBXaW5kb3cuamF2YQotLS0gamF2YS9hd3Qvd2luMzIvV2luZG93LmphdmEJ
MjggQXVnIDIwMDEgMTU6MDE6MjUgLTAwMDAJMS4zCisrKyBqYXZhL2F3dC93aW4zMi9XaW5k
b3cuamF2YQkxNSBNYXkgMjAwMyAxODo1MDo0NCAtMDAwMApAQCAtNzEsNyArNzEsNyBAQAog
dm9pZCBjcmVhdGVOYXRpdmUgKCkgewogCW5hdGl2ZURhdGEgPSBUb29sa2l0LnduZENyZWF0
ZVdpbmRvdyggKG93bmVyICE9IG51bGwpID8gb3duZXIubmF0aXZlRGF0YSA6IG51bGwsCiAJ
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4LCB5LCB3aWR0aCwgaGVpZ2h0LAot
CSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yLnR5cGUsIGJnQ2xyLm5h
dGl2ZVZhbHVlKTsKKwkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvci50
eXBlLCBiZ0Nsci5nZXROYXRpdmVWYWx1ZSgpKTsKIH0KIAogcHVibGljIHZvaWQgZGlzcG9z
ZSAoKSB7Cg==
--------------010608080904050700060009
Content-Type: text/x-java;
 name="ColorPaintContext.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ColorPaintContext.java"

/* ColorPaintContext.java -- context for painting solid colors
   Copyright (C) 2002 Free Software Foundation, Inc.

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.

Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module.  An independent module is a module which is not derived from
or based on this library.  If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so.  If you do not wish to do so, delete this
exception statement from your version. */


package java.awt;

import java.awt.image.ColorModel;
import java.awt.image.Raster;

/**
 * This class provides a paint context which will fill a rectanglar region of
 * a raster scan with the given color. However, it is not yet completely
 * implemented.
 *
 * @author Eric Blake <ebb9@email.byu.edu>
 */
class ColorPaintContext implements PaintContext
{
  /**
   * The color to fill any raster with. Package visible for use in
   * SystemColor.
   */
  final int color;

  /**
   * Create the context for a given color.
   *
   * @param c the solid color to use
   */
  ColorPaintContext(int c)
  {
    color = c;
  }

  /**
   * Release the resources allocated for the paint. As the color is constant,
   * there aren't any resources.
   */
  public void dispose()
  {
  }

  /**
   * Return the color model of this context. This ignores the model passed
   * in the request, since colors are always in sRGB.
   *
   * @return the context color model
   */
  public ColorModel getColorModel()
  {
    return ColorModel.getRGBdefault();
  }

  /**
   * Return a raster containing the colors for the graphics operation.
   *
   * @param x the x-coordinate, in device space
   * @param y the y-coordinate, in device space
   * @param w the width, in device space
   * @param h the height, in device space
   * @return a raster for the given area and color
   */
  public Raster getRaster(int x, int y, int w, int h)
  {
    // XXX Implement. Sun uses undocumented implementation class
    // sun.awt.image.IntegerInterleavedRaster.
    throw new Error("not implemented");
  }
} // class ColorPaintContext

--------------010608080904050700060009--