[kaffe] Classpath AWT progress.
James Simmons
jsimmons@infradead.org
Mon Dec 8 11:27:02 2003
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
--1456859747-212071696-1070911535=:9241
Content-Type: TEXT/PLAIN; charset=US-ASCII
> James Simmons <jsimmons@infradead.org> writes:
>
> > Give me a few days to get a patch going. At present I'm working on
> > code that hits two targets, X windows and the linux framebuffer
> > console. I want to get a system going that runs on X windows and the
> > framebuffer console at the same time!!!
>
> Can we call you Santa Claus?
Here is the code I have so far. I extended GraphicsEnvironment to actually
work. At present it gives exceptions. The main file is
ClasspathGraphicsEnvironment.java. Its goal is to load each type of
GraphicsDevice driver. I have fbinput and xlib drivers of which I attached
XGraphicsDevice. What I'm attempting to tackle now is loading more than
one object for each type of driver. I haven't got it to work just yet.
Improvements and comments welcomed.
/* ClasspathGraphicsEnvironment.java -- information about the graphics environment
Copyright (C) 2003 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 gnu.java.awt;
import gnu.classpath.Configuration;
import java.awt.HeadlessException;
import java.awt.image.BufferedImage;
import java.awt.GraphicsEnvironment;
import java.awt.GraphicsDevice;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Point;
import java.awt.Font;
import java.util.Locale;
/**
* This descibes the collection of GraphicsDevice and Font objects available
* on a given platform. The resources might be local or remote, and specify
* the valid configurations for displaying graphics.
*
* @author James Simmons <jsimmons@infradead.org>
* @see GraphicsDevice
* @see GraphicsConfiguration
* @since 1.4
* @status updated to 1.4
*/
public class ClasspathGraphicsEnvironment extends GraphicsEnvironment
{
String [] drivers = { "gnu.java.awt.peer.xlib.XGraphicsDevice" ,
"gnu.java.awt.peer.fbinput.FBGraphicsDevice" };
GraphicsDevice [] displays = new GraphicsDevice [drivers.length];
GraphicsDevice firstpick;
boolean unplugged = true;
static
{
if (Configuration.INIT_LOAD_LIBRARY)
System.loadLibrary("awt");
}
/**
* The environment must be obtained from a factory or query method, hence
* this constructor is protected.
*
* At present we only work with a local X Windows connection. In the future
* we could expand this to include remote connections. To do that I have to
* do two things. First pass in the hostname of the machines I want to
* connect to. Second tell the difference between the local connection and
* the remote.
*/
protected ClasspathGraphicsEnvironment()
{
int count = 0, i = 0;
while (i < drivers.length) {
try {
Class cls = Class.forName(drivers[i]);
while (true) {
Object obj = cls.newInstance();
if (obj instanceof GraphicsDevice) {
displays[count++] = (GraphicsDevice) obj;
} else {
break;
}
}
} catch (Throwable t) {
System.err.println("Driver "+drivers[i]+" not avaliable");
}
i++;
}
if (count == 0) {
throw new HeadlessException("No Displays avaliable");
} else
firstpick = displays[0];
}
/**
* Get an array of all the GraphicsDevice objects.
*
* @return the available graphics devices, may be 0 length
* @throws HeadlessException if the environment is headless
*/
public GraphicsDevice[] getScreenDevices()
{
return displays;
}
/**
* Get the default screen GraphicsDevice object.
*
* @return the default screen device
* @throws HeadlessException if the environment is headless
*/
public GraphicsDevice getDefaultScreenDevice()
{
return firstpick;
}
/**
* Return a Graphics2D object which will render into the specified image.
*
* @param image the image to render into
* @return the object that renders into the image
*/
public Graphics2D createGraphics(BufferedImage image)
{
return null;
}
/**
* Returns an array of the one-point size fonts available in this
* environment. From there, the user can select the font and derive the
* correct one of proper size and attributes, using <code>deriveFont</code>.
* Only one master version of each font appears in this array; if a font
* can be derived from another, it must be created in that way.
*
* @return the array of available fonts
* @see #getAvailableFontFamilyNames()
* @see Font#deriveFont(int, float)
* @since 1.2
*/
public Font[] getAllFonts()
{
return null;
}
/**
* Returns an array of the font family names available in this environment.
* This allows flexibility in choosing the style of font, while still letting
* the Font class decide its best match.
*
* @return the array of available font families
* @see #getAllFonts()
* @see Font#getFamily()
* @since 1.2
*/
public String[] getAvailableFontFamilyNames()
{
return null;
}
/**
* Returns an array of the font family names available in this environment,
* localized to the current Locale if l is non-null. This allows
* flexibility in choosing the style of font, while still letting the Font
* class decide its best match.
*
* @param l the locale to use
* @return the array of available font families, localized
* @see #getAllFonts()
* @see Font#getFamily()
* @since 1.2
*/
public String[] getAvailableFontFamilyNames(Locale l)
{
return null;
}
/**
* Returns the point where a window should be centered. You should probably
* also check that the window fits within the screen bounds. The default
* simply returns the center of the maximum window bounds; subclasses should
* override this if native objects (like scrollbars) make that off-centered.
*
* @return the centering point
* @throws HeadlessException if the environment is headless
* @see #getMaximumWindowBounds()
* @since 1.4
*/
public Point getCenterPoint()
{
Rectangle r = getMaximumWindowBounds();
return new Point(r.x + r.width / 2, r.y + r.height / 2);
}
/**
* Returns the maximum bounds for a centered window object. The default
* implementation simply returns the bounds of the default configuration
* of the default screen; subclasses should override this to if native
* objects (like scrollbars) reduce what is truly available. Also,
* subclasses should override this if the window should be centered across
* a multi-screen display.
*
* @return the maximum window bounds
* @throws HeadlessException if the environment is headless
* @see #getCenterPoint()
* @see GraphicsConfiguration#getBounds()
* @see Toolkit#getScreenInsets(GraphicsConfiguration)
* @since 1.4
*/
public Rectangle getMaximumWindowBounds()
{
return getDefaultScreenDevice().getDefaultConfiguration().getBounds();
}
} // class ClasspathGraphicsEnvironment
--1456859747-212071696-1070911535=:9241
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="XGraphicsDevice.java"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0312081925350.9241@phoenix.infradead.org>
Content-Description:
Content-Disposition: attachment; filename="XGraphicsDevice.java"
LyogWEdyYXBoaWNzRGV2aWNlLmphdmEgLS0gaW5mb3JtYXRpb24gYWJvdXQg
YSBncmFwaGljcyBkZXZpY2UNCiAgIENvcHlyaWdodCAoQykgMjAwMyBGcmVl
IFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4NCg0KVGhpcyBmaWxlIGlzIHBh
cnQgb2YgR05VIENsYXNzcGF0aC4NCg0KR05VIENsYXNzcGF0aCBpcyBmcmVl
IHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9k
aWZ5DQppdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1
YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieQ0KdGhlIEZyZWUgU29mdHdh
cmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiwgb3IgKGF0IHlvdXIg
b3B0aW9uKQ0KYW55IGxhdGVyIHZlcnNpb24uDQoNCkdOVSBDbGFzc3BhdGgg
aXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVz
ZWZ1bCwgYnV0DQpXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVu
IHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mDQpNRVJDSEFOVEFCSUxJVFkgb3Ig
RklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UuICBTZWUgdGhlIEdO
VQ0KR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLg0K
DQpZb3Ugc2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SBzaXplIG9mIGFjY2VsZXJhdGVkIG1lbW9y
eSBhdmFpbGFibGUNCiAgICogQHNlZSBWb2xhdGlsZUltYWdlI2ZsdXNoKCkN
CiAgICogQHNlZSBJbWFnZUNhcGFiaWxpdGllcyNpc0FjY2VsZXJhdGVkKCkN
CiAgICovDQogIHB1YmxpYyBpbnQgZ2V0QXZhaWxhYmxlQWNjZWxlcmF0ZWRN
ZW1vcnkoKQ0KICB7DQogICAgcmV0dXJuIDA7DQogIH0NCn0gLy8gY2xhc3Mg
R3JhcGhpY3NEZXZpY2UNCg==
--1456859747-212071696-1070911535=:9241
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="GraphicsEnvironment.java"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0312081925351.9241@phoenix.infradead.org>
Content-Description:
Content-Disposition: attachment; filename="GraphicsEnvironment.java"
LyogR3JhcGhpY3NFbnZpcm9ubWVudC5qYXZhIC0tIGluZm9ybWF0aW9uIGFi
b3V0IHRoZSBncmFwaGljcyBlbnZpcm9ubWVudA0KICAgQ29weXJpZ2h0IChD
KSAyMDAyIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbiwgSW5jLg0KDQpUaGlz
IGZpbGUgaXMgcGFydCBvZiBHTlUgQ2xhc3NwYXRoLg0KDQpHTlUgQ2xhc3Nw
YXRoIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0
IGFuZC9vciBtb2RpZnkNCml0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05V
IEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5DQp0aGUg
RnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyLCBv
ciAoYXQgeW91ciBvcHRpb24pDQphbnkgbGF0ZXIgdmVyc2lvbi4NCg0KR05V
IENsYXNzcGF0aCBpcyBkaXN0cmlidXRlZCBpbiB0aG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