Index: javax/print/event/PrintEvent.java =================================================================== RCS file: javax/print/event/PrintEvent.java diff -N javax/print/event/PrintEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ javax/print/event/PrintEvent.java 26 Apr 2004 21:30:25 -0000 @@ -0,0 +1,67 @@ +/* PrintEvent.java -- + Copyright (C) 2004 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 javax.print.event; + +import java.util.EventObject; + + +/** + * @author Michael Koch (address@hidden) + */ +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(); + } +} Index: javax/print/event/PrintJobAdapter.java =================================================================== RCS file: javax/print/event/PrintJobAdapter.java diff -N javax/print/event/PrintJobAdapter.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ javax/print/event/PrintJobAdapter.java 26 Apr 2004 21:30:25 -0000 @@ -0,0 +1,117 @@ +/* PrintJobAdapter.java -- + Copyright (C) 2004 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 javax.print.event; + + +/** + * @author Michael Koch (address@hidden) + */ +public abstract class PrintJobAdapter + implements PrintJobListener +{ + /** + * Constructs a PrintJobAdapter object. + */ + public PrintJobAdapter() + { + // Do nothing here. + } + + /** + * Called to notify the client that all data has bin successfully transferred + * to the print service. + * + *

The default implementation does nothing

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

The default implementation does nothing

+ */ + 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

+ */ + 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

+ */ + 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

+ */ + public void printJobNoMoreEvents(PrintJobEvent event) + { + // Do nothing here. + } + + /** + * Called to notify the client that a problem occured during printing + * but the user may be able to fix it. + * + *

The default implementation does nothing

+ */ + public void printJobRequiresAttention(PrintJobEvent event) + { + // Do nothing here. + } +} Index: javax/print/event/PrintJobAttributeEvent.java =================================================================== RCS file: javax/print/event/PrintJobAttributeEvent.java diff -N javax/print/event/PrintJobAttributeEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ javax/print/event/PrintJobAttributeEvent.java 26 Apr 2004 21:30:25 -0000 @@ -0,0 +1,85 @@ +/* PrintJobAttributeEvent.java -- + Copyright (C) 2004 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 javax.print.event; + +import javax.print.DocPrintJob; +import javax.print.attribute.PrintJobAttributeSet; + + +/** + * @author Michael Koch (address@hidden) + */ +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 changes attributes + */ + public PrintJobAttributeSet getAttributes() + { + return attributes; + } +} Index: javax/print/event/PrintJobAttributeListener.java =================================================================== RCS file: javax/print/event/PrintJobAttributeListener.java diff -N javax/print/event/PrintJobAttributeListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ javax/print/event/PrintJobAttributeListener.java 26 Apr 2004 21:30:25 -0000 @@ -0,0 +1,52 @@ +/* PrintJobAttributeListener.java -- + Copyright (C) 2004 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 javax.print.event; + + +/** + * @author Michael Koch (address@hidden) + */ +public interface PrintJobAttributeListener +{ + /** + * Notifies the listener of an attribute change. + * + * @param event the event + */ + void attributeUpdate(PrintJobAttributeEvent event); +} Index: javax/print/event/PrintJobEvent.java =================================================================== RCS file: javax/print/event/PrintJobEvent.java diff -N javax/print/event/PrintJobEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ javax/print/event/PrintJobEvent.java 26 Apr 2004 21:30:25 -0000 @@ -0,0 +1,90 @@ +/* PrintEvent.java -- + Copyright (C) 2004 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 javax.print.event; + +import javax.print.DocPrintJob; + + +/** + * @author Michael Koch (address@hidden) + */ +public class PrintJobEvent extends PrintEvent +{ + private static final long serialVersionUID = -1711656903622072997L; + + public static final int DATA_TRANSFER_COMPLETE = 106; + public static final int JOB_CANCELED = 101; + public static final int JOB_COMPLETE = 102; + public static final int JOB_FAILED = 103; + public static final int NO_MORE_EVENTS = 105; + public static final int REQUIRES_ATTENTION = 104; + + 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(); + } +} Index: javax/print/event/PrintJobListener.java =================================================================== RCS file: javax/print/event/PrintJobListener.java diff -N javax/print/event/PrintJobListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ javax/print/event/PrintJobListener.java 26 Apr 2004 21:30:25 -0000 @@ -0,0 +1,87 @@ +/* PrintJobListener.java -- + Copyright (C) 2004 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 javax.print.event; + + +/** + * @author Michael Koch (address@hidden) */ +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 an error occured and the user might be able to fix it. + * + * @param event the event + */ + void printJobRequiresAttention(PrintJobEvent event); +} Index: javax/print/event/PrintServiceAttributeEvent.java =================================================================== RCS file: javax/print/event/PrintServiceAttributeEvent.java diff -N javax/print/event/PrintServiceAttributeEvent.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ javax/print/event/PrintServiceAttributeEvent.java 26 Apr 2004 21:30:25 -0000 @@ -0,0 +1,83 @@ +/* PrintServiceAttributeEvent.java -- + Copyright (C) 2004 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 javax.print.event; + +import javax.print.PrintService; +import javax.print.attribute.PrintServiceAttributeSet; + + +/** + * @author Michael Koch (address@hidden) + */ +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; + } +} Index: javax/print/event/PrintServiceAttributeListener.java =================================================================== RCS file: javax/print/event/PrintServiceAttributeListener.java diff -N javax/print/event/PrintServiceAttributeListener.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ javax/print/event/PrintServiceAttributeListener.java 26 Apr 2004 21:30:25 -0000 @@ -0,0 +1,52 @@ +/* PrintServiceAttributeListener.java -- + Copyright (C) 2004 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 javax.print.event; + + +/** + * @author Michael Koch (address@hidden) + */ +public interface PrintServiceAttributeListener +{ + /** + * Notifies the listener that some attributes have changed. + * + * @param event the event + */ + void attributeUpdate(PrintServiceAttributeEvent event); +} Index: javax/print/event/Makefile.am =================================================================== RCS file: javax/print/event/Makefile.am diff -N javax/print/event/Makefile.am --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ javax/print/event/Makefile.am 26 Apr 2004 21:30:25 -0000 @@ -0,0 +1,12 @@ +## Input file for automake to generate the Makefile.in used by configure + +EXTRA_DIST = \ +PrintEvent.java \ +PrintJobAdapter.java \ +PrintJobAttributeEvent.java \ +PrintJobAttributeListener.java \ +PrintJobEvent.java \ +PrintJobListener.java \ +PrintServiceAttributeEvent.java \ +PrintServiceAttributeListener.java + Index: configure.ac =================================================================== RCS file: /cvsroot/classpath/classpath/configure.ac,v retrieving revision 1.21 diff -u -r1.21 configure.ac --- configure.ac 23 Apr 2004 22:06:23 -0000 1.21 +++ configure.ac 26 Apr 2004 21:30:25 -0000 @@ -59,7 +59,7 @@ dnl GTK native peer (enabled by default) dnl ----------------------------------------------------------- AC_ARG_ENABLE([gtk-peer], - [AS_HELP_STRING(--enable-gtk-peer,compile GTK native peers [default=yes])], + [AS_HELP_STRING(--enable-gtk-peer,compile GTK native peers,disabled by --disable-jni [default=yes])], [case "${enableval}" in yes) COMPILE_GTK_PEER=yes ;; no) COMPILE_GTK_PEER=no ;; @@ -395,6 +395,7 @@ javax/naming/spi/Makefile javax/print/Makefile javax/print/attribute/Makefile +javax/print/event/Makefile javax/rmi/Makefile javax/rmi/CORBA/Makefile javax/security/Makefile Index: javax/print/Makefile.am =================================================================== RCS file: /cvsroot/classpath/classpath/javax/print/Makefile.am,v retrieving revision 1.2 diff -u -r1.2 Makefile.am --- javax/print/Makefile.am 26 Apr 2004 21:08:22 -0000 1.2 +++ javax/print/Makefile.am 26 Apr 2004 21:30:25 -0000 @@ -1,8 +1,8 @@ ## Input file for automake to generate the Makefile.in used by configure -SUBDIRS = attribute +SUBDIRS = attribute event -EXTRA_DIST = +EXTRA_DIST = \ CancelablePrintJob.java \ Doc.java \ DocFlavor.java \