From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../classpath/javax/print/event/PrintEvent.java | 69 +++++++++++ .../javax/print/event/PrintJobAdapter.java | 129 +++++++++++++++++++++ .../javax/print/event/PrintJobAttributeEvent.java | 89 ++++++++++++++ .../print/event/PrintJobAttributeListener.java | 56 +++++++++ .../classpath/javax/print/event/PrintJobEvent.java | 109 +++++++++++++++++ .../javax/print/event/PrintJobListener.java | 96 +++++++++++++++ .../print/event/PrintServiceAttributeEvent.java | 87 ++++++++++++++ .../print/event/PrintServiceAttributeListener.java | 56 +++++++++ libjava/classpath/javax/print/event/package.html | 56 +++++++++ 9 files changed, 747 insertions(+) create mode 100644 libjava/classpath/javax/print/event/PrintEvent.java create mode 100644 libjava/classpath/javax/print/event/PrintJobAdapter.java create mode 100644 libjava/classpath/javax/print/event/PrintJobAttributeEvent.java create mode 100644 libjava/classpath/javax/print/event/PrintJobAttributeListener.java create mode 100644 libjava/classpath/javax/print/event/PrintJobEvent.java create mode 100644 libjava/classpath/javax/print/event/PrintJobListener.java create mode 100644 libjava/classpath/javax/print/event/PrintServiceAttributeEvent.java create mode 100644 libjava/classpath/javax/print/event/PrintServiceAttributeListener.java create mode 100644 libjava/classpath/javax/print/event/package.html (limited to 'libjava/classpath/javax/print/event') diff --git a/libjava/classpath/javax/print/event/PrintEvent.java b/libjava/classpath/javax/print/event/PrintEvent.java new file mode 100644 index 000000000..4eaedceb6 --- /dev/null +++ b/libjava/classpath/javax/print/event/PrintEvent.java @@ -0,0 +1,69 @@ +/* PrintEvent.java -- + Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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 javax.print.event; + +import java.util.EventObject; + + +/** + * Superclass of all events in the Java Print Service API. + * + * @author Michael Koch (konqueror@gmx.de) + */ +public class PrintEvent extends EventObject +{ + /** + * Constructs a PrintEvent object. + * + * @param source the source of this event + */ + public PrintEvent(Object source) + { + super(source); + } + + /** + * Returns a string representation of this object. + * + * @return The string representation + */ + public String toString() + { + return "PrintEvent on " + getSource().toString(); + } +} diff --git a/libjava/classpath/javax/print/event/PrintJobAdapter.java b/libjava/classpath/javax/print/event/PrintJobAdapter.java new file mode 100644 index 000000000..e8e71008e --- /dev/null +++ b/libjava/classpath/javax/print/event/PrintJobAdapter.java @@ -0,0 +1,129 @@ +/* PrintJobAdapter.java -- + Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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 javax.print.event; + + +/** + * Adapter class for implementing {@link javax.print.event.PrintJobListener} + * classes. The methods in this class do nothing by default. Subclasses may + * only implement the methods for the {@link javax.print.event.PrintJobEvent}s + * they are interested in. + * + * @author Michael Koch (konqueror@gmx.de) + */ +public abstract class PrintJobAdapter + implements PrintJobListener +{ + /** + * Constructs a PrintJobAdapter object. + */ + public PrintJobAdapter() + { + // Do nothing here. + } + + /** + * Called to notify the client that all data has been successfully transferred + * to the print service. + *

The default implementation does nothing.

+ * + * @param event the event. + */ + public void printDataTransferCompleted(PrintJobEvent event) + { + // Do nothing here. + } + + /** + * Called to notify the client that a print job was canceled. + *

The default implementation does nothing.

+ * + * @param event the event. + */ + public void printJobCanceled(PrintJobEvent event) + { + // Do nothing here. + } + + /** + * Called to notify the client that a print job was successfully completed. + *

The default implementation does nothing.

+ * + * @param event the event. + */ + public void printJobCompleted(PrintJobEvent event) + { + // Do nothing here. + } + + /** + * Called to notify the client that a print job failed to complete + * successfully. + *

The default implementation does nothing.

+ * + * @param event the event. + */ + public void printJobFailed(PrintJobEvent event) + { + // Do nothing here. + } + + /** + * Called to notify the client that no more job events will be send. + *

The default implementation does nothing.

+ * + * @param event the event. + */ + public void printJobNoMoreEvents(PrintJobEvent event) + { + // Do nothing here. + } + + /** + * Called to notify the client that a problem occured during printing. + * This event signals problems a user might be able to fix + * (e.g. out of paper or paper jam). + *

The default implementation does nothing.

+ * + * @param event the event. + */ + public void printJobRequiresAttention(PrintJobEvent event) + { + // Do nothing here. + } +} diff --git a/libjava/classpath/javax/print/event/PrintJobAttributeEvent.java b/libjava/classpath/javax/print/event/PrintJobAttributeEvent.java new file mode 100644 index 000000000..dd242e8e6 --- /dev/null +++ b/libjava/classpath/javax/print/event/PrintJobAttributeEvent.java @@ -0,0 +1,89 @@ +/* PrintJobAttributeEvent.java -- + Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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 javax.print.event; + +import javax.print.DocPrintJob; +import javax.print.attribute.PrintJobAttributeSet; + + +/** + * PrintJobAttributeEvents are generated by a + * PrintService to inform registered listeners that attributes + * associated with a {@link javax.print.DocPrintJob} instance have changed. + * + * @author Michael Koch (konqueror@gmx.de) + */ +public class PrintJobAttributeEvent extends PrintEvent +{ + private static final long serialVersionUID = -6534469883874742101L; + + private PrintJobAttributeSet attributes; + + /** + * Constructs a PrintJobAttributeEvent object. + * + * @param source the source of this event + * @param attributes the attribute changes being reported + */ + public PrintJobAttributeEvent(DocPrintJob source, + PrintJobAttributeSet attributes) + { + super(source); + this.attributes = attributes; + } + + /** + * Returns the print job generating this event. + * + * @return The print job. + */ + public DocPrintJob getPrintJob() + { + return (DocPrintJob) getSource(); + } + + /** + * Returns the attributes that changed and their new values. + * + * @return The changed attributes. + */ + public PrintJobAttributeSet getAttributes() + { + return attributes; + } +} diff --git a/libjava/classpath/javax/print/event/PrintJobAttributeListener.java b/libjava/classpath/javax/print/event/PrintJobAttributeListener.java new file mode 100644 index 000000000..bd2ea2695 --- /dev/null +++ b/libjava/classpath/javax/print/event/PrintJobAttributeListener.java @@ -0,0 +1,56 @@ +/* PrintJobAttributeListener.java -- + Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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 javax.print.event; + + +/** + * Listener interface to receive attribute changes from a print job. + * Implementations of this interface can be registered with a + * {@link javax.print.DocPrintJob} instance. + * + * @author Michael Koch (konqueror@gmx.de) + */ +public interface PrintJobAttributeListener +{ + /** + * Notifies the listener of an attribute change. + * + * @param event the event + */ + void attributeUpdate(PrintJobAttributeEvent event); +} diff --git a/libjava/classpath/javax/print/event/PrintJobEvent.java b/libjava/classpath/javax/print/event/PrintJobEvent.java new file mode 100644 index 000000000..db885648c --- /dev/null +++ b/libjava/classpath/javax/print/event/PrintJobEvent.java @@ -0,0 +1,109 @@ +/* PrintEvent.java -- + Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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 javax.print.event; + +import javax.print.DocPrintJob; + + +/** + * PrintJobEvents are generated by a print job during + * print job processing to inform registered listeners about the state + * of processing. + * + * @author Michael Koch (konqueror@gmx.de) + */ +public class PrintJobEvent extends PrintEvent +{ + private static final long serialVersionUID = -1711656903622072997L; + + /** Indicates that the data transfer to the print service has completed. */ + public static final int DATA_TRANSFER_COMPLETE = 106; + + /** Indicates that the print job was canceled. */ + public static final int JOB_CANCELED = 101; + + /** Indicates that the print job was completed (=printed). */ + public static final int JOB_COMPLETE = 102; + + /** Indicates that the print job failed to complete. */ + public static final int JOB_FAILED = 103; + + /** Indicates that no more job events will be send.*/ + public static final int NO_MORE_EVENTS = 105; + + /** + * Indicates a situation where human intervention might be needed. + * E.g. the printer run out of paper or a paper jam occured. + */ + public static final int REQUIRES_ATTENTION = 104; + + /** The reason (one of the defined constants). */ + private int reason; + + /** + * Constructs a PrintJobEvent object. + * + * @param source the source generating this event + * @param reason the reason for this event + */ + public PrintJobEvent(DocPrintJob source, int reason) + { + super(source); + this.reason = reason; + } + + /** + * Returns the reason for this event. + * + * @return The reason. + */ + public int getPrintEventType() + { + return reason; + } + + /** + * Returns the print job that generated this event. + * + * @return The print job. + */ + public DocPrintJob getPrintJob() + { + return (DocPrintJob) getSource(); + } +} diff --git a/libjava/classpath/javax/print/event/PrintJobListener.java b/libjava/classpath/javax/print/event/PrintJobListener.java new file mode 100644 index 000000000..8ac1a0143 --- /dev/null +++ b/libjava/classpath/javax/print/event/PrintJobListener.java @@ -0,0 +1,96 @@ +/* PrintJobListener.java -- + Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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 javax.print.event; + + +/** + * Listener interface to receive processing events from a print job. + * Implementations of this interface can be registered with a + * {@link javax.print.DocPrintJob} instance. + * + * @see javax.print.event.PrintJobAdapter + * + * @author Michael Koch (konqueror@gmx.de) + */ +public interface PrintJobListener +{ + /** + * Notifies the listener that all data has been successfully transferred + * to the print service. + * + * @param event the event + */ + void printDataTransferCompleted(PrintJobEvent event); + + /** + * Notifies the listener that a print job got canceled. + * + * @param event the event + */ + void printJobCanceled(PrintJobEvent event); + + /** + * Notifies the listener that a print job has completed. + * + * @param event the event + */ + void printJobCompleted(PrintJobEvent event); + + /** + * Notifies the listener that a print job has failed to complete. + * + * @param event the event. + */ + void printJobFailed(PrintJobEvent event); + + /** + * Notifies the listener that no more events will be delivered. + * + * @param event the event + */ + void printJobNoMoreEvents(PrintJobEvent event); + + /** + * Notifies the listener that a problem occured during printing. + * This event signals problems a user might be able to fix + * (e.g. out of paper or paper jam). + * + * @param event the event + */ + void printJobRequiresAttention(PrintJobEvent event); +} diff --git a/libjava/classpath/javax/print/event/PrintServiceAttributeEvent.java b/libjava/classpath/javax/print/event/PrintServiceAttributeEvent.java new file mode 100644 index 000000000..665db52bf --- /dev/null +++ b/libjava/classpath/javax/print/event/PrintServiceAttributeEvent.java @@ -0,0 +1,87 @@ +/* PrintServiceAttributeEvent.java -- + Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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 javax.print.event; + +import javax.print.PrintService; +import javax.print.attribute.PrintServiceAttributeSet; + + +/** + * PrintServiceAttributeEvents are generated by a + * PrintService to inform registered listeners that + * its associated attributes have changed. + * + * @author Michael Koch (konqueror@gmx.de) + */ +public class PrintServiceAttributeEvent extends PrintEvent +{ + private PrintServiceAttributeSet attributes; + + /** + * Constructs a PrintServiceAttributeEvent object. + * + * @param source the source of this event + * @param attributes the attribute changes being reported + */ + public PrintServiceAttributeEvent(PrintService source, + PrintServiceAttributeSet attributes) + { + super(source); + this.attributes = attributes; + } + + /** + * Returns the print service that generated this event. + * + * @return The print service. + */ + public PrintService getPrintService() + { + return (PrintService) getSource(); + } + + /** + * Returns the changed attributes this event reports. + * + * @return The changed attributes. + */ + public PrintServiceAttributeSet getAttributes() + { + return attributes; + } +} diff --git a/libjava/classpath/javax/print/event/PrintServiceAttributeListener.java b/libjava/classpath/javax/print/event/PrintServiceAttributeListener.java new file mode 100644 index 000000000..596d1675e --- /dev/null +++ b/libjava/classpath/javax/print/event/PrintServiceAttributeListener.java @@ -0,0 +1,56 @@ +/* PrintServiceAttributeListener.java -- + Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 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 javax.print.event; + + +/** + * Listener interface to receive attribute changes from a print service. + * Implementations of this interface can be registered with a + * {@link javax.print.PrintService} instance. + * + * @author Michael Koch (konqueror@gmx.de) + */ +public interface PrintServiceAttributeListener +{ + /** + * Notifies the listener that some attributes have changed. + * + * @param event the event + */ + void attributeUpdate(PrintServiceAttributeEvent event); +} diff --git a/libjava/classpath/javax/print/event/package.html b/libjava/classpath/javax/print/event/package.html new file mode 100644 index 000000000..5091a716f --- /dev/null +++ b/libjava/classpath/javax/print/event/package.html @@ -0,0 +1,56 @@ + + + + +GNU Classpath - javax.print.event + + +Provides events and listeners to be used with the Java Print Service API. +

+The provided listeners are used to register with print services and/or +print jobs to receive state information or to monitor the progress of +print jobs. Print jobs don't need to be implemented synchronous and +therefore should be monitored to know if they succeed or fail. For this +common task the PrintJobAdapter class +is provided. +

+

+Since: 1.4 +

+ + -- cgit v1.2.3