String.java, [...]: Merge from GNU Classpath HEAD.
2006-06-09 Thomas Fitzsimmons <fitzsim@redhat.com> * java/lang/String.java, classpath/native/jni/classpath/jcl.h, classpath/native/jni/qt-peer/eventmethods.h, classpath/native/jni/qt-peer/qtmenupeer.cpp, classpath/native/jni/qt-peer/.cvsignore, classpath/native/jni/gtk-peer/gdkdisplay.h, classpath/native/jni/gtk-peer/cairographics2d.h, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphicsCopy.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c, classpath/native/jni/gtk-peer/.cvsignore, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c, classpath/native/jni/gtk-peer/gtkpeer.h, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c, classpath/native/jni/gtk-peer/Makefile.am, classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, classpath/native/jawt/Makefile.am, classpath/native/jawt/.cvsignore, classpath/native/target/Linux/Makefile.in, classpath/native/plugin/gcjwebplugin.cc, classpath/native/plugin/Makefile.am, classpath/native/plugin/.cvsignore, classpath/resource/Makefile.in, classpath/gnu/java/awt/peer/gtk/VolatileImageGraphics.java, classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java, classpath/gnu/java/awt/peer/gtk/CairoSurface.java, classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java, classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java, classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java, classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java, classpath/gnu/java/awt/peer/gtk/GdkGraphics2D.java, classpath/gnu/java/awt/peer/gtk/ComponentGraphicsCopy.java, classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java, classpath/gnu/java/awt/peer/gtk/GdkGraphics.java, classpath/gnu/java/awt/peer/gtk/GtkToolkit.java, classpath/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java, classpath/gnu/java/awt/peer/gtk/BufferedImageGraphics.java, classpath/gnu/java/awt/peer/gtk/GdkTextLayout.java, classpath/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java, classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java, classpath/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java, classpath/gnu/java/awt/peer/gtk/GtkImage.java, classpath/gnu/java/awt/peer/gtk/GtkVolatileImage.java, classpath/gnu/java/awt/peer/gtk/GdkGlyphVector.java, classpath/gnu/java/awt/peer/gtk/GtkCanvasPeer.java, classpath/gnu/java/awt/peer/swing/SwingContainerPeer.java, classpath/gnu/java/awt/peer/swing/SwingComponent.java, classpath/gnu/java/awt/peer/swing/SwingTextFieldPeer.java, classpath/gnu/java/awt/peer/swing/SwingMenuBarPeer.java, classpath/gnu/java/awt/peer/swing/SwingFramePeer.java, classpath/gnu/java/awt/peer/swing/SwingComponentPeer.java, classpath/gnu/java/awt/peer/swing/SwingWindowPeer.java, classpath/gnu/java/awt/print/JavaPrinterJob.java, classpath/gnu/java/awt/print/PostScriptGraphics2D.java, classpath/gnu/java/awt/print/SpooledDocument.java, classpath/gnu/java/awt/print/JavaPrinterGraphics.java, classpath/gnu/java/awt/BitwiseXORComposite.java, classpath/gnu/java/awt/font/GNUGlyphVector.java, classpath/gnu/java/awt/font/opentype/NameDecoder.java, classpath/gnu/java/awt/java2d/RasterGraphics.java, classpath/gnu/java/awt/java2d/TexturePaintContext.java, classpath/gnu/java/awt/java2d/PolyEdge.java, classpath/gnu/java/awt/java2d/AbstractGraphics2D.java, classpath/gnu/java/awt/java2d/AlphaCompositeContext.java, classpath/gnu/java/awt/java2d/ImagePaint.java, classpath/gnu/java/awt/Buffers.java, classpath/gnu/classpath/Configuration.java.in, classpath/gnu/javax/swing/text/html/CombinedAttributes.java, classpath/gnu/javax/swing/text/html/CharacterAttributeTranslator.java, classpath/gnu/javax/swing/text/html/parser/htmlAttributeSet.java, classpath/gnu/javax/swing/text/html/parser/SmallHtmlAttributeSet.java, classpath/gnu/javax/swing/text/html/ImageViewIconFactory.java, classpath/tools/toolwrapper.c, classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java, classpath/tools/gnu/classpath/tools/native2ascii/Messages.java, classpath/tools/gnu/classpath/tools/getopt/FileArgumentCallback.java, classpath/tools/gnu/classpath/tools/getopt/OptionGroup.java, classpath/tools/gnu/classpath/tools/getopt/OptionException.java, classpath/tools/gnu/classpath/tools/getopt/Messages.java, classpath/tools/gnu/classpath/tools/getopt/Option.java, classpath/tools/gnu/classpath/tools/getopt/Parser.java, classpath/tools/gnu/classpath/tools/getopt/ClasspathToolParser.java, classpath/tools/gnu/classpath/tools/jarsigner/JarSigner.java, classpath/tools/gnu/classpath/tools/jarsigner/Main.java, classpath/tools/gnu/classpath/tools/jarsigner/Messages.java, classpath/tools/gnu/classpath/tools/jarsigner/package.html, classpath/tools/gnu/classpath/tools/keytool/ListCmd.java, classpath/tools/gnu/classpath/tools/keytool/StorePasswdCmd.java, classpath/tools/gnu/classpath/tools/keytool/ExportCmd.java, classpath/tools/gnu/classpath/tools/keytool/GenKeyCmd.java, classpath/tools/gnu/classpath/tools/keytool/Messages.java, classpath/tools/gnu/classpath/tools/keytool/package.html, classpath/tools/gnu/classpath/tools/keytool/Command.java, classpath/tools/gnu/classpath/tools/keytool/IdentityDBCmd.java, classpath/tools/gnu/classpath/tools/keytool/Main.java, classpath/tools/gnu/classpath/tools/keytool/DeleteCmd.java, classpath/tools/gnu/classpath/tools/keytool/CertReqCmd.java, classpath/tools/gnu/classpath/tools/keytool/SelfCertCmd.java, classpath/tools/gnu/classpath/tools/keytool/KeyCloneCmd.java, classpath/tools/gnu/classpath/tools/keytool/KeyPasswdCmd.java, classpath/tools/gnu/classpath/tools/keytool/ImportCmd.java, classpath/tools/gnu/classpath/tools/keytool/PrintCertCmd.java, classpath/tools/gnu/classpath/tools/rmi/registry/package.html, classpath/tools/gnu/classpath/tools/rmi/RMIC.txt, classpath/tools/gnu/classpath/tools/rmi/RMIC.java, classpath/tools/gnu/classpath/tools/appletviewer/ErrorApplet.java, classpath/tools/gnu/classpath/tools/appletviewer/AppletClassLoader.java, classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletContext.java, classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java, classpath/tools/gnu/classpath/tools/appletviewer/AppletSecurityManager.java, classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java, classpath/tools/gnu/classpath/tools/appletviewer/AppletWarning.java, classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java, classpath/tools/gnu/classpath/tools/appletviewer/AppletTag.java, classpath/tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java, classpath/tools/gnu/classpath/tools/appletviewer/Main.java, classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java, classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java, classpath/tools/gnu/classpath/tools/appletviewer/TagParser.java, classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java, classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java, classpath/tools/gnu/classpath/tools/serialver/Messages.java, classpath/tools/gnu/classpath/tools/serialver/SerialVer.java, classpath/tools/gnu/classpath/tools/jar/Creator.java, classpath/tools/gnu/classpath/tools/jar/Entry.java, classpath/tools/gnu/classpath/tools/jar/Lister.java, classpath/tools/gnu/classpath/tools/jar/Main.java, classpath/tools/gnu/classpath/tools/jar/Updater.java, classpath/tools/gnu/classpath/tools/jar/Messages.java, classpath/tools/gnu/classpath/tools/jar/Extractor.java, classpath/tools/gnu/classpath/tools/jar/Action.java, classpath/tools/gnu/classpath/tools/jar/Indexer.java, classpath/tools/gnu/classpath/tools/jar/WorkSet.java, classpath/tools/gnu/classpath/tools/giop/GRMIC.txt, classpath/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java, classpath/tools/gnu/classpath/tools/giop/GRMIC.java, classpath/tools/Makefile.am, classpath/tools/jarsigner.in, classpath/tools/keytool.in, classpath/tools/appletviewer.in, classpath/tools/.cvsignore, classpath/configure.ac, classpath/javax/swing/JTabbedPane.java, classpath/javax/swing/AbstractButton.java, classpath/javax/swing/JViewport.java, classpath/javax/swing/KeyboardManager.java, classpath/javax/swing/JMenuItem.java, classpath/javax/swing/JMenuBar.java, classpath/javax/swing/MenuSelectionManager.java, classpath/javax/swing/JOptionPane.java, classpath/javax/swing/JSpinner.java, classpath/javax/swing/JCheckBoxMenuItem.java, classpath/javax/swing/JEditorPane.java, classpath/javax/swing/JFormattedTextField.java, classpath/javax/swing/JTree.java, classpath/javax/swing/CellRendererPane.java, classpath/javax/swing/JScrollPane.java, classpath/javax/swing/tree/VariableHeightLayoutCache.java, classpath/javax/swing/tree/TreeNode.java, classpath/javax/swing/tree/FixedHeightLayoutCache.java, classpath/javax/swing/tree/DefaultTreeCellEditor.java, classpath/javax/swing/tree/TreePath.java, classpath/javax/swing/tree/RowMapper.java, classpath/javax/swing/tree/DefaultMutableTreeNode.java, classpath/javax/swing/tree/DefaultTreeModel.java, classpath/javax/swing/tree/AbstractLayoutCache.java, classpath/javax/swing/tree/TreeSelectionModel.java, classpath/javax/swing/tree/DefaultTreeSelectionModel.java, classpath/javax/swing/tree/DefaultTreeCellRenderer.java, classpath/javax/swing/tree/ExpandVetoException.java, classpath/javax/swing/JList.java, classpath/javax/swing/table/JTableHeader.java, classpath/javax/swing/table/AbstractTableModel.java, classpath/javax/swing/table/DefaultTableModel.java, classpath/javax/swing/table/TableCellEditor.java, classpath/javax/swing/table/TableCellRenderer.java, classpath/javax/swing/ProgressMonitor.java, classpath/javax/swing/JToolBar.java, classpath/javax/swing/TransferHandler.java, classpath/javax/swing/DefaultCellEditor.java, classpath/javax/swing/DefaultButtonModel.java, classpath/javax/swing/JLayeredPane.java, classpath/javax/swing/text/DefaultEditorKit.java, classpath/javax/swing/text/DefaultCaret.java, classpath/javax/swing/text/FieldView.java, classpath/javax/swing/text/JTextComponent.java, classpath/javax/swing/text/TextAction.java, classpath/javax/swing/text/StyleContext.java, classpath/javax/swing/text/html/HTMLDocument.java, classpath/javax/swing/text/html/MinimalHTMLWriter.java, classpath/javax/swing/text/html/ImageView.java, classpath/javax/swing/text/html/HTMLEditorKit.java, classpath/javax/swing/text/AbstractWriter.java, classpath/javax/swing/text/GapContent.java, classpath/javax/swing/text/Utilities.java, classpath/javax/swing/text/PlainView.java, classpath/javax/swing/UIManager.java, classpath/javax/swing/JSplitPane.java, classpath/javax/swing/JComponent.java, classpath/javax/swing/SwingUtilities.java, classpath/javax/swing/border/AbstractBorder.java, classpath/javax/swing/border/CompoundBorder.java, classpath/javax/swing/border/TitledBorder.java, classpath/javax/swing/border/MatteBorder.java, classpath/javax/swing/border/BevelBorder.java, classpath/javax/swing/RepaintManager.java, classpath/javax/swing/JTable.java, classpath/javax/swing/UIDefaults.java, classpath/javax/swing/DefaultDesktopManager.java, classpath/javax/swing/JMenu.java, classpath/javax/swing/JLabel.java, classpath/javax/swing/JSlider.java, classpath/javax/swing/plaf/basic/BasicToolBarUI.java, classpath/javax/swing/plaf/basic/BasicButtonUI.java, classpath/javax/swing/plaf/basic/BasicOptionPaneUI.java, classpath/javax/swing/plaf/basic/BasicTextAreaUI.java, classpath/javax/swing/plaf/basic/BasicToggleButtonUI.java, classpath/javax/swing/plaf/basic/BasicSpinnerUI.java, classpath/javax/swing/plaf/basic/BasicSliderUI.java, classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java, classpath/javax/swing/plaf/basic/BasicComboPopup.java, classpath/javax/swing/plaf/basic/BasicCheckBoxUI.java, classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java, classpath/javax/swing/plaf/basic/BasicProgressBarUI.java, classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java, classpath/javax/swing/plaf/basic/BasicPanelUI.java, classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java, classpath/javax/swing/plaf/basic/BasicTreeUI.java, classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java, classpath/javax/swing/plaf/basic/BasicFileChooserUI.java, classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java, classpath/javax/swing/plaf/basic/BasicComboBoxUI.java, classpath/javax/swing/plaf/basic/BasicListUI.java, classpath/javax/swing/plaf/basic/BasicIconFactory.java, classpath/javax/swing/plaf/basic/BasicTextUI.java, classpath/javax/swing/plaf/basic/BasicLookAndFeel.java, classpath/javax/swing/plaf/basic/BasicDirectoryModel.java, classpath/javax/swing/plaf/basic/BasicRootPaneUI.java, classpath/javax/swing/plaf/basic/BasicTableUI.java, classpath/javax/swing/plaf/basic/SharedUIDefaults.java, classpath/javax/swing/plaf/multi/MultiComboBoxUI.java, classpath/javax/swing/plaf/multi/MultiListUI.java, classpath/javax/swing/plaf/multi/MultiSplitPaneUI.java, classpath/javax/swing/plaf/multi/MultiFileChooserUI.java, classpath/javax/swing/plaf/multi/MultiOptionPaneUI.java, classpath/javax/swing/plaf/multi/MultiTabbedPaneUI.java, classpath/javax/swing/plaf/multi/MultiLookAndFeel.java, classpath/javax/swing/plaf/metal/MetalSliderUI.java, classpath/javax/swing/plaf/metal/MetalIconFactory.java, classpath/javax/swing/plaf/metal/MetalComboBoxIcon.java, classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java, classpath/javax/swing/plaf/metal/MetalLookAndFeel.java, classpath/javax/swing/plaf/metal/MetalCheckBoxUI.java, classpath/javax/swing/plaf/metal/MetalSeparatorUI.java, classpath/javax/swing/plaf/metal/MetalBorders.java, classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java, classpath/javax/swing/plaf/metal/MetalScrollBarUI.java, classpath/javax/swing/plaf/metal/MetalRootPaneUI.java, classpath/javax/swing/plaf/metal/MetalInternalFrameUI.java, classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java, classpath/javax/swing/plaf/metal/MetalToolTipUI.java, classpath/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java, classpath/javax/swing/plaf/metal/MetalFileChooserUI.java, classpath/javax/swing/plaf/metal/MetalUtils.java, classpath/javax/swing/plaf/metal/MetalComboBoxButton.java, classpath/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java, classpath/javax/swing/plaf/metal/MetalButtonUI.java, classpath/javax/swing/JPopupMenu.java, classpath/javax/swing/JProgressBar.java, classpath/javax/swing/WindowConstants.java, classpath/javax/swing/JFrame.java, classpath/javax/swing/JFileChooser.java, classpath/javax/swing/JComboBox.java, classpath/javax/swing/event/EventListenerList.java, classpath/javax/swing/ListSelectionModel.java, classpath/javax/swing/JScrollBar.java, classpath/java/text/SimpleDateFormat.java, classpath/java/text/NumberFormat.java, classpath/java/text/class-dependencies.conf, classpath/java/awt/image/ColorModel.java, classpath/java/awt/image/BufferedImage.java, classpath/java/awt/Window.java, classpath/java/awt/ContainerOrderFocusTraversalPolicy.java, classpath/java/awt/LightweightDispatcher.java, classpath/java/awt/EventDispatchThread.java, classpath/java/awt/BasicStroke.java, classpath/java/awt/ColorPaintContext.java, classpath/java/awt/Container.java, classpath/java/awt/TexturePaint.java, classpath/java/awt/Component.java, classpath/java/awt/Font.java, classpath/java/awt/GraphicsConfiguration.java, classpath/java/awt/DefaultKeyboardFocusManager.java, classpath/java/awt/print/PrinterJob.java, classpath/java/awt/im/InputContext.java, classpath/java/awt/dnd/DragGestureRecognizer.java, classpath/java/awt/Toolkit.java, classpath/java/awt/font/GraphicAttribute.java, classpath/java/awt/font/ImageGraphicAttribute.java, classpath/java/awt/font/GlyphVector.java, classpath/java/awt/font/GlyphMetrics.java, classpath/java/awt/font/ShapeGraphicAttribute.java, classpath/java/awt/Graphics2D.java, classpath/include/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h, classpath/include/gnu_java_awt_peer_gtk_ComponentGraphics.h, classpath/include/gnu_java_awt_peer_gtk_CairoGraphics2D.h, classpath/include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h, classpath/include/gnu_java_awt_peer_gtk_GtkCanvasPeer.h, classpath/include/config.h.in, classpath/include/gnu_java_awt_peer_gtk_GdkTextLayout.h, classpath/include/gnu_java_awt_peer_gtk_GtkComponentPeer.h, classpath/include/gnu_java_awt_peer_gtk_GdkFontPeer.h, classpath/include/gnu_java_awt_peer_gtk_ComponentGraphicsCopy.h, classpath/include/gnu_java_awt_peer_gtk_GtkVolatileImage.h, classpath/include/gnu_java_awt_peer_gtk_GtkImage.h, classpath/include/gnu_java_awt_peer_gtk_CairoSurface.h, classpath/include/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.h: Merge from GNU Classpath HEAD. From-SVN: r114510
This commit is contained in:
parent
6c65d7577c
commit
02440ca432
|
@ -1,3 +1,329 @@
|
|||
2006-06-09 Thomas Fitzsimmons <fitzsim@redhat.com>
|
||||
|
||||
* java/lang/String.java, classpath/native/jni/classpath/jcl.h,
|
||||
classpath/native/jni/qt-peer/eventmethods.h,
|
||||
classpath/native/jni/qt-peer/qtmenupeer.cpp,
|
||||
classpath/native/jni/qt-peer/.cvsignore,
|
||||
classpath/native/jni/gtk-peer/gdkdisplay.h,
|
||||
classpath/native/jni/gtk-peer/cairographics2d.h,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphicsCopy.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c,
|
||||
classpath/native/jni/gtk-peer/.cvsignore,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c,
|
||||
classpath/native/jni/gtk-peer/gtkpeer.h,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c,
|
||||
classpath/native/jni/gtk-peer/Makefile.am,
|
||||
classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c,
|
||||
classpath/native/jawt/Makefile.am,
|
||||
classpath/native/jawt/.cvsignore,
|
||||
classpath/native/target/Linux/Makefile.in,
|
||||
classpath/native/plugin/gcjwebplugin.cc,
|
||||
classpath/native/plugin/Makefile.am,
|
||||
classpath/native/plugin/.cvsignore,
|
||||
classpath/resource/Makefile.in,
|
||||
classpath/gnu/java/awt/peer/gtk/VolatileImageGraphics.java,
|
||||
classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java,
|
||||
classpath/gnu/java/awt/peer/gtk/CairoSurface.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java,
|
||||
classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GdkGraphics2D.java,
|
||||
classpath/gnu/java/awt/peer/gtk/ComponentGraphicsCopy.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GdkGraphics.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GtkToolkit.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java,
|
||||
classpath/gnu/java/awt/peer/gtk/BufferedImageGraphics.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GdkTextLayout.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java,
|
||||
classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java,
|
||||
classpath/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GtkImage.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GtkVolatileImage.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GdkGlyphVector.java,
|
||||
classpath/gnu/java/awt/peer/gtk/GtkCanvasPeer.java,
|
||||
classpath/gnu/java/awt/peer/swing/SwingContainerPeer.java,
|
||||
classpath/gnu/java/awt/peer/swing/SwingComponent.java,
|
||||
classpath/gnu/java/awt/peer/swing/SwingTextFieldPeer.java,
|
||||
classpath/gnu/java/awt/peer/swing/SwingMenuBarPeer.java,
|
||||
classpath/gnu/java/awt/peer/swing/SwingFramePeer.java,
|
||||
classpath/gnu/java/awt/peer/swing/SwingComponentPeer.java,
|
||||
classpath/gnu/java/awt/peer/swing/SwingWindowPeer.java,
|
||||
classpath/gnu/java/awt/print/JavaPrinterJob.java,
|
||||
classpath/gnu/java/awt/print/PostScriptGraphics2D.java,
|
||||
classpath/gnu/java/awt/print/SpooledDocument.java,
|
||||
classpath/gnu/java/awt/print/JavaPrinterGraphics.java,
|
||||
classpath/gnu/java/awt/BitwiseXORComposite.java,
|
||||
classpath/gnu/java/awt/font/GNUGlyphVector.java,
|
||||
classpath/gnu/java/awt/font/opentype/NameDecoder.java,
|
||||
classpath/gnu/java/awt/java2d/RasterGraphics.java,
|
||||
classpath/gnu/java/awt/java2d/TexturePaintContext.java,
|
||||
classpath/gnu/java/awt/java2d/PolyEdge.java,
|
||||
classpath/gnu/java/awt/java2d/AbstractGraphics2D.java,
|
||||
classpath/gnu/java/awt/java2d/AlphaCompositeContext.java,
|
||||
classpath/gnu/java/awt/java2d/ImagePaint.java,
|
||||
classpath/gnu/java/awt/Buffers.java,
|
||||
classpath/gnu/classpath/Configuration.java.in,
|
||||
classpath/gnu/javax/swing/text/html/CombinedAttributes.java,
|
||||
classpath/gnu/javax/swing/text/html/CharacterAttributeTranslator.java,
|
||||
classpath/gnu/javax/swing/text/html/parser/htmlAttributeSet.java,
|
||||
classpath/gnu/javax/swing/text/html/parser/SmallHtmlAttributeSet.java,
|
||||
classpath/gnu/javax/swing/text/html/ImageViewIconFactory.java,
|
||||
classpath/tools/toolwrapper.c,
|
||||
classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java,
|
||||
classpath/tools/gnu/classpath/tools/native2ascii/Messages.java,
|
||||
classpath/tools/gnu/classpath/tools/getopt/FileArgumentCallback.java,
|
||||
classpath/tools/gnu/classpath/tools/getopt/OptionGroup.java,
|
||||
classpath/tools/gnu/classpath/tools/getopt/OptionException.java,
|
||||
classpath/tools/gnu/classpath/tools/getopt/Messages.java,
|
||||
classpath/tools/gnu/classpath/tools/getopt/Option.java,
|
||||
classpath/tools/gnu/classpath/tools/getopt/Parser.java,
|
||||
classpath/tools/gnu/classpath/tools/getopt/ClasspathToolParser.java,
|
||||
classpath/tools/gnu/classpath/tools/jarsigner/JarSigner.java,
|
||||
classpath/tools/gnu/classpath/tools/jarsigner/Main.java,
|
||||
classpath/tools/gnu/classpath/tools/jarsigner/Messages.java,
|
||||
classpath/tools/gnu/classpath/tools/jarsigner/package.html,
|
||||
classpath/tools/gnu/classpath/tools/keytool/ListCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/StorePasswdCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/ExportCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/GenKeyCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/Messages.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/package.html,
|
||||
classpath/tools/gnu/classpath/tools/keytool/Command.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/IdentityDBCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/Main.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/DeleteCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/CertReqCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/SelfCertCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/KeyCloneCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/KeyPasswdCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/ImportCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/keytool/PrintCertCmd.java,
|
||||
classpath/tools/gnu/classpath/tools/rmi/registry/package.html,
|
||||
classpath/tools/gnu/classpath/tools/rmi/RMIC.txt,
|
||||
classpath/tools/gnu/classpath/tools/rmi/RMIC.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/ErrorApplet.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/AppletClassLoader.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletContext.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/AppletSecurityManager.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/AppletWarning.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/AppletTag.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/Main.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/TagParser.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java,
|
||||
classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java,
|
||||
classpath/tools/gnu/classpath/tools/serialver/Messages.java,
|
||||
classpath/tools/gnu/classpath/tools/serialver/SerialVer.java,
|
||||
classpath/tools/gnu/classpath/tools/jar/Creator.java,
|
||||
classpath/tools/gnu/classpath/tools/jar/Entry.java,
|
||||
classpath/tools/gnu/classpath/tools/jar/Lister.java,
|
||||
classpath/tools/gnu/classpath/tools/jar/Main.java,
|
||||
classpath/tools/gnu/classpath/tools/jar/Updater.java,
|
||||
classpath/tools/gnu/classpath/tools/jar/Messages.java,
|
||||
classpath/tools/gnu/classpath/tools/jar/Extractor.java,
|
||||
classpath/tools/gnu/classpath/tools/jar/Action.java,
|
||||
classpath/tools/gnu/classpath/tools/jar/Indexer.java,
|
||||
classpath/tools/gnu/classpath/tools/jar/WorkSet.java,
|
||||
classpath/tools/gnu/classpath/tools/giop/GRMIC.txt,
|
||||
classpath/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java,
|
||||
classpath/tools/gnu/classpath/tools/giop/GRMIC.java,
|
||||
classpath/tools/Makefile.am, classpath/tools/jarsigner.in,
|
||||
classpath/tools/keytool.in, classpath/tools/appletviewer.in,
|
||||
classpath/tools/.cvsignore, classpath/configure.ac,
|
||||
classpath/javax/swing/JTabbedPane.java,
|
||||
classpath/javax/swing/AbstractButton.java,
|
||||
classpath/javax/swing/JViewport.java,
|
||||
classpath/javax/swing/KeyboardManager.java,
|
||||
classpath/javax/swing/JMenuItem.java,
|
||||
classpath/javax/swing/JMenuBar.java,
|
||||
classpath/javax/swing/MenuSelectionManager.java,
|
||||
classpath/javax/swing/JOptionPane.java,
|
||||
classpath/javax/swing/JSpinner.java,
|
||||
classpath/javax/swing/JCheckBoxMenuItem.java,
|
||||
classpath/javax/swing/JEditorPane.java,
|
||||
classpath/javax/swing/JFormattedTextField.java,
|
||||
classpath/javax/swing/JTree.java,
|
||||
classpath/javax/swing/CellRendererPane.java,
|
||||
classpath/javax/swing/JScrollPane.java,
|
||||
classpath/javax/swing/tree/VariableHeightLayoutCache.java,
|
||||
classpath/javax/swing/tree/TreeNode.java,
|
||||
classpath/javax/swing/tree/FixedHeightLayoutCache.java,
|
||||
classpath/javax/swing/tree/DefaultTreeCellEditor.java,
|
||||
classpath/javax/swing/tree/TreePath.java,
|
||||
classpath/javax/swing/tree/RowMapper.java,
|
||||
classpath/javax/swing/tree/DefaultMutableTreeNode.java,
|
||||
classpath/javax/swing/tree/DefaultTreeModel.java,
|
||||
classpath/javax/swing/tree/AbstractLayoutCache.java,
|
||||
classpath/javax/swing/tree/TreeSelectionModel.java,
|
||||
classpath/javax/swing/tree/DefaultTreeSelectionModel.java,
|
||||
classpath/javax/swing/tree/DefaultTreeCellRenderer.java,
|
||||
classpath/javax/swing/tree/ExpandVetoException.java,
|
||||
classpath/javax/swing/JList.java,
|
||||
classpath/javax/swing/table/JTableHeader.java,
|
||||
classpath/javax/swing/table/AbstractTableModel.java,
|
||||
classpath/javax/swing/table/DefaultTableModel.java,
|
||||
classpath/javax/swing/table/TableCellEditor.java,
|
||||
classpath/javax/swing/table/TableCellRenderer.java,
|
||||
classpath/javax/swing/ProgressMonitor.java,
|
||||
classpath/javax/swing/JToolBar.java,
|
||||
classpath/javax/swing/TransferHandler.java,
|
||||
classpath/javax/swing/DefaultCellEditor.java,
|
||||
classpath/javax/swing/DefaultButtonModel.java,
|
||||
classpath/javax/swing/JLayeredPane.java,
|
||||
classpath/javax/swing/text/DefaultEditorKit.java,
|
||||
classpath/javax/swing/text/DefaultCaret.java,
|
||||
classpath/javax/swing/text/FieldView.java,
|
||||
classpath/javax/swing/text/JTextComponent.java,
|
||||
classpath/javax/swing/text/TextAction.java,
|
||||
classpath/javax/swing/text/StyleContext.java,
|
||||
classpath/javax/swing/text/html/HTMLDocument.java,
|
||||
classpath/javax/swing/text/html/MinimalHTMLWriter.java,
|
||||
classpath/javax/swing/text/html/ImageView.java,
|
||||
classpath/javax/swing/text/html/HTMLEditorKit.java,
|
||||
classpath/javax/swing/text/AbstractWriter.java,
|
||||
classpath/javax/swing/text/GapContent.java,
|
||||
classpath/javax/swing/text/Utilities.java,
|
||||
classpath/javax/swing/text/PlainView.java,
|
||||
classpath/javax/swing/UIManager.java,
|
||||
classpath/javax/swing/JSplitPane.java,
|
||||
classpath/javax/swing/JComponent.java,
|
||||
classpath/javax/swing/SwingUtilities.java,
|
||||
classpath/javax/swing/border/AbstractBorder.java,
|
||||
classpath/javax/swing/border/CompoundBorder.java,
|
||||
classpath/javax/swing/border/TitledBorder.java,
|
||||
classpath/javax/swing/border/MatteBorder.java,
|
||||
classpath/javax/swing/border/BevelBorder.java,
|
||||
classpath/javax/swing/RepaintManager.java,
|
||||
classpath/javax/swing/JTable.java,
|
||||
classpath/javax/swing/UIDefaults.java,
|
||||
classpath/javax/swing/DefaultDesktopManager.java,
|
||||
classpath/javax/swing/JMenu.java,
|
||||
classpath/javax/swing/JLabel.java,
|
||||
classpath/javax/swing/JSlider.java,
|
||||
classpath/javax/swing/plaf/basic/BasicToolBarUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicButtonUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicOptionPaneUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicTextAreaUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicToggleButtonUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicSpinnerUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicSliderUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicComboPopup.java,
|
||||
classpath/javax/swing/plaf/basic/BasicCheckBoxUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicProgressBarUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicPanelUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicTreeUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicTableHeaderUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicFileChooserUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicScrollPaneUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicComboBoxUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicListUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicIconFactory.java,
|
||||
classpath/javax/swing/plaf/basic/BasicTextUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicLookAndFeel.java,
|
||||
classpath/javax/swing/plaf/basic/BasicDirectoryModel.java,
|
||||
classpath/javax/swing/plaf/basic/BasicRootPaneUI.java,
|
||||
classpath/javax/swing/plaf/basic/BasicTableUI.java,
|
||||
classpath/javax/swing/plaf/basic/SharedUIDefaults.java,
|
||||
classpath/javax/swing/plaf/multi/MultiComboBoxUI.java,
|
||||
classpath/javax/swing/plaf/multi/MultiListUI.java,
|
||||
classpath/javax/swing/plaf/multi/MultiSplitPaneUI.java,
|
||||
classpath/javax/swing/plaf/multi/MultiFileChooserUI.java,
|
||||
classpath/javax/swing/plaf/multi/MultiOptionPaneUI.java,
|
||||
classpath/javax/swing/plaf/multi/MultiTabbedPaneUI.java,
|
||||
classpath/javax/swing/plaf/multi/MultiLookAndFeel.java,
|
||||
classpath/javax/swing/plaf/metal/MetalSliderUI.java,
|
||||
classpath/javax/swing/plaf/metal/MetalIconFactory.java,
|
||||
classpath/javax/swing/plaf/metal/MetalComboBoxIcon.java,
|
||||
classpath/javax/swing/plaf/metal/MetalTabbedPaneUI.java,
|
||||
classpath/javax/swing/plaf/metal/MetalLookAndFeel.java,
|
||||
classpath/javax/swing/plaf/metal/MetalCheckBoxUI.java,
|
||||
classpath/javax/swing/plaf/metal/MetalSeparatorUI.java,
|
||||
classpath/javax/swing/plaf/metal/MetalBorders.java,
|
||||
classpath/javax/swing/plaf/metal/MetalSplitPaneDivider.java,
|
||||
classpath/javax/swing/plaf/metal/MetalScrollBarUI.java,
|
||||
classpath/javax/swing/plaf/metal/MetalRootPaneUI.java,
|
||||
classpath/javax/swing/plaf/metal/MetalInternalFrameUI.java,
|
||||
classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java,
|
||||
classpath/javax/swing/plaf/metal/MetalToolTipUI.java,
|
||||
classpath/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java,
|
||||
classpath/javax/swing/plaf/metal/MetalFileChooserUI.java,
|
||||
classpath/javax/swing/plaf/metal/MetalUtils.java,
|
||||
classpath/javax/swing/plaf/metal/MetalComboBoxButton.java,
|
||||
classpath/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java,
|
||||
classpath/javax/swing/plaf/metal/MetalButtonUI.java,
|
||||
classpath/javax/swing/JPopupMenu.java,
|
||||
classpath/javax/swing/JProgressBar.java,
|
||||
classpath/javax/swing/WindowConstants.java,
|
||||
classpath/javax/swing/JFrame.java,
|
||||
classpath/javax/swing/JFileChooser.java,
|
||||
classpath/javax/swing/JComboBox.java,
|
||||
classpath/javax/swing/event/EventListenerList.java,
|
||||
classpath/javax/swing/ListSelectionModel.java,
|
||||
classpath/javax/swing/JScrollBar.java,
|
||||
classpath/java/text/SimpleDateFormat.java,
|
||||
classpath/java/text/NumberFormat.java,
|
||||
classpath/java/text/class-dependencies.conf,
|
||||
classpath/java/awt/image/ColorModel.java,
|
||||
classpath/java/awt/image/BufferedImage.java,
|
||||
classpath/java/awt/Window.java,
|
||||
classpath/java/awt/ContainerOrderFocusTraversalPolicy.java,
|
||||
classpath/java/awt/LightweightDispatcher.java,
|
||||
classpath/java/awt/EventDispatchThread.java,
|
||||
classpath/java/awt/BasicStroke.java,
|
||||
classpath/java/awt/ColorPaintContext.java,
|
||||
classpath/java/awt/Container.java,
|
||||
classpath/java/awt/TexturePaint.java,
|
||||
classpath/java/awt/Component.java, classpath/java/awt/Font.java,
|
||||
classpath/java/awt/GraphicsConfiguration.java,
|
||||
classpath/java/awt/DefaultKeyboardFocusManager.java,
|
||||
classpath/java/awt/print/PrinterJob.java,
|
||||
classpath/java/awt/im/InputContext.java,
|
||||
classpath/java/awt/dnd/DragGestureRecognizer.java,
|
||||
classpath/java/awt/Toolkit.java,
|
||||
classpath/java/awt/font/GraphicAttribute.java,
|
||||
classpath/java/awt/font/ImageGraphicAttribute.java,
|
||||
classpath/java/awt/font/GlyphVector.java,
|
||||
classpath/java/awt/font/GlyphMetrics.java,
|
||||
classpath/java/awt/font/ShapeGraphicAttribute.java,
|
||||
classpath/java/awt/Graphics2D.java,
|
||||
classpath/include/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h,
|
||||
classpath/include/gnu_java_awt_peer_gtk_ComponentGraphics.h,
|
||||
classpath/include/gnu_java_awt_peer_gtk_CairoGraphics2D.h,
|
||||
classpath/include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h,
|
||||
classpath/include/gnu_java_awt_peer_gtk_GtkCanvasPeer.h,
|
||||
classpath/include/config.h.in,
|
||||
classpath/include/gnu_java_awt_peer_gtk_GdkTextLayout.h,
|
||||
classpath/include/gnu_java_awt_peer_gtk_GtkComponentPeer.h,
|
||||
classpath/include/gnu_java_awt_peer_gtk_GdkFontPeer.h,
|
||||
classpath/include/gnu_java_awt_peer_gtk_ComponentGraphicsCopy.h,
|
||||
classpath/include/gnu_java_awt_peer_gtk_GtkVolatileImage.h,
|
||||
classpath/include/gnu_java_awt_peer_gtk_GtkImage.h,
|
||||
classpath/include/gnu_java_awt_peer_gtk_CairoSurface.h,
|
||||
classpath/include/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.h:
|
||||
Merge from GNU Classpath HEAD.
|
||||
|
||||
2006-06-08 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* gnu/classpath/natSystemProperties.cc (insertSystemProperties):
|
||||
|
|
|
@ -145,9 +145,10 @@ am__DEPENDENCIES_1 = gnu/awt.lo gnu/awt/j2d.lo gnu/classpath.lo \
|
|||
gnu/gcj/util.lo gnu/java/awt.lo gnu/java/awt/color.lo \
|
||||
gnu/java/awt/font.lo gnu/java/awt/font/opentype.lo \
|
||||
gnu/java/awt/font/opentype/truetype.lo gnu/java/awt/image.lo \
|
||||
gnu/java/awt/java2d.lo gnu/java/awt/peer.lo gnu/java/io.lo \
|
||||
gnu/java/lang.lo gnu/java/lang/reflect.lo gnu/java/locale.lo \
|
||||
gnu/java/math.lo gnu/java/net.lo gnu/java/net/local.lo \
|
||||
gnu/java/awt/java2d.lo gnu/java/awt/peer.lo \
|
||||
gnu/java/awt/print.lo gnu/java/io.lo gnu/java/lang.lo \
|
||||
gnu/java/lang/reflect.lo gnu/java/locale.lo gnu/java/math.lo \
|
||||
gnu/java/net.lo gnu/java/net/local.lo \
|
||||
gnu/java/net/protocol/core.lo gnu/java/net/protocol/file.lo \
|
||||
gnu/java/net/protocol/ftp.lo gnu/java/net/protocol/gcjlib.lo \
|
||||
gnu/java/net/protocol/http.lo gnu/java/net/protocol/https.lo \
|
||||
|
@ -189,7 +190,7 @@ am__DEPENDENCIES_1 = gnu/awt.lo gnu/awt/j2d.lo gnu/classpath.lo \
|
|||
gnu/javax/print/ipp/attribute/supported.lo \
|
||||
gnu/javax/security/auth.lo gnu/javax/security/auth/callback.lo \
|
||||
gnu/javax/security/auth/login.lo gnu/javax/swing/plaf/gnu.lo \
|
||||
gnu/javax/swing/plaf/metal.lo \
|
||||
gnu/javax/swing/plaf/metal.lo gnu/javax/swing/text/html.lo \
|
||||
gnu/javax/swing/text/html/parser.lo \
|
||||
gnu/javax/swing/text/html/parser/models.lo \
|
||||
gnu/javax/swing/text/html/parser/support.lo \
|
||||
|
@ -1256,12 +1257,14 @@ gnu_java_awt_java2d_source_files = \
|
|||
classpath/gnu/java/awt/java2d/AbstractGraphics2D.java \
|
||||
classpath/gnu/java/awt/java2d/AlphaCompositeContext.java \
|
||||
classpath/gnu/java/awt/java2d/CubicSegment.java \
|
||||
classpath/gnu/java/awt/java2d/ImagePaint.java \
|
||||
classpath/gnu/java/awt/java2d/LineSegment.java \
|
||||
classpath/gnu/java/awt/java2d/PolyEdge.java \
|
||||
classpath/gnu/java/awt/java2d/PolyEdgeComparator.java \
|
||||
classpath/gnu/java/awt/java2d/QuadSegment.java \
|
||||
classpath/gnu/java/awt/java2d/RasterGraphics.java \
|
||||
classpath/gnu/java/awt/java2d/Segment.java
|
||||
classpath/gnu/java/awt/java2d/Segment.java \
|
||||
classpath/gnu/java/awt/java2d/TexturePaintContext.java
|
||||
|
||||
gnu_java_awt_java2d_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_awt_java2d_source_files)))
|
||||
gnu_java_awt_peer_source_files = \
|
||||
|
@ -1272,13 +1275,17 @@ classpath/gnu/java/awt/peer/GLightweightPeer.java
|
|||
|
||||
gnu_java_awt_peer_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_awt_peer_source_files)))
|
||||
gnu_java_awt_peer_gtk_source_files = \
|
||||
classpath/gnu/java/awt/peer/gtk/BufferedImageGraphics.java \
|
||||
classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java \
|
||||
classpath/gnu/java/awt/peer/gtk/CairoSurface.java \
|
||||
classpath/gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java \
|
||||
classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java \
|
||||
classpath/gnu/java/awt/peer/gtk/ComponentGraphicsCopy.java \
|
||||
classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GThreadMutex.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GdkFontMetrics.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GdkGlyphVector.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GdkGraphics.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GdkGraphics2D.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java \
|
||||
|
@ -1318,7 +1325,8 @@ classpath/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java \
|
|||
classpath/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GtkToolkit.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GtkVolatileImage.java \
|
||||
classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java
|
||||
classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java \
|
||||
classpath/gnu/java/awt/peer/gtk/VolatileImageGraphics.java
|
||||
|
||||
gnu_java_awt_peer_qt_source_files = \
|
||||
classpath/gnu/java/awt/peer/qt/MainQtThread.java \
|
||||
|
@ -1381,6 +1389,13 @@ classpath/gnu/java/awt/peer/swing/SwingTextFieldPeer.java \
|
|||
classpath/gnu/java/awt/peer/swing/SwingToolkit.java \
|
||||
classpath/gnu/java/awt/peer/swing/SwingWindowPeer.java
|
||||
|
||||
gnu_java_awt_print_source_files = \
|
||||
classpath/gnu/java/awt/print/JavaPrinterGraphics.java \
|
||||
classpath/gnu/java/awt/print/JavaPrinterJob.java \
|
||||
classpath/gnu/java/awt/print/PostScriptGraphics2D.java \
|
||||
classpath/gnu/java/awt/print/SpooledDocument.java
|
||||
|
||||
gnu_java_awt_print_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_java_awt_print_source_files)))
|
||||
gnu_java_beans_source_files = \
|
||||
classpath/gnu/java/beans/BeanInfoEmbryo.java \
|
||||
classpath/gnu/java/beans/DefaultExceptionListener.java \
|
||||
|
@ -2718,8 +2733,15 @@ gnu_javax_swing_plaf_metal_source_files = \
|
|||
classpath/gnu/javax/swing/plaf/metal/CustomizableTheme.java
|
||||
|
||||
gnu_javax_swing_plaf_metal_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_javax_swing_plaf_metal_source_files)))
|
||||
gnu_javax_swing_text_html_source_files = \
|
||||
classpath/gnu/javax/swing/text/html/CharacterAttributeTranslator.java \
|
||||
classpath/gnu/javax/swing/text/html/CombinedAttributes.java \
|
||||
classpath/gnu/javax/swing/text/html/ImageViewIconFactory.java
|
||||
|
||||
gnu_javax_swing_text_html_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(gnu_javax_swing_text_html_source_files)))
|
||||
gnu_javax_swing_text_html_parser_source_files = \
|
||||
classpath/gnu/javax/swing/text/html/parser/HTML_401F.java \
|
||||
classpath/gnu/javax/swing/text/html/parser/SmallHtmlAttributeSet.java \
|
||||
classpath/gnu/javax/swing/text/html/parser/gnuDTD.java \
|
||||
classpath/gnu/javax/swing/text/html/parser/htmlAttributeSet.java \
|
||||
classpath/gnu/javax/swing/text/html/parser/htmlValidator.java
|
||||
|
@ -5353,7 +5375,8 @@ classpath/javax/swing/plaf/basic/BasicToolTipUI.java \
|
|||
classpath/javax/swing/plaf/basic/BasicTreeUI.java \
|
||||
classpath/javax/swing/plaf/basic/BasicViewportUI.java \
|
||||
classpath/javax/swing/plaf/basic/ComboPopup.java \
|
||||
classpath/javax/swing/plaf/basic/DefaultMenuLayout.java
|
||||
classpath/javax/swing/plaf/basic/DefaultMenuLayout.java \
|
||||
classpath/javax/swing/plaf/basic/SharedUIDefaults.java
|
||||
|
||||
javax_swing_plaf_basic_header_files = $(patsubst classpath/%,%,$(patsubst %.java,%.h,$(javax_swing_plaf_basic_source_files)))
|
||||
javax_swing_plaf_metal_source_files = \
|
||||
|
@ -5531,8 +5554,10 @@ classpath/javax/swing/text/html/HTMLDocument.java \
|
|||
classpath/javax/swing/text/html/HTMLEditorKit.java \
|
||||
classpath/javax/swing/text/html/HTMLFrameHyperlinkEvent.java \
|
||||
classpath/javax/swing/text/html/HTMLTableView.java \
|
||||
classpath/javax/swing/text/html/ImageView.java \
|
||||
classpath/javax/swing/text/html/InlineView.java \
|
||||
classpath/javax/swing/text/html/ListView.java \
|
||||
classpath/javax/swing/text/html/MinimalHTMLWriter.java \
|
||||
classpath/javax/swing/text/html/NullView.java \
|
||||
classpath/javax/swing/text/html/ObjectView.java \
|
||||
classpath/javax/swing/text/html/Option.java \
|
||||
|
@ -6476,6 +6501,7 @@ all_packages_source_files = \
|
|||
gnu/java/awt/image.list \
|
||||
gnu/java/awt/java2d.list \
|
||||
gnu/java/awt/peer.list \
|
||||
gnu/java/awt/print.list \
|
||||
gnu/java/io.list \
|
||||
gnu/java/lang.list \
|
||||
gnu/java/lang/reflect.list \
|
||||
|
@ -6563,6 +6589,7 @@ all_packages_source_files = \
|
|||
gnu/javax/security/auth/login.list \
|
||||
gnu/javax/swing/plaf/gnu.list \
|
||||
gnu/javax/swing/plaf/metal.list \
|
||||
gnu/javax/swing/text/html.list \
|
||||
gnu/javax/swing/text/html/parser.list \
|
||||
gnu/javax/swing/text/html/parser/models.list \
|
||||
gnu/javax/swing/text/html/parser/support.list \
|
||||
|
@ -6693,6 +6720,7 @@ ordinary_header_files = \
|
|||
$(gnu_java_awt_image_header_files) \
|
||||
$(gnu_java_awt_java2d_header_files) \
|
||||
$(gnu_java_awt_peer_header_files) \
|
||||
$(gnu_java_awt_print_header_files) \
|
||||
$(gnu_java_io_header_files) \
|
||||
$(gnu_java_lang_header_files) \
|
||||
$(gnu_java_lang_reflect_header_files) \
|
||||
|
@ -6780,6 +6808,7 @@ ordinary_header_files = \
|
|||
$(gnu_javax_security_auth_login_header_files) \
|
||||
$(gnu_javax_swing_plaf_gnu_header_files) \
|
||||
$(gnu_javax_swing_plaf_metal_header_files) \
|
||||
$(gnu_javax_swing_text_html_header_files) \
|
||||
$(gnu_javax_swing_text_html_parser_header_files) \
|
||||
$(gnu_javax_swing_text_html_parser_models_header_files) \
|
||||
$(gnu_javax_swing_text_html_parser_support_header_files) \
|
||||
|
@ -8989,6 +9018,16 @@ gnu-java-awt-peer-swing.lo: $(gnu_java_awt_peer_swing_source_files)
|
|||
$(LTGCJCOMPILE) -fjni -findirect-dispatch -fno-indirect-classes -c -o gnu-java-awt-peer-swing.lo @gnu-java-awt-peer-swing.list
|
||||
@rm -f gnu-java-awt-peer-swing.list
|
||||
|
||||
gnu/java/awt/print.list: $(gnu_java_awt_print_source_files)
|
||||
@$(mkinstalldirs) $(dir $@)
|
||||
@for file in $(gnu_java_awt_print_source_files); do \
|
||||
if test -f $(srcdir)/$$file; then \
|
||||
echo $(srcdir)/$$file; \
|
||||
else echo $$file; fi; \
|
||||
done > gnu/java/awt/print.list
|
||||
|
||||
-include gnu/java/awt/print.deps
|
||||
|
||||
gnu-java-beans.lo: $(gnu_java_beans_source_files)
|
||||
@find classpath/lib/gnu/java/beans -name '*.class' > gnu-java-beans.list
|
||||
$(LTGCJCOMPILE) -fjni -findirect-dispatch -fno-indirect-classes -c -o gnu-java-beans.lo @gnu-java-beans.list
|
||||
|
@ -9874,6 +9913,16 @@ gnu/javax/swing/plaf/metal.list: $(gnu_javax_swing_plaf_metal_source_files)
|
|||
|
||||
-include gnu/javax/swing/plaf/metal.deps
|
||||
|
||||
gnu/javax/swing/text/html.list: $(gnu_javax_swing_text_html_source_files)
|
||||
@$(mkinstalldirs) $(dir $@)
|
||||
@for file in $(gnu_javax_swing_text_html_source_files); do \
|
||||
if test -f $(srcdir)/$$file; then \
|
||||
echo $(srcdir)/$$file; \
|
||||
else echo $$file; fi; \
|
||||
done > gnu/javax/swing/text/html.list
|
||||
|
||||
-include gnu/javax/swing/text/html.deps
|
||||
|
||||
gnu/javax/swing/text/html/parser.list: $(gnu_javax_swing_text_html_parser_source_files)
|
||||
@$(mkinstalldirs) $(dir $@)
|
||||
@for file in $(gnu_javax_swing_text_html_parser_source_files); do \
|
||||
|
|
|
@ -39,9 +39,9 @@ target_triplet = @target@
|
|||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(top_srcdir)/configure \
|
||||
$(top_srcdir)/gnu/classpath/Configuration.java.in AUTHORS \
|
||||
COPYING ChangeLog INSTALL NEWS TODO config.guess config.sub \
|
||||
depcomp install-sh ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh ltconfig \
|
||||
ltmain.sh missing mkinstalldirs
|
||||
COPYING ChangeLog INSTALL NEWS TODO compile config.guess \
|
||||
config.sub depcomp install-sh ltcf-c.sh ltcf-cxx.sh \
|
||||
ltcf-gcj.sh ltconfig ltmain.sh missing mkinstalldirs
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
|
||||
|
@ -89,8 +89,6 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AWK = @AWK@
|
||||
BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
|
||||
BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
|
||||
CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
CAIRO_LIBS = @CAIRO_LIBS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
|
@ -117,8 +115,12 @@ CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
|||
CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
|
||||
CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
|
||||
CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
|
||||
CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
|
||||
CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
|
||||
CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
|
||||
CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
|
||||
CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
|
||||
CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
|
||||
CXX = @CXX@
|
||||
|
@ -141,6 +143,8 @@ EXAMPLESDIR = @EXAMPLESDIR@
|
|||
EXEEXT = @EXEEXT@
|
||||
FASTJAR = @FASTJAR@
|
||||
FIND = @FIND@
|
||||
FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
|
||||
FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
|
||||
FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
|
||||
FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
|
||||
FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
|
||||
|
@ -156,9 +160,8 @@ FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
|||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GJDOC = @GJDOC@
|
||||
GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@
|
||||
GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
|
||||
GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
|
||||
|
@ -180,6 +183,7 @@ KJC = @KJC@
|
|||
LDFLAGS = @LDFLAGS@
|
||||
LIBDEBUG = @LIBDEBUG@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBMAGIC = @LIBMAGIC@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
|
@ -193,6 +197,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
|||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR = @MKDIR@
|
||||
MOC = @MOC@
|
||||
MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
|
||||
MOZILLA_LIBS = @MOZILLA_LIBS@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
@ -206,6 +212,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
|
|||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_DIR = @PLUGIN_DIR@
|
||||
QT_CFLAGS = @QT_CFLAGS@
|
||||
QT_LIBS = @QT_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
|
@ -225,11 +232,13 @@ USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
|||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
VM_BINARY = @VM_BINARY@
|
||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
XSLT_CFLAGS = @XSLT_CFLAGS@
|
||||
XSLT_LIBS = @XSLT_LIBS@
|
||||
XTEST_LIBS = @XTEST_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,7 +6,7 @@ dnl -----------------------------------------------------------
|
|||
dnl define([AC_CACHE_LOAD], )dnl
|
||||
dnl define([AC_CACHE_SAVE], )dnl
|
||||
|
||||
AC_INIT([GNU Classpath],[0.91],[classpath@gnu.org],[classpath])
|
||||
AC_INIT([GNU Classpath],[0.92-pre],[classpath@gnu.org],[classpath])
|
||||
AC_CONFIG_SRCDIR(java/lang/System.java)
|
||||
|
||||
AC_CANONICAL_TARGET
|
||||
|
@ -41,9 +41,6 @@ AM_INIT_AUTOMAKE([1.9.0 gnu std-options tar-ustar])
|
|||
AC_CONFIG_HEADERS([include/config.h])
|
||||
AC_PREFIX_DEFAULT(/usr/local/classpath)
|
||||
|
||||
dnl GCC LOCAL
|
||||
GCC_NO_EXECUTABLES
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Enable collections.jar (disabled by default)
|
||||
dnl -----------------------------------------------------------
|
||||
|
@ -168,23 +165,6 @@ dnl GTK native peer error checking
|
|||
dnl -----------------------------------------------------------
|
||||
AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
|
||||
|
||||
dnl ------------------------------------------------------------
|
||||
dnl determine whether to enable the cairo GTK Graphics2D backend
|
||||
dnl ------------------------------------------------------------
|
||||
AC_ARG_ENABLE([gtk-cairo],
|
||||
[AS_HELP_STRING(--enable-gtk-cairo,build the cairo Graphics2D implementation on GTK [default=no])],
|
||||
[case "${enableval}" in
|
||||
yes) GTK_CAIRO_ENABLED=true ;;
|
||||
no) GTK_CAIRO_ENABLED=false ;;
|
||||
*) GTK_CAIRO_ENABLED=true ;;
|
||||
esac],
|
||||
[GTK_CAIRO_ENABLED=false])
|
||||
AC_SUBST(GTK_CAIRO_ENABLED)
|
||||
if test "x${GTK_CAIRO_ENABLED}" = xtrue; then
|
||||
AC_DEFINE(GTK_CAIRO, 1, [defined if cairo support was built in])
|
||||
fi
|
||||
AM_CONDITIONAL(GTK_CAIRO, test "x${GTK_CAIRO_ENABLED}" = xtrue)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Qt native peer (disabled by default)
|
||||
dnl -----------------------------------------------------------
|
||||
|
@ -198,12 +178,24 @@ AC_ARG_ENABLE([qt-peer],
|
|||
[COMPILE_QT_PEER=no])
|
||||
AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Plugin (enabled by default)
|
||||
dnl -----------------------------------------------------------
|
||||
AC_ARG_ENABLE([plugin],
|
||||
[AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
|
||||
[case "${enableval}" in
|
||||
yes) COMPILE_PLUGIN=yes ;;
|
||||
no) COMPILE_PLUGIN=no ;;
|
||||
*) COMPILE_PLUGIN=yes ;;
|
||||
esac],
|
||||
[COMPILE_PLUGIN=yes])
|
||||
AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Sets the native libraries installation dir
|
||||
dnl -----------------------------------------------------------
|
||||
AC_ARG_WITH([native-libdir],
|
||||
[AS_HELP_STRING(--with-native-libdir,sets the installation directore for native libraries [default='${libdir}/${PACKAGE}'])],
|
||||
[AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
|
||||
[
|
||||
nativeexeclibdir=${withval}
|
||||
],
|
||||
|
@ -227,6 +219,21 @@ AC_ARG_WITH([glibj-dir],
|
|||
|
||||
AC_SUBST(glibjdir)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Sets the VM name for use in tool wrapper scripts
|
||||
dnl -----------------------------------------------------------
|
||||
AC_ARG_WITH([vm],
|
||||
[AS_HELP_STRING(--with-vm,sets the VM binary name [default='${prefix}/bin/jamvm'])],
|
||||
[
|
||||
VM_BINARY=${withval}
|
||||
],
|
||||
[
|
||||
VM_BINARY='${prefix}/bin/jamvm'
|
||||
])
|
||||
|
||||
AC_SUBST(VM_BINARY)
|
||||
AM_CONDITIONAL(FOUND_CACAO, test "x`basename $VM_BINARY`" = xcacao)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Regenerate headers at build time (disabled by default)
|
||||
dnl -----------------------------------------------------------
|
||||
|
@ -240,20 +247,33 @@ AC_ARG_ENABLE([regen-headers],
|
|||
[REGENERATE_JNI_HEADERS=no])
|
||||
AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Enable tool wrapper binaries (disabled by default)
|
||||
dnl -----------------------------------------------------------
|
||||
AC_ARG_ENABLE([tool-wrappers],
|
||||
[AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
|
||||
[case x"${enableval}" in
|
||||
xyes) COMPILE_WRAPPERS=yes ;;
|
||||
xno) COMPILE_WRAPPERS=no ;;
|
||||
x) COMPILE_WRAPPERS=yes ;;
|
||||
*) COMPILE_WRAPPERS=yes ;;
|
||||
esac],
|
||||
[COMPILE_WRAPPERS=no])
|
||||
AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
|
||||
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_INSTALL
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Checks for programs.
|
||||
dnl -----------------------------------------------------------
|
||||
|
||||
AC_PROG_CXX
|
||||
dnl Initialize libtool
|
||||
AC_DISABLE_STATIC
|
||||
AC_PROG_LIBTOOL
|
||||
dnl AC_PROG_AWK
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_CXX
|
||||
|
||||
if test "x${COMPILE_COLLECTIONS}" = xyes; then
|
||||
AC_PATH_PROG(PERL, [perl])
|
||||
|
@ -284,7 +304,8 @@ if test "x${COMPILE_JNI}" = xyes; then
|
|||
sys/select.h \
|
||||
crt_externs.h \
|
||||
fcntl.h \
|
||||
sys/mman.h])
|
||||
sys/mman.h \
|
||||
magic.h])
|
||||
|
||||
AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
|
||||
AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
|
||||
|
@ -300,8 +321,13 @@ if test "x${COMPILE_JNI}" = xyes; then
|
|||
strerror_r \
|
||||
fcntl \
|
||||
mmap munmap mincore msync madvise getpagesize sysconf \
|
||||
lstat readlink \
|
||||
])
|
||||
|
||||
LIBMAGIC=
|
||||
AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
|
||||
AC_SUBST(LIBMAGIC)
|
||||
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
AC_STRUCT_TIMEZONE
|
||||
|
@ -375,26 +401,35 @@ if test "x${COMPILE_JNI}" = xyes; then
|
|||
AC_MSG_ERROR([GTK+ peers requested but no X library available])
|
||||
fi
|
||||
dnl We explicitly want the XTest Extension for Robot support.
|
||||
AC_CHECK_LIB([Xtst], [XTestQueryExtension], [true],
|
||||
[AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
|
||||
[${X_LIBS}])
|
||||
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
|
||||
|
||||
if test "x${enable_gtk_cairo}" = xyes; then
|
||||
PKG_CHECK_MODULES(CAIRO, cairo >= 0.5.0)
|
||||
fi
|
||||
AC_CHECK_LIB([Xtst], [XTestQueryExtension],
|
||||
[XTEST_LIBS="$XTEST_LIBS -lX11 -lXtst"],
|
||||
[AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
|
||||
[${X_LIBS}])
|
||||
|
||||
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
|
||||
PKG_CHECK_MODULES(FREETYPE2, freetype2)
|
||||
PKG_CHECK_MODULES(PANGOFT2, pangoft2)
|
||||
dnl Check if we can link against the XRender library and set
|
||||
dnl HAVE_XRENDER accordingly.
|
||||
AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
|
||||
[AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
|
||||
[true],
|
||||
[${X_LIBS}])
|
||||
|
||||
dnl Check if we can link against the XRandR library and set
|
||||
dnl HAVE_XRANDR accordingly.
|
||||
AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
|
||||
[AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
|
||||
[true],
|
||||
[${X_LIBS}])
|
||||
|
||||
AC_SUBST(GTK_CFLAGS)
|
||||
AC_SUBST(GTK_LIBS)
|
||||
AC_SUBST(CAIRO_LIBS)
|
||||
AC_SUBST(CAIRO_CFLAGS)
|
||||
AC_SUBST(FREETYPE2_LIBS)
|
||||
AC_SUBST(FREETYPE2_CFLAGS)
|
||||
AC_SUBST(PANGOFT2_LIBS)
|
||||
AC_SUBST(PANGOFT2_CFLAGS)
|
||||
AC_SUBST(XTEST_LIBS)
|
||||
fi
|
||||
|
||||
dnl Check for AWT related Qt4
|
||||
|
@ -445,6 +480,25 @@ if test "x${COMPILE_JNI}" = xyes; then
|
|||
AC_SUBST(QT_CFLAGS)
|
||||
AC_SUBST(QT_LIBS)
|
||||
fi
|
||||
|
||||
dnl Check for plugin support headers and libraries.
|
||||
if test "x${COMPILE_PLUGIN}" = xyes; then
|
||||
PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
|
||||
if test "x${MOZILLA_FOUND}" = xno; then
|
||||
PKG_CHECK_MODULES(MOZILLA, firefox-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
|
||||
fi
|
||||
if test "x${MOZILLA_FOUND}" = xno; then
|
||||
PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
|
||||
fi
|
||||
PKG_CHECK_MODULES(GLIB, glib-2.0)
|
||||
|
||||
AC_SUBST(MOZILLA_CFLAGS)
|
||||
AC_SUBST(MOZILLA_LIBS)
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
|
||||
AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
|
||||
fi
|
||||
fi
|
||||
|
||||
CLASSPATH_WITH_JAVAH
|
||||
|
@ -669,6 +723,7 @@ native/jni/qt-peer/Makefile
|
|||
native/jni/xmlj/Makefile
|
||||
native/jni/midi-alsa/Makefile
|
||||
native/jni/midi-dssi/Makefile
|
||||
native/plugin/Makefile
|
||||
native/target/Makefile
|
||||
native/target/Linux/Makefile
|
||||
native/target/generic/Makefile
|
||||
|
@ -679,10 +734,19 @@ lib/Makefile
|
|||
lib/gen-classlist.sh
|
||||
lib/copy-vmresources.sh
|
||||
tools/Makefile
|
||||
tools/jarsigner.sh
|
||||
tools/keytool.sh
|
||||
examples/Makefile
|
||||
examples/Makefile.jawt])
|
||||
|
||||
if test "x${COMPILE_WRAPPERS}" = xno
|
||||
then
|
||||
AC_CONFIG_FILES([tools/appletviewer
|
||||
tools/jarsigner
|
||||
tools/keytool])
|
||||
AC_CONFIG_COMMANDS([appletviewer],[chmod 755 tools/appletviewer])
|
||||
AC_CONFIG_COMMANDS([jarsigner],[chmod 755 tools/jarsigner])
|
||||
AC_CONFIG_COMMANDS([keytool],[chmod 755 tools/keytool])
|
||||
fi
|
||||
|
||||
AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
|
||||
AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
|
||||
AC_OUTPUT
|
||||
|
|
|
@ -73,8 +73,6 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AWK = @AWK@
|
||||
BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
|
||||
BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
|
||||
CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
CAIRO_LIBS = @CAIRO_LIBS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
|
@ -101,8 +99,12 @@ CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
|||
CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
|
||||
CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
|
||||
CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
|
||||
CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
|
||||
CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
|
||||
CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
|
||||
CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
|
||||
CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
|
||||
CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
|
||||
CXX = @CXX@
|
||||
|
@ -125,6 +127,8 @@ EXAMPLESDIR = @EXAMPLESDIR@
|
|||
EXEEXT = @EXEEXT@
|
||||
FASTJAR = @FASTJAR@
|
||||
FIND = @FIND@
|
||||
FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
|
||||
FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
|
||||
FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
|
||||
FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
|
||||
FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
|
||||
|
@ -140,9 +144,8 @@ FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
|||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GJDOC = @GJDOC@
|
||||
GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@
|
||||
GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
|
||||
GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
|
||||
|
@ -164,6 +167,7 @@ KJC = @KJC@
|
|||
LDFLAGS = @LDFLAGS@
|
||||
LIBDEBUG = @LIBDEBUG@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBMAGIC = @LIBMAGIC@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
|
@ -177,6 +181,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
|||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR = @MKDIR@
|
||||
MOC = @MOC@
|
||||
MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
|
||||
MOZILLA_LIBS = @MOZILLA_LIBS@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
@ -190,6 +196,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
|
|||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_DIR = @PLUGIN_DIR@
|
||||
QT_CFLAGS = @QT_CFLAGS@
|
||||
QT_LIBS = @QT_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
|
@ -209,11 +216,13 @@ USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
|||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
VM_BINARY = @VM_BINARY@
|
||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
XSLT_CFLAGS = @XSLT_CFLAGS@
|
||||
XSLT_LIBS = @XSLT_LIBS@
|
||||
XTEST_LIBS = @XTEST_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
|
|
|
@ -66,8 +66,6 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AWK = @AWK@
|
||||
BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
|
||||
BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
|
||||
CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
CAIRO_LIBS = @CAIRO_LIBS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
|
@ -94,8 +92,12 @@ CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
|||
CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
|
||||
CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
|
||||
CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
|
||||
CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
|
||||
CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
|
||||
CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
|
||||
CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
|
||||
CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
|
||||
CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
|
||||
CXX = @CXX@
|
||||
|
@ -118,6 +120,8 @@ EXAMPLESDIR = @EXAMPLESDIR@
|
|||
EXEEXT = @EXEEXT@
|
||||
FASTJAR = @FASTJAR@
|
||||
FIND = @FIND@
|
||||
FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
|
||||
FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
|
||||
FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
|
||||
FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
|
||||
FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
|
||||
|
@ -133,9 +137,8 @@ FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
|||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GJDOC = @GJDOC@
|
||||
GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@
|
||||
GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
|
||||
GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
|
||||
|
@ -157,6 +160,7 @@ KJC = @KJC@
|
|||
LDFLAGS = @LDFLAGS@
|
||||
LIBDEBUG = @LIBDEBUG@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBMAGIC = @LIBMAGIC@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
|
@ -170,6 +174,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
|||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR = @MKDIR@
|
||||
MOC = @MOC@
|
||||
MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
|
||||
MOZILLA_LIBS = @MOZILLA_LIBS@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
@ -183,6 +189,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
|
|||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_DIR = @PLUGIN_DIR@
|
||||
QT_CFLAGS = @QT_CFLAGS@
|
||||
QT_LIBS = @QT_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
|
@ -202,11 +209,13 @@ USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
|||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
VM_BINARY = @VM_BINARY@
|
||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
XSLT_CFLAGS = @XSLT_CFLAGS@
|
||||
XSLT_LIBS = @XSLT_LIBS@
|
||||
XTEST_LIBS = @XTEST_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
|
|
|
@ -75,8 +75,6 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AWK = @AWK@
|
||||
BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
|
||||
BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
|
||||
CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
CAIRO_LIBS = @CAIRO_LIBS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
|
@ -103,8 +101,12 @@ CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
|||
CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
|
||||
CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
|
||||
CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
|
||||
CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
|
||||
CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
|
||||
CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
|
||||
CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
|
||||
CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
|
||||
CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
|
||||
CXX = @CXX@
|
||||
|
@ -127,6 +129,8 @@ EXAMPLESDIR = @EXAMPLESDIR@
|
|||
EXEEXT = @EXEEXT@
|
||||
FASTJAR = @FASTJAR@
|
||||
FIND = @FIND@
|
||||
FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
|
||||
FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
|
||||
FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
|
||||
FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
|
||||
FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
|
||||
|
@ -142,9 +146,8 @@ FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
|||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GJDOC = @GJDOC@
|
||||
GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@
|
||||
GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
|
||||
GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
|
||||
|
@ -166,6 +169,7 @@ KJC = @KJC@
|
|||
LDFLAGS = @LDFLAGS@
|
||||
LIBDEBUG = @LIBDEBUG@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBMAGIC = @LIBMAGIC@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
|
@ -179,6 +183,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
|||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR = @MKDIR@
|
||||
MOC = @MOC@
|
||||
MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
|
||||
MOZILLA_LIBS = @MOZILLA_LIBS@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
@ -192,6 +198,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
|
|||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_DIR = @PLUGIN_DIR@
|
||||
QT_CFLAGS = @QT_CFLAGS@
|
||||
QT_LIBS = @QT_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
|
@ -211,11 +218,13 @@ USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
|||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
VM_BINARY = @VM_BINARY@
|
||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
XSLT_CFLAGS = @XSLT_CFLAGS@
|
||||
XSLT_LIBS = @XSLT_LIBS@
|
||||
XTEST_LIBS = @XTEST_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
|
|
|
@ -73,8 +73,6 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AWK = @AWK@
|
||||
BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
|
||||
BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
|
||||
CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
CAIRO_LIBS = @CAIRO_LIBS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
|
@ -101,8 +99,12 @@ CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
|||
CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
|
||||
CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
|
||||
CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
|
||||
CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
|
||||
CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
|
||||
CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
|
||||
CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
|
||||
CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
|
||||
CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
|
||||
CXX = @CXX@
|
||||
|
@ -125,6 +127,8 @@ EXAMPLESDIR = @EXAMPLESDIR@
|
|||
EXEEXT = @EXEEXT@
|
||||
FASTJAR = @FASTJAR@
|
||||
FIND = @FIND@
|
||||
FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
|
||||
FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
|
||||
FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
|
||||
FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
|
||||
FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
|
||||
|
@ -140,9 +144,8 @@ FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
|||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GJDOC = @GJDOC@
|
||||
GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@
|
||||
GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
|
||||
GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
|
||||
|
@ -164,6 +167,7 @@ KJC = @KJC@
|
|||
LDFLAGS = @LDFLAGS@
|
||||
LIBDEBUG = @LIBDEBUG@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBMAGIC = @LIBMAGIC@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
|
@ -177,6 +181,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
|||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR = @MKDIR@
|
||||
MOC = @MOC@
|
||||
MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
|
||||
MOZILLA_LIBS = @MOZILLA_LIBS@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
@ -190,6 +196,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
|
|||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_DIR = @PLUGIN_DIR@
|
||||
QT_CFLAGS = @QT_CFLAGS@
|
||||
QT_LIBS = @QT_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
|
@ -209,11 +216,13 @@ USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
|||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
VM_BINARY = @VM_BINARY@
|
||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
XSLT_CFLAGS = @XSLT_CFLAGS@
|
||||
XSLT_LIBS = @XSLT_LIBS@
|
||||
XTEST_LIBS = @XTEST_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
|
|
|
@ -64,8 +64,6 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AWK = @AWK@
|
||||
BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
|
||||
BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
|
||||
CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
CAIRO_LIBS = @CAIRO_LIBS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
|
@ -92,8 +90,12 @@ CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
|||
CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
|
||||
CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
|
||||
CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
|
||||
CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
|
||||
CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
|
||||
CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
|
||||
CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
|
||||
CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
|
||||
CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
|
||||
CXX = @CXX@
|
||||
|
@ -116,6 +118,8 @@ EXAMPLESDIR = @EXAMPLESDIR@
|
|||
EXEEXT = @EXEEXT@
|
||||
FASTJAR = @FASTJAR@
|
||||
FIND = @FIND@
|
||||
FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
|
||||
FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
|
||||
FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
|
||||
FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
|
||||
FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
|
||||
|
@ -131,9 +135,8 @@ FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
|||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GJDOC = @GJDOC@
|
||||
GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@
|
||||
GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
|
||||
GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
|
||||
|
@ -155,6 +158,7 @@ KJC = @KJC@
|
|||
LDFLAGS = @LDFLAGS@
|
||||
LIBDEBUG = @LIBDEBUG@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBMAGIC = @LIBMAGIC@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
|
@ -168,6 +172,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
|||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR = @MKDIR@
|
||||
MOC = @MOC@
|
||||
MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
|
||||
MOZILLA_LIBS = @MOZILLA_LIBS@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
@ -181,6 +187,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
|
|||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_DIR = @PLUGIN_DIR@
|
||||
QT_CFLAGS = @QT_CFLAGS@
|
||||
QT_LIBS = @QT_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
|
@ -200,11 +207,13 @@ USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
|||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
VM_BINARY = @VM_BINARY@
|
||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
XSLT_CFLAGS = @XSLT_CFLAGS@
|
||||
XSLT_LIBS = @XSLT_LIBS@
|
||||
XTEST_LIBS = @XTEST_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
|
|
|
@ -64,8 +64,6 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AWK = @AWK@
|
||||
BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
|
||||
BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
|
||||
CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
CAIRO_LIBS = @CAIRO_LIBS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
|
@ -92,8 +90,12 @@ CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
|||
CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
|
||||
CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
|
||||
CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
|
||||
CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
|
||||
CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
|
||||
CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
|
||||
CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
|
||||
CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
|
||||
CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
|
||||
CXX = @CXX@
|
||||
|
@ -116,6 +118,8 @@ EXAMPLESDIR = @EXAMPLESDIR@
|
|||
EXEEXT = @EXEEXT@
|
||||
FASTJAR = @FASTJAR@
|
||||
FIND = @FIND@
|
||||
FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
|
||||
FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
|
||||
FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
|
||||
FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
|
||||
FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
|
||||
|
@ -131,9 +135,8 @@ FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
|||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GJDOC = @GJDOC@
|
||||
GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@
|
||||
GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
|
||||
GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
|
||||
|
@ -155,6 +158,7 @@ KJC = @KJC@
|
|||
LDFLAGS = @LDFLAGS@
|
||||
LIBDEBUG = @LIBDEBUG@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBMAGIC = @LIBMAGIC@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
|
@ -168,6 +172,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
|||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR = @MKDIR@
|
||||
MOC = @MOC@
|
||||
MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
|
||||
MOZILLA_LIBS = @MOZILLA_LIBS@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
@ -181,6 +187,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
|
|||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_DIR = @PLUGIN_DIR@
|
||||
QT_CFLAGS = @QT_CFLAGS@
|
||||
QT_LIBS = @QT_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
|
@ -200,11 +207,13 @@ USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
|||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
VM_BINARY = @VM_BINARY@
|
||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
XSLT_CFLAGS = @XSLT_CFLAGS@
|
||||
XSLT_LIBS = @XSLT_LIBS@
|
||||
XTEST_LIBS = @XTEST_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
|
|
|
@ -64,8 +64,6 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AWK = @AWK@
|
||||
BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
|
||||
BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
|
||||
CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
CAIRO_LIBS = @CAIRO_LIBS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
|
@ -92,8 +90,12 @@ CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
|||
CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
|
||||
CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
|
||||
CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
|
||||
CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
|
||||
CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
|
||||
CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
|
||||
CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
|
||||
CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
|
||||
CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
|
||||
CXX = @CXX@
|
||||
|
@ -116,6 +118,8 @@ EXAMPLESDIR = @EXAMPLESDIR@
|
|||
EXEEXT = @EXEEXT@
|
||||
FASTJAR = @FASTJAR@
|
||||
FIND = @FIND@
|
||||
FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
|
||||
FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
|
||||
FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
|
||||
FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
|
||||
FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
|
||||
|
@ -131,9 +135,8 @@ FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
|||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GJDOC = @GJDOC@
|
||||
GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@
|
||||
GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
|
||||
GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
|
||||
|
@ -155,6 +158,7 @@ KJC = @KJC@
|
|||
LDFLAGS = @LDFLAGS@
|
||||
LIBDEBUG = @LIBDEBUG@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBMAGIC = @LIBMAGIC@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
|
@ -168,6 +172,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
|||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR = @MKDIR@
|
||||
MOC = @MOC@
|
||||
MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
|
||||
MOZILLA_LIBS = @MOZILLA_LIBS@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
@ -181,6 +187,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
|
|||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_DIR = @PLUGIN_DIR@
|
||||
QT_CFLAGS = @QT_CFLAGS@
|
||||
QT_LIBS = @QT_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
|
@ -200,11 +207,13 @@ USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
|||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
VM_BINARY = @VM_BINARY@
|
||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
XSLT_CFLAGS = @XSLT_CFLAGS@
|
||||
XSLT_LIBS = @XSLT_LIBS@
|
||||
XTEST_LIBS = @XTEST_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
|
|
|
@ -95,10 +95,4 @@ public interface Configuration
|
|||
*/
|
||||
boolean JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION =
|
||||
@JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@;
|
||||
|
||||
/**
|
||||
* Set to true if Cairo was found and enabled during configure,
|
||||
* false otherwise.
|
||||
*/
|
||||
boolean GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ import java.awt.image.WritableRaster;
|
|||
* />
|
||||
*
|
||||
* <p>The above screen shot shows the result of applying six different
|
||||
* BitwiseXORComposites. They were constructed with the colors colors
|
||||
* BitwiseXORComposites. They were constructed with the colors
|
||||
* white, blue, black, orange, green, and brown, respectively. Each
|
||||
* composite was used to paint a fully white rectangle on top of the
|
||||
* blue bar in the background.
|
||||
|
|
|
@ -144,25 +144,7 @@ public final class Buffers
|
|||
*/
|
||||
public static Object getData(DataBuffer buffer)
|
||||
{
|
||||
if (buffer instanceof DataBufferByte)
|
||||
return ((DataBufferByte) buffer).getData();
|
||||
|
||||
if (buffer instanceof DataBufferShort)
|
||||
return ((DataBufferShort) buffer).getData();
|
||||
|
||||
if (buffer instanceof DataBufferUShort)
|
||||
return ((DataBufferUShort) buffer).getData();
|
||||
|
||||
if (buffer instanceof DataBufferInt)
|
||||
return ((DataBufferInt) buffer).getData();
|
||||
|
||||
if (buffer instanceof DataBufferFloat)
|
||||
return ((DataBufferFloat) buffer).getData();
|
||||
|
||||
if (buffer instanceof DataBufferDouble)
|
||||
return ((DataBufferDouble) buffer).getData();
|
||||
|
||||
throw new ClassCastException("Unknown data buffer type");
|
||||
return getData(buffer, 0, null, 0, buffer.getSize());
|
||||
}
|
||||
|
||||
|
||||
|
@ -172,46 +154,46 @@ public final class Buffers
|
|||
* given destination array is null.
|
||||
*/
|
||||
public static Object getData(DataBuffer src, int srcOffset,
|
||||
Object dest, int destOffset,
|
||||
Object dest, int dstOffset,
|
||||
int length)
|
||||
{
|
||||
Object from;
|
||||
if (src instanceof DataBufferByte)
|
||||
{
|
||||
from = ((DataBufferByte) src).getData();
|
||||
if (dest == null) dest = new byte[length+destOffset];
|
||||
}
|
||||
else if (src instanceof DataBufferShort)
|
||||
{
|
||||
from = ((DataBufferShort) src).getData();
|
||||
if (dest == null) dest = new short[length+destOffset];
|
||||
}
|
||||
else if (src instanceof DataBufferUShort)
|
||||
{
|
||||
from = ((DataBufferUShort) src).getData();
|
||||
if (dest == null) dest = new short[length+destOffset];
|
||||
}
|
||||
else if (src instanceof DataBufferInt)
|
||||
{
|
||||
from = ((DataBufferInt) src).getData();
|
||||
if (dest == null) dest = new int[length+destOffset];
|
||||
}
|
||||
else if (src instanceof DataBufferFloat)
|
||||
{
|
||||
from = ((DataBufferFloat) src).getData();
|
||||
if (dest == null) dest = new float[length+destOffset];
|
||||
}
|
||||
else if (src instanceof DataBufferDouble)
|
||||
{
|
||||
from = ((DataBufferDouble) src).getData();
|
||||
if (dest == null) dest = new double[length+destOffset];
|
||||
}
|
||||
else
|
||||
switch(src.getDataType())
|
||||
{
|
||||
case DataBuffer.TYPE_BYTE:
|
||||
if (dest == null) dest = new byte[length+dstOffset];
|
||||
for(int i = 0; i < length; i++)
|
||||
((byte[])dest)[i + dstOffset] = (byte)src.getElem(i + srcOffset);
|
||||
break;
|
||||
|
||||
case DataBuffer.TYPE_DOUBLE:
|
||||
if (dest == null) dest = new double[length+dstOffset];
|
||||
for(int i = 0; i < length; i++)
|
||||
((double[])dest)[i + dstOffset] = src.getElemDouble(i + srcOffset);
|
||||
break;
|
||||
|
||||
case DataBuffer.TYPE_FLOAT:
|
||||
if (dest == null) dest = new float[length+dstOffset];
|
||||
for(int i = 0; i < length; i++)
|
||||
((float[])dest)[i + dstOffset] = src.getElemFloat(i + srcOffset);
|
||||
break;
|
||||
|
||||
case DataBuffer.TYPE_INT:
|
||||
if (dest == null) dest = new int[length+dstOffset];
|
||||
for(int i = 0; i < length; i++)
|
||||
((int[])dest)[i + dstOffset] = src.getElem(i + srcOffset);
|
||||
break;
|
||||
|
||||
case DataBuffer.TYPE_SHORT:
|
||||
case DataBuffer.TYPE_USHORT:
|
||||
if (dest == null) dest = new short[length+dstOffset];
|
||||
for(int i = 0; i < length; i++)
|
||||
((short[])dest)[i + dstOffset] = (short)src.getElem(i + srcOffset);
|
||||
break;
|
||||
|
||||
case DataBuffer.TYPE_UNDEFINED:
|
||||
throw new ClassCastException("Unknown data buffer type");
|
||||
}
|
||||
|
||||
System.arraycopy(from, srcOffset, dest, destOffset, length);
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ public class GNUGlyphVector
|
|||
|
||||
fontSize = font.getSize2D();
|
||||
transform = font.getTransform(); // returns a modifiable copy
|
||||
transform.concatenate(renderContext.getTransform());
|
||||
//transform.concatenate(renderContext.getTransform());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ import java.util.Locale;
|
|||
*
|
||||
* @author Sascha Brawer (brawer@dandelis.ch)
|
||||
*/
|
||||
class NameDecoder
|
||||
public class NameDecoder
|
||||
{
|
||||
public static final int NAME_COPYRIGHT = 0;
|
||||
|
||||
|
@ -122,27 +122,38 @@ class NameDecoder
|
|||
|
||||
nameTable.position(0);
|
||||
/* We understand only format 0 of the name table. */
|
||||
if (nameTable.getChar() != 0)
|
||||
if (nameTable.getShort() != 0)
|
||||
return null;
|
||||
|
||||
macLanguage = getMacLanguageCode(locale);
|
||||
msLanguage = getMicrosoftLanguageCode(locale);
|
||||
numRecords = nameTable.getChar();
|
||||
offset = nameTable.getChar();
|
||||
numRecords = nameTable.getShort();
|
||||
offset = nameTable.getShort();
|
||||
|
||||
for (int i = 0; i < numRecords; i++)
|
||||
{
|
||||
namePlatform = nameTable.getChar();
|
||||
nameEncoding = nameTable.getChar();
|
||||
nameLanguage = nameTable.getChar();
|
||||
nameID = nameTable.getChar();
|
||||
nameLen = nameTable.getChar();
|
||||
nameStart = offset + nameTable.getChar();
|
||||
namePlatform = nameTable.getShort();
|
||||
nameEncoding = nameTable.getShort();
|
||||
nameLanguage = nameTable.getShort();
|
||||
nameID = nameTable.getShort();
|
||||
nameLen = nameTable.getShort();
|
||||
nameStart = offset + nameTable.getShort();
|
||||
|
||||
|
||||
if (nameID != name)
|
||||
continue;
|
||||
|
||||
// Handle PS seperately as it can be only ASCII, although
|
||||
// possibly encoded as UTF-16BE
|
||||
if ( name == NAME_POSTSCRIPT )
|
||||
{
|
||||
if( nameTable.get(nameStart) == 0 ) // Peek at top byte
|
||||
result = decodeName("UTF-16BE", nameTable, nameStart, nameLen);
|
||||
else
|
||||
result = decodeName("ASCII", nameTable, nameStart, nameLen);
|
||||
return result;
|
||||
}
|
||||
|
||||
match = false;
|
||||
switch (namePlatform)
|
||||
{
|
||||
|
@ -393,14 +404,19 @@ class NameDecoder
|
|||
private static String decodeName(int platform, int encoding, int language,
|
||||
ByteBuffer buffer, int offset, int len)
|
||||
{
|
||||
byte[] byteBuf;
|
||||
String charsetName;
|
||||
int oldPosition;
|
||||
|
||||
charsetName = getCharsetName(platform, language, encoding);
|
||||
String charsetName = getCharsetName(platform, language, encoding);
|
||||
if (charsetName == null)
|
||||
return null;
|
||||
|
||||
return decodeName(charsetName, buffer, offset, len);
|
||||
}
|
||||
|
||||
private static String decodeName(String charsetName,
|
||||
ByteBuffer buffer, int offset, int len)
|
||||
{
|
||||
byte[] byteBuf;
|
||||
int oldPosition;
|
||||
|
||||
byteBuf = new byte[len];
|
||||
oldPosition = buffer.position();
|
||||
try
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -236,7 +236,7 @@ public class AlphaCompositeContext
|
|||
}
|
||||
else
|
||||
{
|
||||
for (int i = srcComponentsLength - 1; i >= 0; i--)
|
||||
for (int i = srcComponentsLength - 2; i >= 0; i--)
|
||||
srcComponents[i] *= srcComponents[srcComponentsLength - 1];
|
||||
}
|
||||
if (! dstColorModel.isAlphaPremultiplied())
|
||||
|
|
|
@ -0,0 +1,192 @@
|
|||
/* ImagePaint.java -- Supplies the pixels for image rendering
|
||||
Copyright (C) 2006 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 gnu.java.awt.java2d;
|
||||
|
||||
import java.awt.Paint;
|
||||
import java.awt.PaintContext;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.Transparency;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.Raster;
|
||||
import java.awt.image.RenderedImage;
|
||||
import java.awt.image.WritableRaster;
|
||||
|
||||
/**
|
||||
* This class is used as a temporary Paint object to supply the pixel values
|
||||
* for image rendering using the normal scanline conversion implementation.
|
||||
*
|
||||
* @author Roman Kennke (kennke@aicas.com)
|
||||
*/
|
||||
public class ImagePaint
|
||||
implements Paint
|
||||
{
|
||||
|
||||
/**
|
||||
* The PaintContext implementation for the ImagePaint.
|
||||
*/
|
||||
private class ImagePaintContext
|
||||
implements PaintContext
|
||||
{
|
||||
|
||||
/**
|
||||
* The target raster.
|
||||
*/
|
||||
private WritableRaster target;
|
||||
|
||||
/**
|
||||
* Nothing to do here.
|
||||
*/
|
||||
public void dispose()
|
||||
{
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the color model.
|
||||
*
|
||||
* @return the color model
|
||||
*/
|
||||
public ColorModel getColorModel()
|
||||
{
|
||||
return image.getColorModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Supplies the pixel to be rendered.
|
||||
*
|
||||
* @see PaintContext#getRaster(int, int, int, int)
|
||||
*/
|
||||
public Raster getRaster(int x1, int y1, int w, int h)
|
||||
{
|
||||
ensureRasterSize(w, h);
|
||||
int x2 = x1 + w;
|
||||
int y2 = y1 + h;
|
||||
float[] src = new float[2];
|
||||
float[] dest = new float[2];
|
||||
Raster source = image.getData();
|
||||
int minX = source.getMinX();
|
||||
int maxX = source.getWidth() + minX;
|
||||
int minY = source.getMinY();
|
||||
int maxY = source.getHeight() + minY;
|
||||
Object pixel = null;
|
||||
for (int y = y1; y < y2; y++)
|
||||
{
|
||||
for (int x = x1; x < x2; x++)
|
||||
{
|
||||
src[0] = x;
|
||||
src[1] = y;
|
||||
transform.transform(src, 0, dest, 0, 1);
|
||||
int dx = (int) dest[0];
|
||||
int dy = (int) dest[1];
|
||||
// Pixels outside the source image are not of interest, skip
|
||||
// them.
|
||||
if (dx >= minX && dx < maxX && dy >= minY && dy < maxY)
|
||||
{
|
||||
pixel = source.getDataElements(dx, dy, pixel);
|
||||
target.setDataElements(x - x1, y - y1, pixel);
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the target raster exists and has at least the specified
|
||||
* size.
|
||||
*
|
||||
* @param w the requested target width
|
||||
* @param h the requested target height
|
||||
*/
|
||||
private void ensureRasterSize(int w, int h)
|
||||
{
|
||||
if (target == null || target.getWidth() < w || target.getHeight() < h)
|
||||
{
|
||||
Raster s = image.getData();
|
||||
target = s.createCompatibleWritableRaster(w, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The image to render.
|
||||
*/
|
||||
RenderedImage image;
|
||||
|
||||
/**
|
||||
* The transform from image space to device space. This is the inversed
|
||||
* transform of the concatenated
|
||||
* transform image space -> user space -> device space transform.
|
||||
*/
|
||||
AffineTransform transform;
|
||||
|
||||
/**
|
||||
* Creates a new ImagePaint for rendering the specified image using the
|
||||
* specified device space -> image space transform. This transform
|
||||
* is the inversed transform of the usual image space -> user space -> device
|
||||
* space transform.
|
||||
*
|
||||
* The ImagePaint will only render the image in the specified area of
|
||||
* interest (which is specified in image space).
|
||||
*
|
||||
* @param i the image to render
|
||||
* @param t the device space to user space transform
|
||||
*/
|
||||
ImagePaint(RenderedImage i, AffineTransform t)
|
||||
{
|
||||
image = i;
|
||||
transform = t;
|
||||
}
|
||||
|
||||
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds,
|
||||
Rectangle2D userBounds,
|
||||
AffineTransform xform,
|
||||
RenderingHints hints)
|
||||
{
|
||||
return new ImagePaintContext();
|
||||
}
|
||||
|
||||
public int getTransparency()
|
||||
{
|
||||
return Transparency.OPAQUE;
|
||||
}
|
||||
|
||||
}
|
|
@ -64,6 +64,11 @@ public class PolyEdge
|
|||
*/
|
||||
double xIntersection;
|
||||
|
||||
/**
|
||||
* Indicates whether this edge is from the clip or from the target shape.
|
||||
*/
|
||||
boolean isClip;
|
||||
|
||||
/**
|
||||
* Creates a new PolyEdge with the specified coordinates.
|
||||
*
|
||||
|
@ -72,8 +77,9 @@ public class PolyEdge
|
|||
* @param x1 the end point, x coordinate
|
||||
* @param y1 the end point, y coordinate
|
||||
*/
|
||||
PolyEdge(double x0, double y0, double x1, double y1)
|
||||
PolyEdge(double x0, double y0, double x1, double y1, boolean clip)
|
||||
{
|
||||
isClip = clip;
|
||||
if (y0 < y1)
|
||||
{
|
||||
this.x0 = x0;
|
||||
|
|
|
@ -65,8 +65,10 @@ public class RasterGraphics
|
|||
|
||||
public RasterGraphics(WritableRaster r, ColorModel cm)
|
||||
{
|
||||
super();
|
||||
raster = r;
|
||||
colorModel = cm;
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,205 @@
|
|||
/* TexturePaintContext.java -- PaintContext impl for TexturePaint
|
||||
Copyright (C) 2006 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 gnu.java.awt.java2d;
|
||||
|
||||
import java.awt.AWTError;
|
||||
import java.awt.PaintContext;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.TexturePaint;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.NoninvertibleTransformException;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.Raster;
|
||||
import java.awt.image.WritableRaster;
|
||||
|
||||
/**
|
||||
* A {@link PaintContext} implementation for {@link TexturePaint}, done in
|
||||
* pure Java.
|
||||
*
|
||||
* @author Roman Kennke (kennke@aicas.com)
|
||||
*/
|
||||
public class TexturePaintContext
|
||||
implements PaintContext
|
||||
{
|
||||
|
||||
/**
|
||||
* The TexturePaint object.
|
||||
*/
|
||||
private BufferedImage image;
|
||||
|
||||
/**
|
||||
* The Raster that holds the texture.
|
||||
*/
|
||||
private WritableRaster paintRaster;
|
||||
|
||||
/**
|
||||
* The transform from userspace into device space.
|
||||
*/
|
||||
private AffineTransform transform;
|
||||
|
||||
/**
|
||||
* Creates a new TexturePaintContext for the specified TexturePaint object.
|
||||
* This initializes the Raster which is returned by
|
||||
* {@link #getRaster(int, int, int, int)}.
|
||||
*
|
||||
* @param t the texture paint object
|
||||
* @param db the bounds of the target raster in device space
|
||||
* @param ub the bounds of the target raster in user space
|
||||
* @param xform the transformation from user space to device space
|
||||
*/
|
||||
public TexturePaintContext(TexturePaint t, Rectangle db,
|
||||
Rectangle2D ub, AffineTransform xform)
|
||||
{
|
||||
image = t.getImage();
|
||||
|
||||
try
|
||||
{
|
||||
// Prepare transform for mapping from device space into image space.
|
||||
// In order to achieve this we take the transform for userspace->
|
||||
// devicespace, append the correct scale and translation according
|
||||
// to the anchor (which gives us the image->userspace->devicespace
|
||||
// transform), and invert that (which gives use the device->user->image
|
||||
// transform).
|
||||
Rectangle2D anchor = t.getAnchorRect();
|
||||
BufferedImage image = t.getImage();
|
||||
double scaleX = anchor.getWidth() / image.getWidth();
|
||||
double scaleY = anchor.getHeight() / image.getHeight();
|
||||
transform = (AffineTransform) xform.clone();
|
||||
transform.scale(scaleX, scaleY);
|
||||
transform.translate(-anchor.getMinX(), -anchor.getMaxX());
|
||||
transform = transform.createInverse();
|
||||
}
|
||||
catch (NoninvertibleTransformException ex)
|
||||
{
|
||||
AWTError err =
|
||||
new AWTError("Unexpected NoninvertibleTransformException");
|
||||
err.initCause(ex);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disposes the PaintContext. Nothing is to do here, since we don't use
|
||||
* any native resources in that implementation.
|
||||
*/
|
||||
public void dispose()
|
||||
{
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the color model of this PaintContext. This implementation returnes
|
||||
* the color model used by the BufferedImage in the TexturePaint object,
|
||||
* this avoids costly color model transformations (at least at this point).
|
||||
*
|
||||
* @return the color model of this PaintContext
|
||||
*/
|
||||
public ColorModel getColorModel()
|
||||
{
|
||||
return image.getColorModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Raster that is used for painting.
|
||||
*
|
||||
* @param x1 the x location of the raster inside the user bounds of this paint
|
||||
* context
|
||||
* @param y1 the y location of the raster inside the user bounds of this paint
|
||||
* context
|
||||
* @param w the width
|
||||
* @param h the height
|
||||
*
|
||||
* @return the Raster that is used for painting
|
||||
*
|
||||
*/
|
||||
public Raster getRaster(int x1, int y1, int w, int h)
|
||||
{
|
||||
ensureRasterSize(w, h);
|
||||
int x2 = x1 + w;
|
||||
int y2 = y1 + h;
|
||||
float[] src = new float[2];
|
||||
float[] dest = new float[2];
|
||||
Raster source = image.getData();
|
||||
int minX = source.getMinX();
|
||||
int width = source.getWidth();
|
||||
int minY = source.getMinY();
|
||||
int height = source.getHeight();
|
||||
Object pixel = null;
|
||||
for (int y = y1; y < y2; y++)
|
||||
{
|
||||
for (int x = x1; x < x2; x++)
|
||||
{
|
||||
// Transform the coordinates from device space into image space.
|
||||
src[0] = x;
|
||||
src[1] = y;
|
||||
transform.transform(src, 0, dest, 0, 1);
|
||||
int dx = (int) dest[0];
|
||||
int dy = (int) dest[1];
|
||||
|
||||
// The modulo operation gives us the replication effect.
|
||||
dx = ((dx - minX) % width) + minX;
|
||||
dy = ((dy - minY) % height) + minY;
|
||||
|
||||
// Copy the pixel.
|
||||
pixel = source.getDataElements(dx, dy, pixel);
|
||||
paintRaster.setDataElements(x - x1, y - y1, pixel);
|
||||
}
|
||||
}
|
||||
return paintRaster;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the target raster exists and has at least the specified
|
||||
* size.
|
||||
*
|
||||
* @param w the requested target width
|
||||
* @param h the requested target height
|
||||
*/
|
||||
private void ensureRasterSize(int w, int h)
|
||||
{
|
||||
if (paintRaster == null || paintRaster.getWidth() < w
|
||||
|| paintRaster.getHeight() < h)
|
||||
{
|
||||
Raster s = image.getData();
|
||||
paintRaster = s.createCompatibleWritableRaster(w, h);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,258 @@
|
|||
/* BufferedImageGraphics.java
|
||||
Copyright (C) 2006 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 gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.font.GlyphVector;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.awt.image.DataBufferInt;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.DirectColorModel;
|
||||
import java.awt.image.RenderedImage;
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/**
|
||||
* Implementation of Graphics2D on a Cairo surface.
|
||||
*
|
||||
* Simutanously maintains a CairoSurface and updates the
|
||||
* BufferedImage from that after each drawing operation.
|
||||
*/
|
||||
public class BufferedImageGraphics extends CairoGraphics2D
|
||||
{
|
||||
/**
|
||||
* the buffered Image.
|
||||
*/
|
||||
private BufferedImage image;
|
||||
|
||||
/**
|
||||
* Image size.
|
||||
*/
|
||||
private int imageWidth, imageHeight;
|
||||
|
||||
/**
|
||||
* The cairo surface that we actually draw on.
|
||||
*/
|
||||
CairoSurface surface;
|
||||
|
||||
/**
|
||||
* Cache BufferedImageGraphics surfaces.
|
||||
*/
|
||||
static WeakHashMap bufferedImages = new WeakHashMap();
|
||||
|
||||
/**
|
||||
* Its corresponding cairo_t.
|
||||
*/
|
||||
private long cairo_t;
|
||||
|
||||
/**
|
||||
* Colormodels we recognize for fast copying.
|
||||
*/
|
||||
static ColorModel rgb32 = new DirectColorModel(32, 0xFF0000, 0xFF00, 0xFF);
|
||||
static ColorModel argb32 = new DirectColorModel(32, 0xFF0000, 0xFF00, 0xFF,
|
||||
0xFF000000);
|
||||
private boolean hasFastCM;
|
||||
private boolean hasAlpha;
|
||||
|
||||
|
||||
public BufferedImageGraphics(BufferedImage bi)
|
||||
{
|
||||
this.image = bi;
|
||||
imageWidth = bi.getWidth();
|
||||
imageHeight = bi.getHeight();
|
||||
if(bi.getColorModel().equals(rgb32))
|
||||
{
|
||||
hasFastCM = true;
|
||||
hasAlpha = false;
|
||||
}
|
||||
else if(bi.getColorModel().equals(argb32))
|
||||
{
|
||||
hasFastCM = true;
|
||||
hasAlpha = false;
|
||||
}
|
||||
else
|
||||
hasFastCM = false;
|
||||
|
||||
// Cache surfaces.
|
||||
if( bufferedImages.get( bi ) != null )
|
||||
surface = (CairoSurface)bufferedImages.get( bi );
|
||||
else
|
||||
{
|
||||
surface = new CairoSurface( imageWidth, imageHeight );
|
||||
bufferedImages.put(bi, surface);
|
||||
}
|
||||
|
||||
cairo_t = surface.newCairoContext();
|
||||
|
||||
DataBuffer db = bi.getRaster().getDataBuffer();
|
||||
int[] pixels;
|
||||
// get pixels
|
||||
|
||||
if(db instanceof CairoSurface)
|
||||
pixels = ((CairoSurface)db).getPixels(imageWidth * imageHeight);
|
||||
else
|
||||
{
|
||||
if( hasFastCM )
|
||||
{
|
||||
pixels = ((DataBufferInt)db).getData();
|
||||
if( !hasAlpha )
|
||||
for(int i = 0; i < pixels.length; i++)
|
||||
pixels[i] &= 0xFFFFFFFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
pixels = CairoGraphics2D.findSimpleIntegerArray
|
||||
(image.getColorModel(),image.getData());
|
||||
}
|
||||
}
|
||||
surface.setPixels( pixels );
|
||||
|
||||
setup( cairo_t );
|
||||
setClip(0, 0, imageWidth, imageHeight);
|
||||
}
|
||||
|
||||
BufferedImageGraphics(BufferedImageGraphics copyFrom)
|
||||
{
|
||||
surface = copyFrom.surface;
|
||||
cairo_t = surface.newCairoContext();
|
||||
imageWidth = copyFrom.imageWidth;
|
||||
imageHeight = copyFrom.imageHeight;
|
||||
copy( copyFrom, cairo_t );
|
||||
setClip(0, 0, surface.width, surface.height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a rectangle of the bufferedImage. This can be improved upon a lot.
|
||||
*/
|
||||
private void updateBufferedImage(int x, int y, int width, int height)
|
||||
{
|
||||
int[] pixels = surface.getPixels(imageWidth * imageHeight);
|
||||
|
||||
if( x > imageWidth || y > imageHeight )
|
||||
return;
|
||||
// Clip edges.
|
||||
if( x < 0 ){ width = width + x; x = 0; }
|
||||
if( y < 0 ){ height = height + y; y = 0; }
|
||||
if( x + width > imageWidth )
|
||||
width = imageWidth - x;
|
||||
if( y + height > imageHeight )
|
||||
height = imageHeight - y;
|
||||
|
||||
if( !hasFastCM )
|
||||
image.setRGB(x, y, width, height, pixels,
|
||||
x + y * imageWidth, imageWidth);
|
||||
else
|
||||
System.arraycopy(pixels, y * imageWidth,
|
||||
((DataBufferInt)image.getRaster().getDataBuffer()).
|
||||
getData(), y * imageWidth, height * imageWidth);
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract methods.
|
||||
*/
|
||||
public Graphics create()
|
||||
{
|
||||
return new BufferedImageGraphics(this);
|
||||
}
|
||||
|
||||
public GraphicsConfiguration getDeviceConfiguration()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
protected Rectangle2D getRealBounds()
|
||||
{
|
||||
return new Rectangle2D.Double(0.0, 0.0, imageWidth, imageHeight);
|
||||
}
|
||||
|
||||
public void copyAreaImpl(int x, int y, int width, int height, int dx, int dy)
|
||||
{
|
||||
surface.copyAreaNative(x, y, width, height, dx, dy, surface.width);
|
||||
updateBufferedImage(x + dx, y + dy, width, height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overloaded methods that do actual drawing need to enter the gdk threads
|
||||
* and also do certain things before and after.
|
||||
*/
|
||||
public void draw(Shape s)
|
||||
{
|
||||
super.draw(s);
|
||||
Rectangle r = s.getBounds();
|
||||
updateBufferedImage(r.x, r.y, r.width, r.height);
|
||||
}
|
||||
|
||||
public void fill(Shape s)
|
||||
{
|
||||
super.fill(s);
|
||||
Rectangle r = s.getBounds();
|
||||
updateBufferedImage(r.x, r.y, r.width, r.height);
|
||||
}
|
||||
|
||||
public void drawRenderedImage(RenderedImage image, AffineTransform xform)
|
||||
{
|
||||
super.drawRenderedImage(image, xform);
|
||||
updateBufferedImage(0, 0, imageWidth, imageHeight);
|
||||
}
|
||||
|
||||
protected boolean drawImage(Image img, AffineTransform xform,
|
||||
Color bgcolor, ImageObserver obs)
|
||||
{
|
||||
boolean rv = super.drawImage(img, xform, bgcolor, obs);
|
||||
updateBufferedImage(0, 0, imageWidth, imageHeight);
|
||||
return rv;
|
||||
}
|
||||
|
||||
public void drawGlyphVector(GlyphVector gv, float x, float y)
|
||||
{
|
||||
super.drawGlyphVector(gv, x, y);
|
||||
updateBufferedImage(0, 0, imageWidth, imageHeight);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,288 @@
|
|||
/* CairoSurface.java
|
||||
Copyright (C) 2006 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 gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Color;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.awt.image.Raster;
|
||||
import java.awt.image.WritableRaster;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.DirectColorModel;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.net.URL;
|
||||
import gnu.classpath.Pointer;
|
||||
|
||||
/**
|
||||
* CairoSurface - wraps a Cairo surface.
|
||||
*
|
||||
* @author Sven de Marothy
|
||||
*/
|
||||
public class CairoSurface extends DataBuffer
|
||||
{
|
||||
int width = -1, height = -1;
|
||||
|
||||
/**
|
||||
* The native pointer to the Cairo surface.
|
||||
*/
|
||||
long surfacePointer;
|
||||
|
||||
/**
|
||||
* The native pointer to the image's data buffer
|
||||
*/
|
||||
long bufferPointer;
|
||||
|
||||
|
||||
static ColorModel nativeModel = new DirectColorModel(32,
|
||||
0x000000FF,
|
||||
0x0000FF00,
|
||||
0x00FF0000,
|
||||
0xFF000000);
|
||||
|
||||
/**
|
||||
* Allocates and clears the buffer and creates the cairo surface.
|
||||
* @param width, height - the image size
|
||||
* @param stride - the buffer row stride.
|
||||
*/
|
||||
private native void create(int width, int height, int stride);
|
||||
|
||||
/**
|
||||
* Destroys the cairo surface and frees the buffer.
|
||||
*/
|
||||
private native void destroy();
|
||||
|
||||
/**
|
||||
* Gets buffer elements
|
||||
*/
|
||||
private native int nativeGetElem(int i);
|
||||
|
||||
/**
|
||||
* Sets buffer elements.
|
||||
*/
|
||||
private native void nativeSetElem(int i, int val);
|
||||
|
||||
/**
|
||||
* Draws this image to a given CairoGraphics context,
|
||||
* with an affine transform given by i2u.
|
||||
*/
|
||||
public native void drawSurface(CairoGraphics2D context, double[] i2u);
|
||||
|
||||
/**
|
||||
* getPixels -return the pixels as a java array.
|
||||
*/
|
||||
native int[] getPixels(int size);
|
||||
|
||||
/**
|
||||
* getPixels -return the pixels as a java array.
|
||||
*/
|
||||
native void setPixels(int[] pixels);
|
||||
|
||||
native long getFlippedBuffer(int size);
|
||||
|
||||
/**
|
||||
* Create a cairo_surface_t with specified width and height.
|
||||
* The format will be ARGB32 with premultiplied alpha and native bit
|
||||
* and word ordering.
|
||||
*/
|
||||
CairoSurface(int width, int height)
|
||||
{
|
||||
super(DataBuffer.TYPE_INT, width * height);
|
||||
|
||||
if(width <= 0 || height <= 0)
|
||||
throw new IllegalArgumentException("Image must be at least 1x1 pixels.");
|
||||
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
|
||||
create(width, height, width * 4);
|
||||
|
||||
if(surfacePointer == 0 || bufferPointer == 0)
|
||||
throw new Error("Could not allocate bitmap.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a cairo_surface_t from a GtkImage instance.
|
||||
* (data is copied, not shared)
|
||||
*/
|
||||
CairoSurface(GtkImage image)
|
||||
{
|
||||
super(DataBuffer.TYPE_INT, image.width * image.height);
|
||||
|
||||
if(image.width <= 0 || image.height <= 0)
|
||||
throw new IllegalArgumentException("Image must be at least 1x1 pixels.");
|
||||
|
||||
width = image.width;
|
||||
height = image.height;
|
||||
|
||||
create(width, height, width * 4);
|
||||
|
||||
if(surfacePointer == 0 || bufferPointer == 0)
|
||||
throw new Error("Could not allocate bitmap.");
|
||||
|
||||
// Copy the pixel data from the GtkImage.
|
||||
int[] data = image.getPixels();
|
||||
|
||||
// Swap ordering from GdkPixbuf to Cairo
|
||||
for(int i = 0; i < data.length; i++ )
|
||||
{
|
||||
int alpha = (data[i] & 0xFF000000) >> 24;
|
||||
if( alpha == 0 ) // I do not know why we need this, but it works.
|
||||
data[i] = 0;
|
||||
else
|
||||
{
|
||||
int r = (((data[i] & 0x00FF0000) >> 16) );
|
||||
int g = (((data[i] & 0x0000FF00) >> 8) );
|
||||
int b = ((data[i] & 0x000000FF) );
|
||||
data[i] = (( alpha << 24 ) & 0xFF000000)
|
||||
| (( b << 16 ) & 0x00FF0000)
|
||||
| (( g << 8 ) & 0x0000FF00)
|
||||
| ( r & 0x000000FF);
|
||||
}
|
||||
}
|
||||
|
||||
setPixels( data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispose of the native data.
|
||||
*/
|
||||
public void dispose()
|
||||
{
|
||||
if(surfacePointer != 0)
|
||||
destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Call dispose() to clean up any native resources allocated.
|
||||
*/
|
||||
protected void finalize()
|
||||
{
|
||||
dispose();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a GtkImage from this Cairo surface.
|
||||
*/
|
||||
public GtkImage getGtkImage()
|
||||
{
|
||||
return new GtkImage( width, height, getFlippedBuffer( width * height ));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a BufferedImage backed by a Cairo surface.
|
||||
*/
|
||||
public static BufferedImage getBufferedImage(int width, int height)
|
||||
{
|
||||
return getBufferedImage(new CairoSurface(width, height));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a BufferedImage backed by a Cairo surface,
|
||||
* created from a GtkImage.
|
||||
*/
|
||||
public static BufferedImage getBufferedImage(GtkImage image)
|
||||
{
|
||||
return getBufferedImage(new CairoSurface(image));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a BufferedImage backed by a Cairo surface.
|
||||
*/
|
||||
public static BufferedImage getBufferedImage(CairoSurface surface)
|
||||
{
|
||||
WritableRaster raster = Raster.createPackedRaster
|
||||
(surface, surface.width, surface.height, surface.width,
|
||||
new int[]{ 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 },
|
||||
new Point(0,0));
|
||||
|
||||
return new BufferedImage(nativeModel, raster, true, new Hashtable());
|
||||
}
|
||||
|
||||
/**
|
||||
* DataBank.getElem implementation
|
||||
*/
|
||||
public int getElem(int bank, int i)
|
||||
{
|
||||
if(bank != 0 || i < 0 || i >= width*height)
|
||||
throw new IndexOutOfBoundsException(i+" size: "+width*height);
|
||||
return nativeGetElem(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* DataBank.setElem implementation
|
||||
*/
|
||||
public void setElem(int bank, int i, int val)
|
||||
{
|
||||
if(bank != 0 || i < 0 || i >= width*height)
|
||||
throw new IndexOutOfBoundsException(i+" size: "+width*height);
|
||||
nativeSetElem(i, val);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a Graphics2D drawing to the CairoSurface.
|
||||
*/
|
||||
public Graphics2D getGraphics()
|
||||
{
|
||||
return new CairoSurfaceGraphics(this);
|
||||
}
|
||||
|
||||
///// Methods used by CairoSurfaceGraphics /////
|
||||
/**
|
||||
* Creates a cairo_t drawing context, returns the pointer as a long.
|
||||
* Used by CairoSurfaceGraphics.
|
||||
*/
|
||||
native long newCairoContext();
|
||||
|
||||
/**
|
||||
* Copy an area of the surface. Expects parameters must be within bounds.
|
||||
* Count on a segfault otherwise.
|
||||
*/
|
||||
native void copyAreaNative(int x, int y, int width, int height,
|
||||
int dx, int dy, int stride);
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
/* CairoSurfaceGraphics.java
|
||||
Copyright (C) 2006 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 gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Color;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.*;
|
||||
|
||||
/**
|
||||
* Implementation of Graphics2D on a Cairo surface.
|
||||
*/
|
||||
public class CairoSurfaceGraphics extends CairoGraphics2D
|
||||
{
|
||||
protected CairoSurface surface;
|
||||
private long cairo_t;
|
||||
|
||||
/**
|
||||
* Create a graphics context from a cairo surface
|
||||
*/
|
||||
public CairoSurfaceGraphics(CairoSurface surface)
|
||||
{
|
||||
this.surface = surface;
|
||||
cairo_t = surface.newCairoContext();
|
||||
setup( cairo_t );
|
||||
setClip(0, 0, surface.width, surface.height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates another context from a surface.
|
||||
* Used by create().
|
||||
*/
|
||||
private CairoSurfaceGraphics(CairoSurfaceGraphics copyFrom)
|
||||
{
|
||||
surface = copyFrom.surface;
|
||||
cairo_t = surface.newCairoContext();
|
||||
copy( copyFrom, cairo_t );
|
||||
setClip(0, 0, surface.width, surface.height);
|
||||
}
|
||||
|
||||
public Graphics create()
|
||||
{
|
||||
return new CairoSurfaceGraphics(this);
|
||||
}
|
||||
|
||||
public GraphicsConfiguration getDeviceConfiguration()
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
protected Rectangle2D getRealBounds()
|
||||
{
|
||||
return new Rectangle2D.Double(0.0, 0.0, surface.width, surface.height);
|
||||
}
|
||||
|
||||
public void copyAreaImpl(int x, int y, int width, int height, int dx, int dy)
|
||||
{
|
||||
surface.copyAreaNative(x, y, width, height, dx, dy, surface.width);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,243 @@
|
|||
/* ComponentGraphics.java --
|
||||
Copyright (C) 2006 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 gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.Image;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.Point;
|
||||
import java.awt.font.FontRenderContext;
|
||||
import java.awt.font.GlyphVector;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.awt.image.ImagingOpException;
|
||||
import java.awt.image.RenderedImage;
|
||||
|
||||
/**
|
||||
* ComponentGraphics - context for drawing directly to a component,
|
||||
* as this is an X drawable, it requires that we use GTK locks.
|
||||
*
|
||||
* This context draws directly to the drawable and requires xrender.
|
||||
*/
|
||||
public class ComponentGraphics extends CairoGraphics2D
|
||||
{
|
||||
private GtkComponentPeer component;
|
||||
protected long cairo_t;
|
||||
|
||||
ComponentGraphics()
|
||||
{
|
||||
}
|
||||
|
||||
private ComponentGraphics(GtkComponentPeer component)
|
||||
{
|
||||
this.component = component;
|
||||
cairo_t = initState(component);
|
||||
setup( cairo_t );
|
||||
Rectangle bounds = component.awtComponent.getBounds();
|
||||
setClip( new Rectangle( 0, 0, bounds.width, bounds.height) );
|
||||
setBackground(component.awtComponent.getBackground());
|
||||
setColor(component.awtComponent.getForeground());
|
||||
}
|
||||
|
||||
private ComponentGraphics(ComponentGraphics cg)
|
||||
{
|
||||
component = cg.component;
|
||||
cairo_t = initState(component);
|
||||
copy( cg, cairo_t );
|
||||
Rectangle bounds = component.awtComponent.getBounds();
|
||||
setClip( new Rectangle( 0, 0, bounds.width, bounds.height) );
|
||||
setBackground(component.awtComponent.getBackground());
|
||||
setColor(component.awtComponent.getForeground());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a cairo_t for the component surface and return it.
|
||||
*/
|
||||
private native long initState(GtkComponentPeer component);
|
||||
|
||||
/**
|
||||
* Destroys the component surface and calls dispose on the cairo
|
||||
* graphics2d to destroy any super class resources.
|
||||
*/
|
||||
public void dispose()
|
||||
{
|
||||
disposeSurface(nativePointer);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroys the component surface.
|
||||
*/
|
||||
private native void disposeSurface(long nativePointer);
|
||||
|
||||
/**
|
||||
* Creates a cairo_t for a volatile image
|
||||
*/
|
||||
protected native long initFromVolatile( long pixmapPtr, int width, int height);
|
||||
|
||||
/**
|
||||
* Grab lock
|
||||
*/
|
||||
private native void start_gdk_drawing();
|
||||
|
||||
/**
|
||||
* Release lock
|
||||
*/
|
||||
private native void end_gdk_drawing();
|
||||
|
||||
/**
|
||||
* Query if the system has the XRender extension.
|
||||
*/
|
||||
public static native boolean hasXRender();
|
||||
|
||||
|
||||
private native void copyAreaNative(GtkComponentPeer component, int x, int y,
|
||||
int width, int height, int dx, int dy);
|
||||
|
||||
private native void drawVolatile(GtkComponentPeer component,
|
||||
Image vimg, int x, int y,
|
||||
int width, int height);
|
||||
|
||||
/**
|
||||
* Returns a Graphics2D object for a component, either an instance of this
|
||||
* class (if xrender is supported), or a context which copies.
|
||||
*/
|
||||
public static Graphics2D getComponentGraphics(GtkComponentPeer component)
|
||||
{
|
||||
if( hasXRender() )
|
||||
return new ComponentGraphics(component);
|
||||
|
||||
Rectangle r = component.awtComponent.getBounds();
|
||||
return new ComponentGraphicsCopy(r.width, r.height, component);
|
||||
}
|
||||
|
||||
public GraphicsConfiguration getDeviceConfiguration()
|
||||
{
|
||||
return component.getGraphicsConfiguration();
|
||||
}
|
||||
|
||||
public Graphics create()
|
||||
{
|
||||
return new ComponentGraphics(this);
|
||||
}
|
||||
|
||||
protected Rectangle2D getRealBounds()
|
||||
{
|
||||
return component.awtComponent.getBounds();
|
||||
}
|
||||
|
||||
public void copyAreaImpl(int x, int y, int width, int height, int dx, int dy)
|
||||
{
|
||||
copyAreaNative(component, x, y, width, height, dx, dy);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overloaded methods that do actual drawing need to enter the gdk threads
|
||||
* and also do certain things before and after.
|
||||
*/
|
||||
public void draw(Shape s)
|
||||
{
|
||||
start_gdk_drawing();
|
||||
super.draw(s);
|
||||
end_gdk_drawing();
|
||||
}
|
||||
|
||||
public void fill(Shape s)
|
||||
{
|
||||
start_gdk_drawing();
|
||||
super.fill(s);
|
||||
end_gdk_drawing();
|
||||
}
|
||||
|
||||
public void drawRenderedImage(RenderedImage image, AffineTransform xform)
|
||||
{
|
||||
start_gdk_drawing();
|
||||
super.drawRenderedImage(image, xform);
|
||||
end_gdk_drawing();
|
||||
}
|
||||
|
||||
protected boolean drawImage(Image img, AffineTransform xform,
|
||||
Color bgcolor, ImageObserver obs)
|
||||
{
|
||||
start_gdk_drawing();
|
||||
boolean rv = super.drawImage(img, xform, bgcolor, obs);
|
||||
end_gdk_drawing();
|
||||
return rv;
|
||||
}
|
||||
|
||||
public void drawGlyphVector(GlyphVector gv, float x, float y)
|
||||
{
|
||||
start_gdk_drawing();
|
||||
super.drawGlyphVector(gv, x, y);
|
||||
end_gdk_drawing();
|
||||
}
|
||||
|
||||
public boolean drawImage(Image img, int x, int y, ImageObserver observer)
|
||||
{
|
||||
if( img instanceof GtkVolatileImage )
|
||||
{
|
||||
drawVolatile( component, img, x, y - 20,
|
||||
((GtkVolatileImage)img).width,
|
||||
((GtkVolatileImage)img).height );
|
||||
return true;
|
||||
}
|
||||
return super.drawImage( img, x, y, observer );
|
||||
}
|
||||
|
||||
public boolean drawImage(Image img, int x, int y, int width, int height,
|
||||
ImageObserver observer)
|
||||
{
|
||||
if( img instanceof GtkVolatileImage )
|
||||
{
|
||||
drawVolatile( component, img, x, y - 20,
|
||||
width, height );
|
||||
return true;
|
||||
}
|
||||
return super.drawImage( img, x, y, width, height, observer );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
/* ComponentGraphicsCopy.java
|
||||
Copyright (C) 2006 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 gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.font.GlyphVector;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.awt.image.RenderedImage;
|
||||
import java.awt.image.ImageObserver;
|
||||
|
||||
/**
|
||||
* Implementation of Graphics2D for Components for servers which
|
||||
* do not have xrender.
|
||||
*
|
||||
* A mirrored GtkImage of the component is stored in memory
|
||||
* and copied back. Yay.
|
||||
*/
|
||||
public class ComponentGraphicsCopy extends CairoSurfaceGraphics
|
||||
{
|
||||
private GtkComponentPeer component;
|
||||
|
||||
/**
|
||||
* GtkImage sharing its data buffer with this Cairo surface.
|
||||
*/
|
||||
private GtkImage gtkimage;
|
||||
|
||||
private int width, height;
|
||||
|
||||
native void getPixbuf( GtkComponentPeer component, GtkImage image );
|
||||
|
||||
native void copyPixbuf( GtkComponentPeer component, GtkImage image,
|
||||
int x, int y, int w, int h );
|
||||
|
||||
public ComponentGraphicsCopy(int width, int height,
|
||||
GtkComponentPeer component)
|
||||
{
|
||||
super( new CairoSurface( width, height ) );
|
||||
this.component = component;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
gtkimage = surface.getGtkImage();
|
||||
getPixbuf( component, gtkimage );
|
||||
}
|
||||
|
||||
/**
|
||||
* Overloaded methods that do actual drawing need to enter the gdk threads
|
||||
* and also do certain things before and after.
|
||||
*/
|
||||
public void draw(Shape s)
|
||||
{
|
||||
super.draw(s);
|
||||
Rectangle r = s.getBounds();
|
||||
copyPixbuf(component, gtkimage, r.x, r.y, r.width, r.height);
|
||||
}
|
||||
|
||||
public void fill(Shape s)
|
||||
{
|
||||
super.fill(s);
|
||||
Rectangle r = s.getBounds();
|
||||
copyPixbuf(component, gtkimage, r.x, r.y, r.width, r.height);
|
||||
}
|
||||
|
||||
public void drawRenderedImage(RenderedImage image, AffineTransform xform)
|
||||
{
|
||||
super.drawRenderedImage(image, xform);
|
||||
copyPixbuf(component, gtkimage, 0, 0, width, height);
|
||||
}
|
||||
|
||||
protected boolean drawImage(Image img, AffineTransform xform,
|
||||
Color bgcolor, ImageObserver obs)
|
||||
{
|
||||
boolean rv = super.drawImage(img, xform, bgcolor, obs);
|
||||
copyPixbuf(component, gtkimage, 0, 0, width, height);
|
||||
return rv;
|
||||
}
|
||||
|
||||
public void drawGlyphVector(GlyphVector gv, float x, float y)
|
||||
{
|
||||
super.drawGlyphVector(gv, x, y);
|
||||
Rectangle r = gv.getPixelBounds(getFontRenderContext(), x , y);
|
||||
copyPixbuf(component, gtkimage, r.x, r.y, r.width, r.height);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,392 @@
|
|||
/* FreetypeGlyphVector.java
|
||||
Copyright (C) 2006 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 gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.awt.Shape;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.geom.GeneralPath;
|
||||
import java.awt.font.GlyphJustificationInfo;
|
||||
import java.awt.font.GlyphMetrics;
|
||||
import java.awt.font.GlyphVector;
|
||||
import java.awt.font.FontRenderContext;
|
||||
|
||||
public class FreetypeGlyphVector extends GlyphVector
|
||||
{
|
||||
/**
|
||||
* The associated font and its peer.
|
||||
*/
|
||||
private Font font;
|
||||
private GdkFontPeer peer; // ATTN: Accessed from native code.
|
||||
|
||||
/**
|
||||
* The string represented by this GlyphVector.
|
||||
*/
|
||||
private String s;
|
||||
|
||||
/**
|
||||
* The font render context
|
||||
*/
|
||||
private FontRenderContext frc;
|
||||
|
||||
/**
|
||||
* The total # of glyphs.
|
||||
*/
|
||||
private int nGlyphs;
|
||||
|
||||
/**
|
||||
* The glyph codes
|
||||
*/
|
||||
private int[] glyphCodes;
|
||||
|
||||
/**
|
||||
* Glyph transforms. (de facto only the translation is used)
|
||||
*/
|
||||
private AffineTransform[] glyphTransforms;
|
||||
|
||||
/**
|
||||
* Create a glyphvector from a given (Freetype) font and a String.
|
||||
*/
|
||||
public FreetypeGlyphVector(Font f, String s, FontRenderContext frc)
|
||||
{
|
||||
this.s = s;
|
||||
this.font = f;
|
||||
this.frc = frc;
|
||||
if( !(font.getPeer() instanceof GdkFontPeer ) )
|
||||
throw new IllegalArgumentException("Not a valid font.");
|
||||
peer = (GdkFontPeer)font.getPeer();
|
||||
|
||||
getGlyphs();
|
||||
performDefaultLayout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a glyphvector from a given set of glyph codes.
|
||||
*/
|
||||
public FreetypeGlyphVector(Font f, int[] codes, FontRenderContext frc)
|
||||
{
|
||||
this.font = f;
|
||||
this.frc = frc;
|
||||
if( !(font.getPeer() instanceof GdkFontPeer ) )
|
||||
throw new IllegalArgumentException("Not a valid font.");
|
||||
peer = (GdkFontPeer)font.getPeer();
|
||||
|
||||
glyphCodes = new int[ codes.length ];
|
||||
System.arraycopy(codes, 0, glyphCodes, 0, codes.length);
|
||||
nGlyphs = glyphCodes.length;
|
||||
performDefaultLayout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the array of glyph codes.
|
||||
*/
|
||||
private void getGlyphs()
|
||||
{
|
||||
nGlyphs = s.codePointCount( 0, s.length() );
|
||||
glyphCodes = new int[ nGlyphs ];
|
||||
int stringIndex = 0;
|
||||
for(int i = 0; i < nGlyphs; i++)
|
||||
{
|
||||
glyphCodes[i] = getGlyph( s.codePointAt(stringIndex) );
|
||||
// UTF32 surrogate handling
|
||||
if( s.codePointAt( stringIndex ) != (int)s.charAt( stringIndex ) )
|
||||
stringIndex ++;
|
||||
stringIndex ++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the glyph code within the font for a given character
|
||||
*/
|
||||
public native int getGlyph(int codepoint);
|
||||
|
||||
/**
|
||||
* Returns the kerning of a glyph pair
|
||||
*/
|
||||
private native Point2D getKerning(int leftGlyph, int rightGlyph);
|
||||
|
||||
private native double[] getMetricsNative( int glyphCode );
|
||||
|
||||
private native GeneralPath getGlyphOutlineNative(int glyphIndex);
|
||||
|
||||
/**
|
||||
* Duh, compares two instances.
|
||||
*/
|
||||
public boolean equals(GlyphVector gv)
|
||||
{
|
||||
if( ! (gv instanceof FreetypeGlyphVector) )
|
||||
return false;
|
||||
|
||||
return (((FreetypeGlyphVector)gv).font.equals(font) &&
|
||||
((FreetypeGlyphVector)gv).frc.equals(frc)
|
||||
&& ((FreetypeGlyphVector)gv).s.equals(s));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the associated Font
|
||||
*/
|
||||
public Font getFont()
|
||||
{
|
||||
return font;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the associated FontRenderContext
|
||||
*/
|
||||
public FontRenderContext getFontRenderContext()
|
||||
{
|
||||
return frc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Layout the glyphs.
|
||||
*/
|
||||
public void performDefaultLayout()
|
||||
{
|
||||
glyphTransforms = new AffineTransform[ nGlyphs ];
|
||||
double x = 0;
|
||||
for(int i = 0; i < nGlyphs; i++)
|
||||
{
|
||||
GlyphMetrics gm = getGlyphMetrics( i );
|
||||
Rectangle2D r = gm.getBounds2D();
|
||||
glyphTransforms[ i ] = AffineTransform.getTranslateInstance(x, 0);
|
||||
x += gm.getAdvanceX();
|
||||
if( i > 0 )
|
||||
{
|
||||
Point2D p = getKerning( glyphCodes[ i - 1 ], glyphCodes[ i ] );
|
||||
x += p.getX();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the code of the glyph at glyphIndex;
|
||||
*/
|
||||
public int getGlyphCode(int glyphIndex)
|
||||
{
|
||||
return glyphCodes[ glyphIndex ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns multiple glyphcodes.
|
||||
*/
|
||||
public int[] getGlyphCodes(int beginGlyphIndex, int numEntries,
|
||||
int[] codeReturn)
|
||||
{
|
||||
int[] rval;
|
||||
|
||||
if( codeReturn == null )
|
||||
rval = new int[ numEntries ];
|
||||
else
|
||||
rval = codeReturn;
|
||||
|
||||
System.arraycopy(glyphCodes, beginGlyphIndex, rval, 0, numEntries);
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* FIXME: Implement me.
|
||||
*/
|
||||
public Shape getGlyphLogicalBounds(int glyphIndex)
|
||||
{
|
||||
GlyphMetrics gm = getGlyphMetrics( glyphIndex );
|
||||
if( gm == null )
|
||||
return null;
|
||||
Rectangle2D r = gm.getBounds2D();
|
||||
return new Rectangle2D.Double( r.getX() - gm.getLSB(), r.getY(),
|
||||
gm.getAdvanceX(), r.getHeight() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the metrics of a single glyph.
|
||||
*/
|
||||
public GlyphMetrics getGlyphMetrics(int glyphIndex)
|
||||
{
|
||||
double[] val = getMetricsNative( glyphCodes[ glyphIndex ] );
|
||||
if( val == null )
|
||||
return null;
|
||||
|
||||
return new GlyphMetrics( true, (float)val[1], (float)val[2],
|
||||
new Rectangle2D.Double( val[3], val[4],
|
||||
val[5], val[6] ),
|
||||
GlyphMetrics.STANDARD );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the outline of a single glyph.
|
||||
*/
|
||||
public Shape getGlyphOutline(int glyphIndex)
|
||||
{
|
||||
GeneralPath gp = getGlyphOutlineNative( glyphCodes[ glyphIndex ] );
|
||||
gp.transform( glyphTransforms[ glyphIndex ] );
|
||||
return gp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the position of a single glyph.
|
||||
*/
|
||||
public Point2D getGlyphPosition(int glyphIndex)
|
||||
{
|
||||
return glyphTransforms[ glyphIndex ].transform( new Point2D.Double(0, 0),
|
||||
null );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the positions of multiple glyphs.
|
||||
*/
|
||||
public float[] getGlyphPositions(int beginGlyphIndex, int numEntries,
|
||||
float[] positionReturn)
|
||||
{
|
||||
float[] rval;
|
||||
|
||||
if( positionReturn == null )
|
||||
rval = new float[2 * numEntries];
|
||||
else
|
||||
rval = positionReturn;
|
||||
|
||||
for( int i = beginGlyphIndex; i < numEntries; i++ )
|
||||
{
|
||||
Point2D p = getGlyphPosition( i );
|
||||
rval[i * 2] = (float)p.getX();
|
||||
rval[i * 2 + 1] = (float)p.getY();
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the transform of a glyph.
|
||||
*/
|
||||
public AffineTransform getGlyphTransform(int glyphIndex)
|
||||
{
|
||||
return new AffineTransform( glyphTransforms[ glyphIndex ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the visual bounds of a glyph
|
||||
* May be off by a pixel or two due to hinting/rasterization.
|
||||
*/
|
||||
public Shape getGlyphVisualBounds(int glyphIndex)
|
||||
{
|
||||
return getGlyphOutline( glyphIndex ).getBounds2D();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the logical bounds of the whole thing.
|
||||
*/
|
||||
public Rectangle2D getLogicalBounds()
|
||||
{
|
||||
if( nGlyphs == 0 )
|
||||
return new Rectangle2D.Double(0, 0, 0, 0);
|
||||
|
||||
Rectangle2D rect = (Rectangle2D)getGlyphLogicalBounds( 0 );
|
||||
for( int i = 1; i < nGlyphs; i++ )
|
||||
rect = rect.createUnion( (Rectangle2D)getGlyphLogicalBounds( i ) );
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of glyphs.
|
||||
*/
|
||||
public int getNumGlyphs()
|
||||
{
|
||||
return glyphCodes.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the outline of the entire GlyphVector.
|
||||
*/
|
||||
public Shape getOutline()
|
||||
{
|
||||
GeneralPath path = new GeneralPath();
|
||||
for( int i = 0; i < getNumGlyphs(); i++ )
|
||||
path.append( getGlyphOutline( i ), false );
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO:
|
||||
* FreeType does not currently have an API for the JSTF table. We should
|
||||
* probably get the table ourselves from FT and pass it to some parser
|
||||
* which the native font peers will need.
|
||||
*/
|
||||
public GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the outline of the entire vector, drawn at (x,y).
|
||||
*/
|
||||
public Shape getOutline(float x, float y)
|
||||
{
|
||||
AffineTransform tx = AffineTransform.getTranslateInstance( x, y );
|
||||
return tx.createTransformedShape( getOutline() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the visual bounds of the entire GlyphVector.
|
||||
* May be off by a pixel or two due to hinting/rasterization.
|
||||
*/
|
||||
public Rectangle2D getVisualBounds()
|
||||
{
|
||||
return getOutline().getBounds2D();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the position of a glyph.
|
||||
*/
|
||||
public void setGlyphPosition(int glyphIndex, Point2D newPos)
|
||||
{
|
||||
// FIXME: Scaling, etc.?
|
||||
glyphTransforms[ glyphIndex ].setToTranslation( newPos.getX(),
|
||||
newPos.getY() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the transform of a single glyph.
|
||||
*/
|
||||
public void setGlyphTransform(int glyphIndex, AffineTransform newTX)
|
||||
{
|
||||
glyphTransforms[ glyphIndex ].setTransform( newTX );
|
||||
}
|
||||
}
|
|
@ -40,19 +40,23 @@ package gnu.java.awt.peer.gtk;
|
|||
|
||||
import gnu.classpath.Configuration;
|
||||
import gnu.java.awt.peer.ClasspathFontPeer;
|
||||
import gnu.java.awt.font.opentype.NameDecoder;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.font.FontRenderContext;
|
||||
import java.awt.font.GlyphVector;
|
||||
import java.awt.font.GlyphMetrics;
|
||||
import java.awt.font.LineMetrics;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.text.CharacterIterator;
|
||||
import java.text.StringCharacterIterator;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public class GdkFontPeer extends ClasspathFontPeer
|
||||
{
|
||||
|
@ -76,17 +80,21 @@ public class GdkFontPeer extends ClasspathFontPeer
|
|||
}
|
||||
}
|
||||
|
||||
private ByteBuffer nameTable = null;
|
||||
|
||||
private native void initState ();
|
||||
private native void dispose ();
|
||||
private native void setFont (String family, int style, int size, boolean useGraphics2D);
|
||||
private native void setFont (String family, int style, int size);
|
||||
|
||||
native void getFontMetrics(double [] metrics);
|
||||
native void getTextMetrics(String str, double [] metrics);
|
||||
|
||||
native void releasePeerGraphicsResource();
|
||||
|
||||
|
||||
protected void finalize ()
|
||||
{
|
||||
if (GtkToolkit.useGraphics2D ())
|
||||
GdkGraphics2D.releasePeerGraphicsResource(this);
|
||||
releasePeerGraphicsResource();
|
||||
dispose ();
|
||||
}
|
||||
|
||||
|
@ -136,26 +144,84 @@ public class GdkFontPeer extends ClasspathFontPeer
|
|||
{
|
||||
super(name, style, size);
|
||||
initState ();
|
||||
setFont (this.familyName, this.style, (int)this.size,
|
||||
GtkToolkit.useGraphics2D());
|
||||
setFont (this.familyName, this.style, (int)this.size);
|
||||
}
|
||||
|
||||
public GdkFontPeer (String name, Map attributes)
|
||||
{
|
||||
super(name, attributes);
|
||||
initState ();
|
||||
setFont (this.familyName, this.style, (int)this.size,
|
||||
GtkToolkit.useGraphics2D());
|
||||
}
|
||||
|
||||
public String getSubFamilyName(Font font, Locale locale)
|
||||
{
|
||||
return null;
|
||||
setFont (this.familyName, this.style, (int)this.size);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unneeded, but implemented anyway.
|
||||
*/
|
||||
public String getSubFamilyName(Font font, Locale locale)
|
||||
{
|
||||
String name;
|
||||
|
||||
if (locale == null)
|
||||
locale = Locale.getDefault();
|
||||
|
||||
name = getName(NameDecoder.NAME_SUBFAMILY, locale);
|
||||
if (name == null)
|
||||
{
|
||||
name = getName(NameDecoder.NAME_SUBFAMILY, Locale.ENGLISH);
|
||||
if ("Regular".equals(name))
|
||||
name = null;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bytes belonging to a TrueType/OpenType table,
|
||||
* Parameters n,a,m,e identify the 4-byte ASCII tag of the table.
|
||||
*
|
||||
* Returns null if the font is not TT, the table is nonexistant,
|
||||
* or if some other unexpected error occured.
|
||||
*
|
||||
*/
|
||||
private native byte[] getTrueTypeTable(byte n, byte a, byte m, byte e);
|
||||
|
||||
/**
|
||||
* Returns the PostScript name of the font, defaults to the familyName if
|
||||
* a PS name could not be retrieved.
|
||||
*/
|
||||
public String getPostScriptName(Font font)
|
||||
{
|
||||
return this.familyName;
|
||||
String name = getName(NameDecoder.NAME_POSTSCRIPT,
|
||||
/* any language */ null);
|
||||
if( name == null )
|
||||
return this.familyName;
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts a String from the font’s name table.
|
||||
*
|
||||
* @param name the numeric TrueType or OpenType name ID.
|
||||
*
|
||||
* @param locale the locale for which names shall be localized, or
|
||||
* <code>null</code> if the locale does mot matter because the name
|
||||
* is known to be language-independent (for example, because it is
|
||||
* the PostScript name).
|
||||
*/
|
||||
private String getName(int name, Locale locale)
|
||||
{
|
||||
if (nameTable == null)
|
||||
{
|
||||
byte[] data = getTrueTypeTable((byte)'n', (byte) 'a',
|
||||
(byte) 'm', (byte) 'e');
|
||||
if( data == null )
|
||||
return null;
|
||||
|
||||
nameTable = ByteBuffer.wrap( data );
|
||||
}
|
||||
|
||||
return NameDecoder.getName(nameTable, name, locale);
|
||||
}
|
||||
|
||||
public boolean canDisplay (Font font, char c)
|
||||
|
@ -170,23 +236,18 @@ public class GdkFontPeer extends ClasspathFontPeer
|
|||
return -1;
|
||||
}
|
||||
|
||||
private native GdkGlyphVector getGlyphVector(String txt,
|
||||
Font f,
|
||||
FontRenderContext ctx);
|
||||
|
||||
public GlyphVector createGlyphVector (Font font,
|
||||
FontRenderContext ctx,
|
||||
CharacterIterator i)
|
||||
{
|
||||
return getGlyphVector(buildString (i), font, ctx);
|
||||
return new FreetypeGlyphVector(font, buildString (i), ctx);
|
||||
}
|
||||
|
||||
public GlyphVector createGlyphVector (Font font,
|
||||
FontRenderContext ctx,
|
||||
int[] glyphCodes)
|
||||
{
|
||||
return null;
|
||||
// return new GdkGlyphVector (font, this, ctx, glyphCodes);
|
||||
return new FreetypeGlyphVector(font, glyphCodes, ctx);
|
||||
}
|
||||
|
||||
public byte getBaselineFor (Font font, char c)
|
||||
|
@ -262,13 +323,21 @@ public class GdkFontPeer extends ClasspathFontPeer
|
|||
|
||||
public int getNumGlyphs (Font font)
|
||||
{
|
||||
throw new UnsupportedOperationException ();
|
||||
byte[] data = getTrueTypeTable((byte)'m', (byte) 'a',
|
||||
(byte)'x', (byte) 'p');
|
||||
if( data == null )
|
||||
return -1;
|
||||
|
||||
ByteBuffer buf = ByteBuffer.wrap( data );
|
||||
return buf.getShort(4);
|
||||
}
|
||||
|
||||
public Rectangle2D getStringBounds (Font font, CharacterIterator ci,
|
||||
int begin, int limit, FontRenderContext frc)
|
||||
{
|
||||
GdkGlyphVector gv = getGlyphVector(buildString (ci, begin, limit), font, frc);
|
||||
GlyphVector gv = new FreetypeGlyphVector( font,
|
||||
buildString(ci, begin, limit),
|
||||
frc);
|
||||
return gv.getVisualBounds();
|
||||
}
|
||||
|
||||
|
@ -303,5 +372,4 @@ public class GdkFontPeer extends ClasspathFontPeer
|
|||
// the metrics cache.
|
||||
return Toolkit.getDefaultToolkit().getFontMetrics (font);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,359 +0,0 @@
|
|||
/* GdkGlyphVector.java -- Glyph vector object
|
||||
Copyright (C) 2003, 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 gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.font.FontRenderContext;
|
||||
import java.awt.font.GlyphJustificationInfo;
|
||||
import java.awt.font.GlyphMetrics;
|
||||
import java.awt.font.GlyphVector;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
public class GdkGlyphVector extends GlyphVector
|
||||
{
|
||||
|
||||
/* We use a simple representation for glyph vectors here. Glyph i
|
||||
* consumes 8 doubles:
|
||||
*
|
||||
* logical x: extents[ 10*i ]
|
||||
* logical y: extents[ 10*i + 1 ]
|
||||
* logical width: extents[ 10*i + 2 ]
|
||||
* logical height: extents[ 10*i + 3 ]
|
||||
*
|
||||
* visual x: extents[ 10*i + 4 ]
|
||||
* visual y: extents[ 10*i + 5 ]
|
||||
* visual width: extents[ 10*i + 6 ]
|
||||
* visual height: extents[ 10*i + 7 ]
|
||||
*
|
||||
* origin pos x: extents[ 10*i + 8 ]
|
||||
* origin pos y: extents[ 10*i + 9 ]
|
||||
*
|
||||
* as well as one int, code[i], representing the glyph code in the font.
|
||||
*/
|
||||
|
||||
double [] extents;
|
||||
int [] codes;
|
||||
|
||||
Font font;
|
||||
FontRenderContext fontRenderContext;
|
||||
|
||||
Rectangle2D allLogical;
|
||||
Rectangle2D allVisual;
|
||||
|
||||
public GdkGlyphVector(double[] extents, int[] codes, Font font, FontRenderContext frc)
|
||||
{
|
||||
this.extents = extents;
|
||||
this.codes = codes;
|
||||
this.font = font;
|
||||
this.fontRenderContext = frc;
|
||||
|
||||
allLogical = new Rectangle2D.Double();
|
||||
allVisual = new Rectangle2D.Double();
|
||||
|
||||
for (int i = 0; i < codes.length; ++i)
|
||||
{
|
||||
allLogical.add (new Rectangle2D.Double(extents[10*i ] + extents[10*i + 8],
|
||||
extents[10*i + 1] + extents[10*i + 9],
|
||||
extents[10*i + 2],
|
||||
extents[10*i + 3]));
|
||||
|
||||
allVisual.add (new Rectangle2D.Double(extents[10*i + 4] + extents[10*i + 8],
|
||||
extents[10*i + 5] + extents[10*i + 9],
|
||||
extents[10*i + 6],
|
||||
extents[10*i + 7]));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
geometric notes:
|
||||
|
||||
the FRC contains a mapping from points -> pixels.
|
||||
|
||||
typographics points are typically 1/72 of an inch.
|
||||
|
||||
pixel displays are often around 72 dpi.
|
||||
|
||||
so the FRC can get away with using an identity transform on a screen,
|
||||
often. behavior is documented by sun to fall back to an identity
|
||||
transform if the internal transformation is null.
|
||||
|
||||
coordinates coming up from pango are expressed as floats -- in device
|
||||
space, so basically pixels-with-fractional-bits -- derived from their
|
||||
storage format in pango (1024ths of pixels).
|
||||
|
||||
it is not clear from the javadocs whether the results of methods like
|
||||
getGlyphPositions ought to return coordinates in device space, or
|
||||
"point" space, or what. for now I'm returning them in device space.
|
||||
|
||||
*/
|
||||
|
||||
public double[] getExtents()
|
||||
{
|
||||
return extents;
|
||||
}
|
||||
|
||||
public int[] getCodes()
|
||||
{
|
||||
return codes;
|
||||
}
|
||||
|
||||
public Font getFont ()
|
||||
{
|
||||
return font;
|
||||
}
|
||||
|
||||
public FontRenderContext getFontRenderContext ()
|
||||
{
|
||||
return fontRenderContext;
|
||||
}
|
||||
|
||||
public int getGlyphCharIndex (int glyphIndex)
|
||||
{
|
||||
// FIXME: currently pango does not provide glyph-by-glyph
|
||||
// reverse mapping information, so we assume a broken 1:1
|
||||
// glyph model here. This is plainly wrong.
|
||||
return glyphIndex;
|
||||
}
|
||||
|
||||
public int[] getGlyphCharIndices (int beginGlyphIndex,
|
||||
int numEntries,
|
||||
int[] codeReturn)
|
||||
{
|
||||
int ix[] = codeReturn;
|
||||
if (ix == null)
|
||||
ix = new int[numEntries];
|
||||
|
||||
for (int i = 0; i < numEntries; i++)
|
||||
ix[i] = getGlyphCharIndex (beginGlyphIndex + i);
|
||||
return ix;
|
||||
}
|
||||
|
||||
public int getGlyphCode (int glyphIndex)
|
||||
{
|
||||
return codes[glyphIndex];
|
||||
}
|
||||
|
||||
public int[] getGlyphCodes (int beginGlyphIndex, int numEntries,
|
||||
int[] codeReturn)
|
||||
{
|
||||
if (codeReturn == null)
|
||||
codeReturn = new int[numEntries];
|
||||
|
||||
System.arraycopy(codes, beginGlyphIndex, codeReturn, 0, numEntries);
|
||||
return codeReturn;
|
||||
}
|
||||
|
||||
public Shape getGlyphLogicalBounds (int i)
|
||||
{
|
||||
return new Rectangle2D.Double (extents[8*i], extents[8*i + 1],
|
||||
extents[8*i + 2], extents[8*i + 3]);
|
||||
}
|
||||
|
||||
public GlyphMetrics getGlyphMetrics (int i)
|
||||
{
|
||||
// FIXME: pango does not yield vertical layout information at the
|
||||
// moment.
|
||||
|
||||
boolean is_horizontal = true;
|
||||
double advanceX = extents[8*i + 2]; // "logical width" == advanceX
|
||||
double advanceY = 0;
|
||||
|
||||
return new GlyphMetrics (is_horizontal,
|
||||
(float) advanceX, (float) advanceY,
|
||||
(Rectangle2D) getGlyphVisualBounds(i),
|
||||
GlyphMetrics.STANDARD);
|
||||
}
|
||||
|
||||
public Shape getGlyphOutline (int glyphIndex)
|
||||
{
|
||||
throw new UnsupportedOperationException ();
|
||||
}
|
||||
|
||||
public Shape getGlyphOutline (int glyphIndex, float x, float y)
|
||||
{
|
||||
throw new UnsupportedOperationException ();
|
||||
}
|
||||
|
||||
public Rectangle getGlyphPixelBounds (int i,
|
||||
FontRenderContext renderFRC,
|
||||
float x, float y)
|
||||
{
|
||||
return new Rectangle((int) x, (int) y,
|
||||
(int) extents[8*i + 6], (int) extents[8*i + 7]);
|
||||
}
|
||||
|
||||
public Point2D getGlyphPosition (int i)
|
||||
{
|
||||
return new Point2D.Double (extents[10*i + 8],
|
||||
extents[10*i + 9]);
|
||||
}
|
||||
|
||||
public float[] getGlyphPositions (int beginGlyphIndex,
|
||||
int numEntries,
|
||||
float[] positionReturn)
|
||||
{
|
||||
float fx[] = positionReturn;
|
||||
if (fx == null)
|
||||
fx = new float[numEntries * 2];
|
||||
|
||||
for (int i = 0; i < numEntries; ++i)
|
||||
{
|
||||
fx[2*i ] = (float) extents[10*i + 8];
|
||||
fx[2*i + 1] = (float) extents[10*i + 9];
|
||||
}
|
||||
return fx;
|
||||
}
|
||||
|
||||
public AffineTransform getGlyphTransform (int glyphIndex)
|
||||
{
|
||||
// Glyphs don't have independent transforms in these simple glyph
|
||||
// vectors; docs specify null is an ok return here.
|
||||
return null;
|
||||
}
|
||||
|
||||
public Shape getGlyphVisualBounds (int i)
|
||||
{
|
||||
return new Rectangle2D.Double(extents[8*i + 4], extents[8*i + 5],
|
||||
extents[8*i + 6], extents[8*i + 7]);
|
||||
}
|
||||
|
||||
public int getLayoutFlags ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Rectangle2D getLogicalBounds ()
|
||||
{
|
||||
return allLogical;
|
||||
}
|
||||
|
||||
public int getNumGlyphs ()
|
||||
{
|
||||
return codes.length;
|
||||
}
|
||||
|
||||
public Shape getOutline ()
|
||||
{
|
||||
throw new UnsupportedOperationException ();
|
||||
}
|
||||
|
||||
public Rectangle getPixelBounds (FontRenderContext renderFRC,
|
||||
float x, float y)
|
||||
{
|
||||
return new Rectangle((int)x,
|
||||
(int)y,
|
||||
(int) allVisual.getWidth(),
|
||||
(int) allVisual.getHeight());
|
||||
}
|
||||
|
||||
public Rectangle2D getVisualBounds ()
|
||||
{
|
||||
return allVisual;
|
||||
}
|
||||
|
||||
public void performDefaultLayout ()
|
||||
{
|
||||
}
|
||||
|
||||
public void setGlyphPosition (int i, Point2D newPos)
|
||||
{
|
||||
extents[8*i ] = newPos.getX();
|
||||
extents[8*i + 1] = newPos.getY();
|
||||
|
||||
extents[8*i + 4] = newPos.getX();
|
||||
extents[8*i + 5] = newPos.getY();
|
||||
}
|
||||
|
||||
public void setGlyphTransform (int glyphIndex,
|
||||
AffineTransform newTX)
|
||||
{
|
||||
// not yet.. maybe not ever?
|
||||
throw new UnsupportedOperationException ();
|
||||
}
|
||||
|
||||
public boolean equals(GlyphVector gv)
|
||||
{
|
||||
if (gv == null)
|
||||
return false;
|
||||
|
||||
if (! (gv instanceof GdkGlyphVector))
|
||||
return false;
|
||||
|
||||
GdkGlyphVector ggv = (GdkGlyphVector) gv;
|
||||
|
||||
if ((ggv.codes.length != this.codes.length)
|
||||
|| (ggv.extents.length != this.extents.length))
|
||||
return false;
|
||||
|
||||
if ((ggv.font == null && this.font != null)
|
||||
|| (ggv.font != null && this.font == null)
|
||||
|| (!ggv.font.equals(this.font)))
|
||||
return false;
|
||||
|
||||
if ((ggv.fontRenderContext == null && this.fontRenderContext != null)
|
||||
|| (ggv.fontRenderContext != null && this.fontRenderContext == null)
|
||||
|| (!ggv.fontRenderContext.equals(this.fontRenderContext)))
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < ggv.codes.length; ++i)
|
||||
if (ggv.codes[i] != this.codes[i])
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < ggv.extents.length; ++i)
|
||||
if (ggv.extents[i] != this.extents[i])
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public GlyphJustificationInfo getGlyphJustificationInfo(int idx)
|
||||
{
|
||||
throw new UnsupportedOperationException ();
|
||||
}
|
||||
|
||||
public Shape getOutline(float x, float y)
|
||||
{
|
||||
throw new UnsupportedOperationException ();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,494 +0,0 @@
|
|||
/* GdkGraphics.java
|
||||
Copyright (C) 1998, 1999, 2002, 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 gnu.java.awt.peer.gtk;
|
||||
|
||||
import gnu.classpath.Configuration;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Image;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.text.AttributedCharacterIterator;
|
||||
|
||||
public class GdkGraphics extends Graphics
|
||||
{
|
||||
static
|
||||
{
|
||||
System.loadLibrary("gtkpeer");
|
||||
|
||||
initStaticState ();
|
||||
}
|
||||
|
||||
static native void initStaticState();
|
||||
private final int native_state = GtkGenericPeer.getUniqueInteger ();
|
||||
|
||||
Color color, xorColor;
|
||||
GtkComponentPeer component;
|
||||
Font font = new Font ("Dialog", Font.PLAIN, 12);
|
||||
Rectangle clip;
|
||||
GtkImage image;
|
||||
|
||||
int xOffset = 0;
|
||||
int yOffset = 0;
|
||||
|
||||
static final int GDK_COPY = 0, GDK_XOR = 2;
|
||||
|
||||
native void initState (GtkComponentPeer component);
|
||||
native void initStateUnlocked (GtkComponentPeer component);
|
||||
native void initState (int width, int height);
|
||||
native void initFromImage (GtkImage image);
|
||||
native void nativeCopyState (GdkGraphics g);
|
||||
|
||||
/**
|
||||
* A cached instance that is used by {@link #create} in order to avoid
|
||||
* massive allocation of graphics contexts.
|
||||
*/
|
||||
GdkGraphics cached = null;
|
||||
|
||||
/**
|
||||
* A link to the parent context. This is used in {@link #dispose} to put
|
||||
* this graphics context into the cache.
|
||||
*/
|
||||
GdkGraphics parent = null;
|
||||
|
||||
GdkGraphics (GdkGraphics g)
|
||||
{
|
||||
parent = g;
|
||||
copyState (g);
|
||||
}
|
||||
|
||||
GdkGraphics (int width, int height)
|
||||
{
|
||||
initState (width, height);
|
||||
color = Color.black;
|
||||
clip = new Rectangle (0, 0, width, height);
|
||||
font = new Font ("Dialog", Font.PLAIN, 12);
|
||||
}
|
||||
|
||||
GdkGraphics (GtkImage image)
|
||||
{
|
||||
this.image = image;
|
||||
initFromImage (image);
|
||||
color = Color.black;
|
||||
clip = new Rectangle (0, 0,
|
||||
image.getWidth(null), image.getHeight(null));
|
||||
font = new Font ("Dialog", Font.PLAIN, 12);
|
||||
}
|
||||
|
||||
GdkGraphics (GtkComponentPeer component)
|
||||
{
|
||||
this.component = component;
|
||||
color = Color.black;
|
||||
|
||||
if (component.isRealized ())
|
||||
initComponentGraphics ();
|
||||
else
|
||||
connectSignals (component);
|
||||
}
|
||||
|
||||
void initComponentGraphics ()
|
||||
{
|
||||
initState (component);
|
||||
color = component.awtComponent.getForeground ();
|
||||
if (color == null)
|
||||
color = Color.BLACK;
|
||||
Dimension d = component.awtComponent.getSize ();
|
||||
clip = new Rectangle (0, 0, d.width, d.height);
|
||||
}
|
||||
|
||||
// called back by native side: realize_cb
|
||||
void initComponentGraphicsUnlocked ()
|
||||
{
|
||||
initStateUnlocked (component);
|
||||
color = component.awtComponent.getForeground ();
|
||||
if (color == null)
|
||||
color = Color.BLACK;
|
||||
Dimension d = component.awtComponent.getSize ();
|
||||
clip = new Rectangle (0, 0, d.width, d.height);
|
||||
}
|
||||
|
||||
native void connectSignals (GtkComponentPeer component);
|
||||
|
||||
public native void clearRect(int x, int y, int width, int height);
|
||||
|
||||
public void clipRect (int x, int y, int width, int height)
|
||||
{
|
||||
if (component != null && ! component.isRealized ())
|
||||
return;
|
||||
|
||||
clip = clip.intersection (new Rectangle (x, y, width, height));
|
||||
setClipRectangle (clip.x, clip.y, clip.width, clip.height);
|
||||
}
|
||||
|
||||
public native void copyArea(int x, int y, int width, int height,
|
||||
int dx, int dy);
|
||||
|
||||
/**
|
||||
* Creates a copy of this GdkGraphics instance. This implementation can
|
||||
* reuse a cached instance to avoid massive instantiation of Graphics objects
|
||||
* during painting.
|
||||
*
|
||||
* @return a copy of this graphics context
|
||||
*/
|
||||
public Graphics create()
|
||||
{
|
||||
GdkGraphics copy = cached;
|
||||
if (copy == null)
|
||||
copy = new GdkGraphics(this);
|
||||
else
|
||||
{
|
||||
copy.copyState(this);
|
||||
cached = null;
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
public native void nativeDispose();
|
||||
|
||||
/**
|
||||
* Disposes this graphics object. This puts this graphics context into the
|
||||
* cache of its parent graphics if there is one.
|
||||
*/
|
||||
public void dispose()
|
||||
{
|
||||
if (parent != null)
|
||||
{
|
||||
parent.cached = this;
|
||||
parent = null;
|
||||
}
|
||||
else
|
||||
nativeDispose();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called when this object gets finalized by the garbage collector.
|
||||
* In addition to {@link Graphics#finalize()} this calls nativeDispose() to
|
||||
* make sure the native resources are freed before the graphics context is
|
||||
* thrown away.
|
||||
*/
|
||||
public void finalize()
|
||||
{
|
||||
super.finalize();
|
||||
nativeDispose();
|
||||
}
|
||||
|
||||
public boolean drawImage (Image img, int x, int y,
|
||||
Color bgcolor, ImageObserver observer)
|
||||
{
|
||||
if (img != null)
|
||||
return drawImage(img, x, y, img.getWidth(null), img.getHeight(null),
|
||||
bgcolor, observer);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean drawImage (Image img, int x, int y, ImageObserver observer)
|
||||
{
|
||||
return drawImage (img, x, y, null, observer);
|
||||
}
|
||||
|
||||
public boolean drawImage(Image img, int x, int y, int width, int height,
|
||||
Color bgcolor, ImageObserver observer)
|
||||
{
|
||||
if (img != null)
|
||||
{
|
||||
if (img instanceof GtkImage)
|
||||
return ((GtkImage) img).drawImage(this, x, y, width, height, bgcolor,
|
||||
observer);
|
||||
return (new GtkImage(img.getSource())).drawImage(this, x, y, width,
|
||||
height, bgcolor,
|
||||
observer);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean drawImage (Image img, int x, int y, int width, int height,
|
||||
ImageObserver observer)
|
||||
{
|
||||
return drawImage (img, x, y, width, height, null, observer);
|
||||
}
|
||||
|
||||
public boolean drawImage (Image img, int dx1, int dy1, int dx2, int dy2,
|
||||
int sx1, int sy1, int sx2, int sy2,
|
||||
Color bgcolor, ImageObserver observer)
|
||||
{
|
||||
if (img != null)
|
||||
{
|
||||
if (img instanceof GtkImage)
|
||||
return ((GtkImage) img).drawImage(this, dx1, dy1, dx2, dy2, sx1, sy1,
|
||||
sx2, sy2, bgcolor, observer);
|
||||
return (new GtkImage(img.getSource())).drawImage(this, dx1, dy1, dx2,
|
||||
dy2, sx1, sy1, sx2,
|
||||
sy2, bgcolor, observer);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean drawImage (Image img, int dx1, int dy1, int dx2, int dy2,
|
||||
int sx1, int sy1, int sx2, int sy2,
|
||||
ImageObserver observer)
|
||||
{
|
||||
return drawImage (img, dx1, dy1, dx2, dy2,
|
||||
sx1, sy1, sx2, sy2,
|
||||
null, observer);
|
||||
}
|
||||
|
||||
public native void drawLine(int x1, int y1, int x2, int y2);
|
||||
|
||||
public native void drawArc(int x, int y, int width, int height,
|
||||
int startAngle, int arcAngle);
|
||||
public native void fillArc(int x, int y, int width, int height,
|
||||
int startAngle, int arcAngle);
|
||||
public native void drawOval(int x, int y, int width, int height);
|
||||
public native void fillOval(int x, int y, int width, int height);
|
||||
|
||||
public native void drawPolygon(int[] xPoints, int[] yPoints, int nPoints);
|
||||
public native void fillPolygon(int[] xPoints, int[] yPoints, int nPoints);
|
||||
|
||||
public native void drawPolyline(int[] xPoints, int[] yPoints, int nPoints);
|
||||
|
||||
public native void drawRect(int x, int y, int width, int height);
|
||||
public native void fillRect(int x, int y, int width, int height);
|
||||
|
||||
GdkFontPeer getFontPeer()
|
||||
{
|
||||
return (GdkFontPeer) getFont().getPeer();
|
||||
}
|
||||
|
||||
native void drawString (GdkFontPeer f, String str, int x, int y);
|
||||
public void drawString (String str, int x, int y)
|
||||
{
|
||||
drawString(getFontPeer(), str, x, y);
|
||||
}
|
||||
|
||||
public void drawString (AttributedCharacterIterator ci, int x, int y)
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
}
|
||||
|
||||
public void drawRoundRect(int x, int y, int width, int height,
|
||||
int arcWidth, int arcHeight)
|
||||
{
|
||||
if (arcWidth > width)
|
||||
arcWidth = width;
|
||||
if (arcHeight > height)
|
||||
arcHeight = height;
|
||||
|
||||
int xx = x + width - arcWidth;
|
||||
int yy = y + height - arcHeight;
|
||||
|
||||
drawArc (x, y, arcWidth, arcHeight, 90, 90);
|
||||
drawArc (xx, y, arcWidth, arcHeight, 0, 90);
|
||||
drawArc (xx, yy, arcWidth, arcHeight, 270, 90);
|
||||
drawArc (x, yy, arcWidth, arcHeight, 180, 90);
|
||||
|
||||
int y1 = y + arcHeight / 2;
|
||||
int y2 = y + height - arcHeight / 2;
|
||||
drawLine (x, y1, x, y2);
|
||||
drawLine (x + width, y1, x + width, y2);
|
||||
|
||||
int x1 = x + arcWidth / 2;
|
||||
int x2 = x + width - arcWidth / 2;
|
||||
drawLine (x1, y, x2, y);
|
||||
drawLine (x1, y + height, x2, y + height);
|
||||
}
|
||||
|
||||
public void fillRoundRect (int x, int y, int width, int height,
|
||||
int arcWidth, int arcHeight)
|
||||
{
|
||||
if (arcWidth > width)
|
||||
arcWidth = width;
|
||||
if (arcHeight > height)
|
||||
arcHeight = height;
|
||||
|
||||
int xx = x + width - arcWidth;
|
||||
int yy = y + height - arcHeight;
|
||||
|
||||
fillArc (x, y, arcWidth, arcHeight, 90, 90);
|
||||
fillArc (xx, y, arcWidth, arcHeight, 0, 90);
|
||||
fillArc (xx, yy, arcWidth, arcHeight, 270, 90);
|
||||
fillArc (x, yy, arcWidth, arcHeight, 180, 90);
|
||||
|
||||
fillRect (x, y + arcHeight / 2, width, height - arcHeight + 1);
|
||||
fillRect (x + arcWidth / 2, y, width - arcWidth + 1, height);
|
||||
}
|
||||
|
||||
public Shape getClip ()
|
||||
{
|
||||
return getClipBounds ();
|
||||
}
|
||||
|
||||
public Rectangle getClipBounds ()
|
||||
{
|
||||
if (clip == null)
|
||||
return null;
|
||||
else
|
||||
return clip.getBounds();
|
||||
}
|
||||
|
||||
public Color getColor ()
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
public Font getFont ()
|
||||
{
|
||||
return font;
|
||||
}
|
||||
|
||||
public FontMetrics getFontMetrics (Font font)
|
||||
{
|
||||
// Get the font metrics through GtkToolkit to take advantage of
|
||||
// the metrics cache.
|
||||
return Toolkit.getDefaultToolkit().getFontMetrics (font);
|
||||
}
|
||||
|
||||
native void setClipRectangle (int x, int y, int width, int height);
|
||||
|
||||
public void setClip (int x, int y, int width, int height)
|
||||
{
|
||||
if ((component != null && ! component.isRealized ())
|
||||
|| clip == null)
|
||||
return;
|
||||
|
||||
clip.x = x;
|
||||
clip.y = y;
|
||||
clip.width = width;
|
||||
clip.height = height;
|
||||
|
||||
setClipRectangle (x, y, width, height);
|
||||
}
|
||||
|
||||
public void setClip (Rectangle clip)
|
||||
{
|
||||
setClip (clip.x, clip.y, clip.width, clip.height);
|
||||
}
|
||||
|
||||
public void setClip (Shape clip)
|
||||
{
|
||||
if (clip == null)
|
||||
{
|
||||
// Reset clipping.
|
||||
Dimension d = component.awtComponent.getSize();
|
||||
setClip(new Rectangle (0, 0, d.width, d.height));
|
||||
}
|
||||
else
|
||||
setClip(clip.getBounds());
|
||||
}
|
||||
|
||||
private native void setFGColor(int red, int green, int blue);
|
||||
|
||||
public void setColor (Color c)
|
||||
{
|
||||
if (c == null)
|
||||
color = Color.BLACK;
|
||||
else
|
||||
color = c;
|
||||
|
||||
if (xorColor == null) /* paint mode */
|
||||
setFGColor (color.getRed (), color.getGreen (), color.getBlue ());
|
||||
else /* xor mode */
|
||||
setFGColor (color.getRed () ^ xorColor.getRed (),
|
||||
color.getGreen () ^ xorColor.getGreen (),
|
||||
color.getBlue () ^ xorColor.getBlue ());
|
||||
}
|
||||
|
||||
public void setFont (Font font)
|
||||
{
|
||||
if (font != null)
|
||||
this.font = font;
|
||||
}
|
||||
|
||||
native void setFunction (int gdk_func);
|
||||
|
||||
public void setPaintMode ()
|
||||
{
|
||||
xorColor = null;
|
||||
|
||||
setFunction (GDK_COPY);
|
||||
setFGColor (color.getRed (), color.getGreen (), color.getBlue ());
|
||||
}
|
||||
|
||||
public void setXORMode (Color c)
|
||||
{
|
||||
xorColor = c;
|
||||
|
||||
setFunction (GDK_XOR);
|
||||
setFGColor (color.getRed () ^ xorColor.getRed (),
|
||||
color.getGreen () ^ xorColor.getGreen (),
|
||||
color.getBlue () ^ xorColor.getBlue ());
|
||||
}
|
||||
|
||||
public native void translateNative(int x, int y);
|
||||
|
||||
public void translate (int x, int y)
|
||||
{
|
||||
if (component != null && ! component.isRealized ())
|
||||
return;
|
||||
|
||||
clip.x -= x;
|
||||
clip.y -= y;
|
||||
|
||||
translateNative (x, y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies over the state of another GdkGraphics to this instance. This is
|
||||
* used by the {@link #GdkGraphics(GdkGraphics)} constructor and the
|
||||
* {@link #create()} method.
|
||||
*
|
||||
* @param g the GdkGraphics object to copy the state from
|
||||
*/
|
||||
private void copyState(GdkGraphics g)
|
||||
{
|
||||
color = g.color;
|
||||
xorColor = g.xorColor;
|
||||
font = g.font;
|
||||
if (font == null)
|
||||
font = new Font ("Dialog", Font.PLAIN, 12);
|
||||
clip = new Rectangle (g.clip);
|
||||
component = g.component;
|
||||
nativeCopyState(g);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/* GdkGraphicsConfiguration.java -- describes characteristics of graphics
|
||||
Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation
|
||||
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 Free Software Foundation
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -42,26 +42,33 @@ import java.awt.GraphicsConfiguration;
|
|||
import java.awt.GraphicsDevice;
|
||||
import java.awt.ImageCapabilities;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.Transparency;
|
||||
|
||||
import java.awt.geom.AffineTransform;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.DirectColorModel;
|
||||
import java.awt.image.VolatileImage;
|
||||
|
||||
public class GdkGraphicsConfiguration
|
||||
extends GraphicsConfiguration
|
||||
{
|
||||
GdkScreenGraphicsDevice gdkScreenGraphicsDevice;
|
||||
ColorModel cm;
|
||||
Rectangle bounds;
|
||||
|
||||
ColorModel opaqueColorModel;
|
||||
|
||||
ColorModel bitmaskColorModel;
|
||||
|
||||
ColorModel translucentColorModel;
|
||||
|
||||
public GdkGraphicsConfiguration(GdkScreenGraphicsDevice dev)
|
||||
{
|
||||
this.gdkScreenGraphicsDevice = dev;
|
||||
cm = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB).getColorModel();
|
||||
bounds = ((GtkToolkit) Toolkit.getDefaultToolkit()).getBounds();
|
||||
gdkScreenGraphicsDevice = dev;
|
||||
|
||||
opaqueColorModel = new DirectColorModel(32, 0xFF0000, 0xFF00, 0xFF, 0);
|
||||
bitmaskColorModel = new DirectColorModel(32, 0xFF0000, 0xFF00, 0xFF, 0x1000000);
|
||||
translucentColorModel = new DirectColorModel(32, 0xFF0000, 0xFF00, 0xFF, 0xFF000000);
|
||||
}
|
||||
|
||||
public GraphicsDevice getDevice()
|
||||
|
@ -94,12 +101,21 @@ public class GdkGraphicsConfiguration
|
|||
|
||||
public ColorModel getColorModel()
|
||||
{
|
||||
return cm;
|
||||
return opaqueColorModel;
|
||||
}
|
||||
|
||||
public ColorModel getColorModel(int transparency)
|
||||
{
|
||||
return getColorModel();
|
||||
switch (transparency)
|
||||
{
|
||||
case Transparency.OPAQUE:
|
||||
return opaqueColorModel;
|
||||
case Transparency.BITMASK:
|
||||
return bitmaskColorModel;
|
||||
default:
|
||||
case Transparency.TRANSLUCENT:
|
||||
return translucentColorModel;
|
||||
}
|
||||
}
|
||||
|
||||
public AffineTransform getDefaultTransform()
|
||||
|
@ -116,7 +132,7 @@ public class GdkGraphicsConfiguration
|
|||
|
||||
public Rectangle getBounds()
|
||||
{
|
||||
return bounds;
|
||||
return gdkScreenGraphicsDevice.getBounds();
|
||||
}
|
||||
|
||||
public BufferCapabilities getBufferCapabilities()
|
||||
|
@ -133,8 +149,8 @@ public class GdkGraphicsConfiguration
|
|||
|
||||
public VolatileImage createCompatibleVolatileImage(int width, int height, int transparency)
|
||||
{
|
||||
// FIXME: implement
|
||||
return null;
|
||||
// FIXME: support the transparency argument
|
||||
return new GtkVolatileImage(width, height);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* GdkGraphicsEnvironment.java -- information about the graphics environment
|
||||
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -43,33 +43,80 @@ import java.awt.Graphics2D;
|
|||
import java.awt.GraphicsDevice;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.HeadlessException;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.util.Locale;
|
||||
|
||||
public class GdkGraphicsEnvironment extends GraphicsEnvironment
|
||||
{
|
||||
private final int native_state = GtkGenericPeer.getUniqueInteger ();
|
||||
|
||||
private GdkScreenGraphicsDevice defaultDevice;
|
||||
|
||||
private GdkScreenGraphicsDevice[] devices;
|
||||
|
||||
static
|
||||
{
|
||||
System.loadLibrary("gtkpeer");
|
||||
|
||||
initStaticState ();
|
||||
}
|
||||
|
||||
static native void initStaticState();
|
||||
|
||||
public GdkGraphicsEnvironment ()
|
||||
{
|
||||
nativeInitState();
|
||||
}
|
||||
|
||||
native void nativeInitState();
|
||||
|
||||
public GraphicsDevice[] getScreenDevices ()
|
||||
{
|
||||
// FIXME: Support multiple screens, since GDK can.
|
||||
return new GraphicsDevice[] { new GdkScreenGraphicsDevice (this) };
|
||||
if (devices == null)
|
||||
{
|
||||
devices = nativeGetScreenDevices();
|
||||
}
|
||||
|
||||
return (GraphicsDevice[]) devices.clone();
|
||||
}
|
||||
|
||||
private native GdkScreenGraphicsDevice[] nativeGetScreenDevices();
|
||||
|
||||
public GraphicsDevice getDefaultScreenDevice ()
|
||||
{
|
||||
if (GraphicsEnvironment.isHeadless ())
|
||||
throw new HeadlessException ();
|
||||
|
||||
return new GdkScreenGraphicsDevice (this);
|
||||
|
||||
// GCJ LOCAL: workaround a GCJ problem accessing
|
||||
// GdkGraphicsEnvironment.class
|
||||
try
|
||||
{
|
||||
synchronized (Class.forName ("gnu.java.awt.peer.gtk.GdkGraphicsEnvironment"))
|
||||
{
|
||||
if (defaultDevice == null)
|
||||
{
|
||||
defaultDevice = nativeGetDefaultScreenDevice();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return defaultDevice;
|
||||
}
|
||||
|
||||
private native GdkScreenGraphicsDevice nativeGetDefaultScreenDevice();
|
||||
|
||||
public Graphics2D createGraphics (BufferedImage image)
|
||||
{
|
||||
return new GdkGraphics2D (image);
|
||||
DataBuffer db = image.getRaster().getDataBuffer();
|
||||
if(db instanceof CairoSurface)
|
||||
return ((CairoSurface)db).getGraphics();
|
||||
|
||||
return new BufferedImageGraphics( image );
|
||||
}
|
||||
|
||||
private native int nativeGetNumFontFamilies();
|
||||
|
@ -80,20 +127,21 @@ public class GdkGraphicsEnvironment extends GraphicsEnvironment
|
|||
throw new java.lang.UnsupportedOperationException ();
|
||||
}
|
||||
|
||||
public String[] getAvailableFontFamilyNames ()
|
||||
{
|
||||
String[] family_names;
|
||||
int array_size;
|
||||
public String[] getAvailableFontFamilyNames ()
|
||||
{
|
||||
String[] family_names;
|
||||
int array_size;
|
||||
|
||||
array_size = nativeGetNumFontFamilies();
|
||||
family_names = new String[array_size];
|
||||
array_size = nativeGetNumFontFamilies();
|
||||
family_names = new String[array_size];
|
||||
|
||||
nativeGetFontFamilies(family_names);
|
||||
return family_names;
|
||||
}
|
||||
nativeGetFontFamilies(family_names);
|
||||
return family_names;
|
||||
}
|
||||
|
||||
public String[] getAvailableFontFamilyNames (Locale l)
|
||||
{
|
||||
throw new java.lang.UnsupportedOperationException ();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -247,12 +247,23 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
|
|||
public static ImageFormatSpec registerFormat(String name, boolean writable)
|
||||
{
|
||||
ImageFormatSpec ifs = new ImageFormatSpec(name, writable);
|
||||
synchronized(GdkPixbufDecoder.class)
|
||||
|
||||
// GCJ LOCAL: workaround a GCJ problem accessing
|
||||
// GdkPixbufDecoder.class
|
||||
try
|
||||
{
|
||||
synchronized(Class.forName ("gnu.java.awt.peer.gtk.GdkPixbufDecoder"))
|
||||
{
|
||||
if (imageFormatSpecs == null)
|
||||
imageFormatSpecs = new ArrayList();
|
||||
imageFormatSpecs.add(ifs);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return ifs;
|
||||
}
|
||||
|
||||
|
@ -502,19 +513,19 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
|
|||
int width = ras.getWidth();
|
||||
int height = ras.getHeight();
|
||||
ColorModel model = image.getColorModel();
|
||||
int[] pixels = GdkGraphics2D.findSimpleIntegerArray (image.getColorModel(), ras);
|
||||
int[] pixels = CairoGraphics2D.findSimpleIntegerArray (image.getColorModel(), ras);
|
||||
|
||||
if (pixels == null)
|
||||
{
|
||||
BufferedImage img = new BufferedImage(width, height,
|
||||
(model != null && model.hasAlpha() ?
|
||||
BufferedImage.TYPE_INT_ARGB
|
||||
: BufferedImage.TYPE_INT_RGB));
|
||||
BufferedImage img;
|
||||
if(model != null && model.hasAlpha())
|
||||
img = CairoSurface.getBufferedImage(width, height);
|
||||
img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
|
||||
int[] pix = new int[4];
|
||||
for (int y = 0; y < height; ++y)
|
||||
for (int x = 0; x < width; ++x)
|
||||
img.setRGB(x, y, model.getRGB(ras.getPixel(x, y, pix)));
|
||||
pixels = GdkGraphics2D.findSimpleIntegerArray (img.getColorModel(),
|
||||
pixels = CairoGraphics2D.findSimpleIntegerArray (img.getColorModel(),
|
||||
img.getRaster());
|
||||
model = img.getColorModel();
|
||||
}
|
||||
|
@ -584,9 +595,10 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
|
|||
|
||||
if (bufferedImage == null)
|
||||
{
|
||||
bufferedImage = new BufferedImage (width, height, (model != null && model.hasAlpha() ?
|
||||
BufferedImage.TYPE_INT_ARGB
|
||||
: BufferedImage.TYPE_INT_RGB));
|
||||
if(model != null && model.hasAlpha())
|
||||
bufferedImage = new BufferedImage (width, height, BufferedImage.TYPE_INT_ARGB);
|
||||
else
|
||||
bufferedImage = new BufferedImage (width, height, BufferedImage.TYPE_INT_RGB);
|
||||
}
|
||||
|
||||
int pixels2[];
|
||||
|
@ -680,43 +692,4 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
|
|||
return getBufferedImage ();
|
||||
}
|
||||
}
|
||||
|
||||
// remaining helper class and static method is a convenience for the Gtk
|
||||
// peers, for loading a BufferedImage in off a disk file without going
|
||||
// through the whole imageio system.
|
||||
|
||||
public static BufferedImage createBufferedImage (String filename)
|
||||
{
|
||||
GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(),
|
||||
"png", // reader auto-detects, doesn't matter
|
||||
new GdkPixbufDecoder (filename));
|
||||
return r.getBufferedImage ();
|
||||
}
|
||||
|
||||
public static BufferedImage createBufferedImage (URL u)
|
||||
{
|
||||
GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(),
|
||||
"png", // reader auto-detects, doesn't matter
|
||||
new GdkPixbufDecoder (u));
|
||||
return r.getBufferedImage ();
|
||||
}
|
||||
|
||||
public static BufferedImage createBufferedImage (byte[] imagedata, int imageoffset,
|
||||
int imagelength)
|
||||
{
|
||||
GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(),
|
||||
"png", // reader auto-detects, doesn't matter
|
||||
new GdkPixbufDecoder (imagedata,
|
||||
imageoffset,
|
||||
imagelength));
|
||||
return r.getBufferedImage ();
|
||||
}
|
||||
|
||||
public static BufferedImage createBufferedImage (ImageProducer producer)
|
||||
{
|
||||
GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(), "png" /* ignored */, null);
|
||||
producer.startProduction(r);
|
||||
return r.getBufferedImage ();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* GdkScreenGraphicsDevice.java -- information about a screen device
|
||||
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -38,44 +38,110 @@ exception statement from your version. */
|
|||
|
||||
package gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.DisplayMode;
|
||||
import java.awt.Frame;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Window;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class GdkScreenGraphicsDevice extends GraphicsDevice
|
||||
class GdkScreenGraphicsDevice extends GraphicsDevice
|
||||
{
|
||||
private final int native_state = GtkGenericPeer.getUniqueInteger ();
|
||||
|
||||
private Window fullscreenWindow;
|
||||
|
||||
private boolean oldWindowDecorationState;
|
||||
|
||||
private Rectangle oldWindowBounds;
|
||||
|
||||
private Rectangle bounds;
|
||||
|
||||
private GdkGraphicsConfiguration[] configurations;
|
||||
|
||||
/** The <code>GdkGraphicsEnvironment</code> instance that created this
|
||||
* <code>GdkScreenGraphicsDevice</code>. This is only needed for native
|
||||
* methods which need to access the 'native_state' field storing a pointer
|
||||
* to a GdkDisplay object.
|
||||
*/
|
||||
GdkGraphicsEnvironment env;
|
||||
|
||||
/** An identifier that is created by Gdk
|
||||
*/
|
||||
String idString;
|
||||
|
||||
/** The display modes supported by this <code>GdkScreenGraphicsDevice</code>.
|
||||
* If the array is <code>null</code> <code>nativeGetDisplayModes</code> has
|
||||
* to be called.
|
||||
*/
|
||||
X11DisplayMode[] displayModes;
|
||||
|
||||
public GdkScreenGraphicsDevice (GdkGraphicsEnvironment e)
|
||||
{
|
||||
super ();
|
||||
/** The non-changeable display mode of this <code>GdkScreenGraphicsDevice
|
||||
* </code>. This field gets initialized by the {@link #init()} method. If it
|
||||
* is still <code>null</code> afterwards, the XRandR extension is available
|
||||
* and display mode changes are possible. If it is non-null XRandR is not
|
||||
* available, no display mode changes are possible and no other native
|
||||
* method must be called.
|
||||
*/
|
||||
DisplayMode fixedDisplayMode;
|
||||
|
||||
static
|
||||
{
|
||||
System.loadLibrary("gtkpeer");
|
||||
|
||||
initStaticState ();
|
||||
}
|
||||
|
||||
static native void initStaticState();
|
||||
|
||||
GdkScreenGraphicsDevice (GdkGraphicsEnvironment e)
|
||||
{
|
||||
super();
|
||||
env = e;
|
||||
|
||||
configurations = new GdkGraphicsConfiguration[1];
|
||||
configurations[0] = new GdkGraphicsConfiguration(this);
|
||||
}
|
||||
|
||||
/** This method is called from the native side immediately after
|
||||
* the constructor is run.
|
||||
*/
|
||||
void init()
|
||||
{
|
||||
fixedDisplayMode = nativeGetFixedDisplayMode(env);
|
||||
}
|
||||
|
||||
/** Depending on the availability of the XRandR extension the method returns
|
||||
* the screens' non-changeable display mode or null, meaning that XRandR can
|
||||
* handle display mode changes.
|
||||
*/
|
||||
native DisplayMode nativeGetFixedDisplayMode(GdkGraphicsEnvironment env);
|
||||
|
||||
public int getType ()
|
||||
{
|
||||
// Gdk manages only raster screens.
|
||||
return GraphicsDevice.TYPE_RASTER_SCREEN;
|
||||
}
|
||||
|
||||
public String getIDstring ()
|
||||
{
|
||||
// FIXME: query X for this string
|
||||
return "default GDK device ID string";
|
||||
if (idString == null)
|
||||
idString = nativeGetIDString();
|
||||
|
||||
return idString;
|
||||
}
|
||||
|
||||
private native String nativeGetIDString();
|
||||
|
||||
public GraphicsConfiguration[] getConfigurations ()
|
||||
{
|
||||
// FIXME: query X for the list of possible configurations
|
||||
return new GraphicsConfiguration [] { new GdkGraphicsConfiguration(this) };
|
||||
return (GraphicsConfiguration[]) configurations.clone();
|
||||
}
|
||||
|
||||
|
||||
public GraphicsConfiguration getDefaultConfiguration ()
|
||||
{
|
||||
|
||||
// FIXME: query X for default configuration
|
||||
return new GdkGraphicsConfiguration(this);
|
||||
return configurations[0];
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,23 +155,193 @@ public class GdkScreenGraphicsDevice extends GraphicsDevice
|
|||
*/
|
||||
public DisplayMode getDisplayMode()
|
||||
{
|
||||
// determine display mode
|
||||
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
DisplayMode mode = new DisplayMode(dim.width, dim.height, 0,
|
||||
DisplayMode.REFRESH_RATE_UNKNOWN);
|
||||
return mode;
|
||||
if (fixedDisplayMode != null)
|
||||
return fixedDisplayMode;
|
||||
|
||||
synchronized (this)
|
||||
{
|
||||
if (displayModes == null)
|
||||
displayModes = nativeGetDisplayModes(env);
|
||||
}
|
||||
|
||||
int index = nativeGetDisplayModeIndex(env);
|
||||
int rate = nativeGetDisplayModeRate(env);
|
||||
|
||||
return new DisplayMode(displayModes[index].width,
|
||||
displayModes[index].height,
|
||||
DisplayMode.BIT_DEPTH_MULTI,
|
||||
rate);
|
||||
}
|
||||
|
||||
native int nativeGetDisplayModeIndex(GdkGraphicsEnvironment env);
|
||||
|
||||
native int nativeGetDisplayModeRate(GdkGraphicsEnvironment env);
|
||||
|
||||
public DisplayMode[] getDisplayModes()
|
||||
{
|
||||
if (fixedDisplayMode != null)
|
||||
return new DisplayMode[] { fixedDisplayMode };
|
||||
|
||||
synchronized (this)
|
||||
{
|
||||
if (displayModes == null)
|
||||
displayModes = nativeGetDisplayModes(env);
|
||||
}
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
for(int i=0;i<displayModes.length;i++)
|
||||
for(int j=0;j<displayModes[i].rates.length;j++)
|
||||
list.add(new DisplayMode(displayModes[i].width,
|
||||
displayModes[i].height,
|
||||
DisplayMode.BIT_DEPTH_MULTI,
|
||||
displayModes[i].rates[j]));
|
||||
|
||||
return (DisplayMode[]) list.toArray(new DisplayMode[list.size()]);
|
||||
}
|
||||
|
||||
native X11DisplayMode[] nativeGetDisplayModes(GdkGraphicsEnvironment env);
|
||||
|
||||
/**
|
||||
* This device does not yet support fullscreen exclusive mode, so this
|
||||
* returns <code>false</code>.
|
||||
* Real fullscreen exclusive mode is not supported.
|
||||
*
|
||||
* @return <code>false</code>
|
||||
* @since 1.4
|
||||
*/
|
||||
public boolean isFullScreenSupported()
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isDisplayChangeSupported()
|
||||
{
|
||||
return fixedDisplayMode == null;
|
||||
}
|
||||
|
||||
public void setDisplayMode(DisplayMode dm)
|
||||
{
|
||||
if (fixedDisplayMode != null)
|
||||
throw new UnsupportedOperationException("Cannnot change display mode.");
|
||||
|
||||
if (dm == null)
|
||||
throw new IllegalArgumentException("DisplayMode must not be null.");
|
||||
|
||||
synchronized (this)
|
||||
{
|
||||
if (displayModes == null)
|
||||
displayModes = nativeGetDisplayModes(env);
|
||||
}
|
||||
|
||||
for (int i=0; i<displayModes.length; i++)
|
||||
if (displayModes[i].width == dm.getWidth()
|
||||
&& displayModes[i].height == dm.getHeight())
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
nativeSetDisplayMode(env,
|
||||
i,
|
||||
(short) dm.getRefreshRate());
|
||||
|
||||
bounds = null;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Mode not supported by this device.");
|
||||
}
|
||||
|
||||
native void nativeSetDisplayMode(GdkGraphicsEnvironment env,
|
||||
int index, short rate);
|
||||
|
||||
/** A class that simply encapsulates the X11 display mode data.
|
||||
*/
|
||||
static class X11DisplayMode
|
||||
{
|
||||
short[] rates;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
X11DisplayMode(int width, int height, short[] rates)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.rates = rates;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setFullScreenWindow(Window w)
|
||||
{
|
||||
// Bring old fullscreen window back into its original state.
|
||||
if (fullscreenWindow != null && w != fullscreenWindow)
|
||||
{
|
||||
if (fullscreenWindow instanceof Frame)
|
||||
{
|
||||
// Decoration state can only be switched when the peer is
|
||||
// non-existent. That means we have to dispose the
|
||||
// Frame.
|
||||
Frame f = (Frame) fullscreenWindow;
|
||||
if (oldWindowDecorationState != f.isUndecorated())
|
||||
{
|
||||
f.dispose();
|
||||
f.setUndecorated(oldWindowDecorationState);
|
||||
}
|
||||
}
|
||||
|
||||
fullscreenWindow.setBounds(oldWindowBounds);
|
||||
|
||||
if (!fullscreenWindow.isVisible())
|
||||
fullscreenWindow.setVisible(true);
|
||||
}
|
||||
|
||||
// If applicable remove decoration, then maximize the window and
|
||||
// bring it to the foreground.
|
||||
if (w != null)
|
||||
{
|
||||
if (w instanceof Frame)
|
||||
{
|
||||
Frame f = (Frame) w;
|
||||
oldWindowDecorationState = f.isUndecorated();
|
||||
if (!oldWindowDecorationState)
|
||||
{
|
||||
f.dispose();
|
||||
f.setUndecorated(true);
|
||||
}
|
||||
}
|
||||
|
||||
oldWindowBounds = w.getBounds();
|
||||
|
||||
DisplayMode dm = getDisplayMode();
|
||||
|
||||
w.setBounds(0, 0, dm.getWidth(), dm.getHeight());
|
||||
|
||||
if (!w.isVisible())
|
||||
w.setVisible(true);
|
||||
|
||||
w.requestFocus();
|
||||
w.toFront();
|
||||
|
||||
}
|
||||
|
||||
fullscreenWindow = w;
|
||||
}
|
||||
|
||||
public Window getFullScreenWindow()
|
||||
{
|
||||
return fullscreenWindow;
|
||||
}
|
||||
|
||||
Rectangle getBounds()
|
||||
{
|
||||
synchronized(this)
|
||||
{
|
||||
if (bounds == null)
|
||||
bounds = nativeGetBounds();
|
||||
}
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
||||
native Rectangle nativeGetBounds();
|
||||
|
||||
}
|
||||
|
|
|
@ -75,13 +75,21 @@ public class GdkTextLayout
|
|||
initStaticState ();
|
||||
}
|
||||
private native void setText(String str);
|
||||
private native void setFont(GdkFontPeer font);
|
||||
private native void getExtents(double[] inkExtents,
|
||||
double[] logExtents);
|
||||
private native void indexToPos(int idx, double[] pos);
|
||||
|
||||
private native void initState ();
|
||||
|
||||
private native void dispose ();
|
||||
|
||||
private native void cairoDrawGdkTextLayout(CairoGraphics2D g, float x, float y);
|
||||
|
||||
static native void initStaticState();
|
||||
|
||||
private final int native_state = GtkGenericPeer.getUniqueInteger ();
|
||||
|
||||
protected void finalize ()
|
||||
{
|
||||
dispose ();
|
||||
|
@ -97,6 +105,15 @@ public class GdkTextLayout
|
|||
initState();
|
||||
attributedString = str;
|
||||
fontRenderContext = frc;
|
||||
AttributedCharacterIterator aci = str.getIterator();
|
||||
char[] chars = new char[aci.getEndIndex() - aci.getBeginIndex()];
|
||||
for(int i = aci.getBeginIndex(); i < aci.getEndIndex(); i++)
|
||||
chars[i] = aci.setIndex(i);
|
||||
setText(new String(chars));
|
||||
|
||||
Object fnt = aci.getAttribute(TextAttribute.FONT);
|
||||
if (fnt != null && fnt instanceof Font)
|
||||
setFont( (GdkFontPeer) ((Font)fnt).getPeer() );
|
||||
}
|
||||
|
||||
protected class CharacterIteratorProxy
|
||||
|
@ -199,60 +216,7 @@ public class GdkTextLayout
|
|||
|
||||
public void draw (Graphics2D g2, float x, float y)
|
||||
{
|
||||
if (g2 instanceof GdkGraphics2D)
|
||||
{
|
||||
// we share pango structures directly with GdkGraphics2D
|
||||
// when legal
|
||||
GdkGraphics2D gg2 = (GdkGraphics2D) g2;
|
||||
gg2.drawGdkTextLayout(this, x, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
// falling back to a rather tedious layout algorithm when
|
||||
// not legal
|
||||
AttributedCharacterIterator ci = attributedString.getIterator ();
|
||||
CharacterIteratorProxy proxy = new CharacterIteratorProxy (ci);
|
||||
Font defFont = g2.getFont ();
|
||||
|
||||
/* Note: this implementation currently only interprets FONT text
|
||||
* attributes. There is a reasonable argument to be made for some
|
||||
* attributes being interpreted out here, where we have control of the
|
||||
* Graphics2D and can construct or derive new fonts, and some
|
||||
* attributes being interpreted by the GlyphVector itself. So far, for
|
||||
* all attributes except FONT we do neither.
|
||||
*/
|
||||
|
||||
for (char c = ci.first ();
|
||||
c != CharacterIterator.DONE;
|
||||
c = ci.next ())
|
||||
{
|
||||
proxy.begin = ci.getIndex ();
|
||||
proxy.limit = ci.getRunLimit(TextAttribute.FONT);
|
||||
if (proxy.limit <= proxy.begin)
|
||||
continue;
|
||||
|
||||
proxy.index = proxy.begin;
|
||||
|
||||
Object fnt = ci.getAttribute(TextAttribute.FONT);
|
||||
GlyphVector gv;
|
||||
if (fnt instanceof Font)
|
||||
gv = ((Font)fnt).createGlyphVector (fontRenderContext, proxy);
|
||||
else
|
||||
gv = defFont.createGlyphVector (fontRenderContext, proxy);
|
||||
|
||||
g2.drawGlyphVector (gv, x, y);
|
||||
|
||||
int n = gv.getNumGlyphs ();
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
GlyphMetrics gm = gv.getGlyphMetrics (i);
|
||||
if (gm.getAdvanceX() == gm.getAdvance ())
|
||||
x += gm.getAdvanceX ();
|
||||
else
|
||||
y += gm.getAdvanceY ();
|
||||
}
|
||||
}
|
||||
}
|
||||
cairoDrawGdkTextLayout((CairoGraphics2D)g2, x, y);
|
||||
}
|
||||
|
||||
public TextHitInfo getStrongCaret (TextHitInfo hit1,
|
||||
|
|
|
@ -45,7 +45,6 @@ import java.awt.peer.CanvasPeer;
|
|||
public class GtkCanvasPeer extends GtkComponentPeer implements CanvasPeer
|
||||
{
|
||||
native void create ();
|
||||
native void realize ();
|
||||
|
||||
public GtkCanvasPeer (Canvas c)
|
||||
{
|
||||
|
|
|
@ -109,14 +109,7 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
native void gtkWidgetRequestFocus ();
|
||||
native void gtkWidgetDispatchKeyEvent (int id, long when, int mods,
|
||||
int keyCode, int keyLocation);
|
||||
|
||||
native boolean isRealized ();
|
||||
|
||||
void realize ()
|
||||
{
|
||||
// Default implementation does nothing
|
||||
}
|
||||
|
||||
native void realize();
|
||||
native void setNativeEventMask ();
|
||||
|
||||
void create ()
|
||||
|
@ -149,6 +142,9 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
|
||||
setNativeEventMask ();
|
||||
|
||||
// This peer is guaranteed to have an X window upon construction.
|
||||
// That is, native methods such as those in GdkGraphics can rely
|
||||
// on this component's widget->window field being non-null.
|
||||
realize ();
|
||||
|
||||
if (awtComponent.isCursorSet())
|
||||
|
@ -211,16 +207,7 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
|
||||
public Image createImage (int width, int height)
|
||||
{
|
||||
Image image;
|
||||
if (GtkToolkit.useGraphics2D ())
|
||||
image = new BufferedImage (width, height, BufferedImage.TYPE_INT_RGB);
|
||||
else
|
||||
image = new GtkImage (width, height);
|
||||
|
||||
Graphics g = image.getGraphics();
|
||||
g.setColor(getBackground());
|
||||
g.fillRect(0, 0, width, height);
|
||||
return image;
|
||||
return CairoSurface.getBufferedImage(width, height);
|
||||
}
|
||||
|
||||
public void disable ()
|
||||
|
@ -247,10 +234,7 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
// never return null.
|
||||
public Graphics getGraphics ()
|
||||
{
|
||||
if (GtkToolkit.useGraphics2D ())
|
||||
return new GdkGraphics2D (this);
|
||||
else
|
||||
return new GdkGraphics (this);
|
||||
return ComponentGraphics.getComponentGraphics(this);
|
||||
}
|
||||
|
||||
public Point getLocationOnScreen ()
|
||||
|
@ -713,7 +697,7 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
// on which this component is displayed.
|
||||
public VolatileImage createVolatileImage (int width, int height)
|
||||
{
|
||||
return new GtkVolatileImage (width, height);
|
||||
return new GtkVolatileImage (this, width, height, null);
|
||||
}
|
||||
|
||||
// Creates buffers used in a buffering strategy.
|
||||
|
@ -723,7 +707,7 @@ public class GtkComponentPeer extends GtkGenericPeer
|
|||
// numBuffers == 2 implies double-buffering, meaning one back
|
||||
// buffer and one front buffer.
|
||||
if (numBuffers == 2)
|
||||
backBuffer = new GtkVolatileImage(awtComponent.getWidth(),
|
||||
backBuffer = new GtkVolatileImage(this, awtComponent.getWidth(),
|
||||
awtComponent.getHeight(),
|
||||
caps.getBackBufferCapabilities());
|
||||
else
|
||||
|
|
|
@ -57,14 +57,7 @@ import java.net.URL;
|
|||
import gnu.classpath.Pointer;
|
||||
|
||||
/**
|
||||
* GtkImage - wraps a GdkPixbuf or GdkPixmap.
|
||||
*
|
||||
* The constructor GtkImage(int, int) creates an 'off-screen' GdkPixmap,
|
||||
* this can be drawn to (it's a GdkDrawable), and correspondingly, you can
|
||||
* create a GdkGraphics object for it.
|
||||
*
|
||||
* This corresponds to the Image implementation returned by
|
||||
* Component.createImage(int, int).
|
||||
* GtkImage - wraps a GdkPixbuf.
|
||||
*
|
||||
* A GdkPixbuf is 'on-screen' and the gdk cannot draw to it,
|
||||
* this is used for the other constructors (and other createImage methods), and
|
||||
|
@ -88,20 +81,16 @@ public class GtkImage extends Image
|
|||
boolean isLoaded;
|
||||
|
||||
/**
|
||||
* Pointer to the GdkPixbuf
|
||||
* Pointer to the GdkPixbuf -
|
||||
* don't change the name without changing the native code.
|
||||
*/
|
||||
Pointer pixmap;
|
||||
Pointer pixbuf;
|
||||
|
||||
/**
|
||||
* Observer queue.
|
||||
*/
|
||||
Vector observers;
|
||||
|
||||
/**
|
||||
* If offScreen is set, a GdkBitmap is wrapped and not a Pixbuf.
|
||||
*/
|
||||
boolean offScreen;
|
||||
|
||||
/**
|
||||
* Error flag for loading.
|
||||
*/
|
||||
|
@ -122,71 +111,64 @@ public class GtkImage extends Image
|
|||
0xFF000000);
|
||||
|
||||
/**
|
||||
* Returns a copy of the pixel data as a java array.
|
||||
* Should be called with the GdkPixbufDecoder.pixbufLock held.
|
||||
* The singleton GtkImage that is returned on errors by GtkToolkit.
|
||||
*/
|
||||
private native int[] getPixels();
|
||||
private static GtkImage errorImage;
|
||||
|
||||
/**
|
||||
* Lock that should be held for all gdkpixbuf operations. We don't use
|
||||
* the global gdk_threads_enter/leave functions in most places since
|
||||
* most gdkpixbuf operations can be done in parallel to drawing and
|
||||
* manipulating gtk widgets.
|
||||
*/
|
||||
static Object pixbufLock = new Object();
|
||||
|
||||
/**
|
||||
* Allocate a PixBuf from a given ARGB32 buffer pointer.
|
||||
*/
|
||||
private native void initFromBuffer( long bufferPointer );
|
||||
|
||||
/**
|
||||
* Returns a copy of the pixel data as a java array.
|
||||
* Should be called with the pixbufLock held.
|
||||
*/
|
||||
native int[] getPixels();
|
||||
|
||||
/**
|
||||
* Sets the pixel data from a java array.
|
||||
* Should be called with the GdkPixbufDecoder.pixbufLock held.
|
||||
* Should be called with the pixbufLock held.
|
||||
*/
|
||||
private native void setPixels(int[] pixels);
|
||||
|
||||
/**
|
||||
* Loads an image using gdk-pixbuf from a file.
|
||||
* Should be called with the GdkPixbufDecoder.pixbufLock held.
|
||||
* Should be called with the pixbufLock held.
|
||||
*/
|
||||
private native boolean loadPixbuf(String name);
|
||||
|
||||
/**
|
||||
* Loads an image using gdk-pixbuf from data.
|
||||
* Should be called with the GdkPixbufDecoder.pixbufLock held.
|
||||
* Should be called with the pixbufLock held.
|
||||
*/
|
||||
private native boolean loadImageFromData(byte[] data);
|
||||
|
||||
/**
|
||||
* Allocates a Gtk Pixbuf or pixmap
|
||||
* Should be called with the GdkPixbufDecoder.pixbufLock held.
|
||||
* Allocates a Gtk Pixbuf
|
||||
* Should be called with the pixbufLock held.
|
||||
*/
|
||||
private native void createPixmap();
|
||||
private native void createPixbuf();
|
||||
|
||||
/**
|
||||
* Frees the above.
|
||||
* Should be called with the GdkPixbufDecoder.pixbufLock held.
|
||||
* Should be called with the pixbufLock held.
|
||||
*/
|
||||
private native void freePixmap();
|
||||
private native void freePixbuf();
|
||||
|
||||
/**
|
||||
* Sets the pixmap to scaled copy of src image. hints are rendering hints.
|
||||
* Should be called with the GdkPixbufDecoder.pixbufLock held.
|
||||
* Sets the pixbuf to scaled copy of src image. hints are rendering hints.
|
||||
* Should be called with the pixbufLock held.
|
||||
*/
|
||||
private native void createScaledPixmap(GtkImage src, int hints);
|
||||
|
||||
/**
|
||||
* Draws the image, optionally scaled and composited.
|
||||
* Should be called with the GdkPixbufDecoder.pixbufLock held.
|
||||
* Also acquires global gdk lock for drawing.
|
||||
*/
|
||||
private native void drawPixelsScaled (GdkGraphics gc,
|
||||
int bg_red, int bg_green, int bg_blue,
|
||||
int x, int y, int width, int height,
|
||||
boolean composite);
|
||||
|
||||
/**
|
||||
* Draws the image, optionally scaled flipped and composited.
|
||||
* Should be called with the GdkPixbufDecoder.pixbufLock held.
|
||||
* Also acquires global gdk lock for drawing.
|
||||
*/
|
||||
private native void drawPixelsScaledFlipped (GdkGraphics gc,
|
||||
int bg_red, int bg_green,
|
||||
int bg_blue,
|
||||
boolean flipX, boolean flipY,
|
||||
int srcX, int srcY,
|
||||
int srcWidth, int srcHeight,
|
||||
int dstX, int dstY,
|
||||
int dstWidth, int dstHeight,
|
||||
boolean composite);
|
||||
private native void createScaledPixbuf(GtkImage src, int hints);
|
||||
|
||||
/**
|
||||
* Constructs a GtkImage from an ImageProducer. Asynchronity is handled in
|
||||
|
@ -202,7 +184,6 @@ public class GtkImage extends Image
|
|||
source = producer;
|
||||
errorLoading = false;
|
||||
source.startProduction(new GtkImageConsumer(this, source));
|
||||
offScreen = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -215,7 +196,6 @@ public class GtkImage extends Image
|
|||
{
|
||||
isLoaded = true;
|
||||
observers = null;
|
||||
offScreen = false;
|
||||
props = new Hashtable();
|
||||
errorLoading = false;
|
||||
}
|
||||
|
@ -231,7 +211,7 @@ public class GtkImage extends Image
|
|||
try
|
||||
{
|
||||
String path = f.getCanonicalPath();
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
synchronized(pixbufLock)
|
||||
{
|
||||
if (loadPixbuf(f.getCanonicalPath()) != true)
|
||||
throw new IllegalArgumentException("Couldn't load image: "
|
||||
|
@ -249,7 +229,6 @@ public class GtkImage extends Image
|
|||
|
||||
isLoaded = true;
|
||||
observers = null;
|
||||
offScreen = false;
|
||||
props = new Hashtable();
|
||||
}
|
||||
|
||||
|
@ -261,7 +240,7 @@ public class GtkImage extends Image
|
|||
*/
|
||||
public GtkImage (byte[] data)
|
||||
{
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
synchronized(pixbufLock)
|
||||
{
|
||||
if (loadImageFromData (data) != true)
|
||||
throw new IllegalArgumentException ("Couldn't load image.");
|
||||
|
@ -269,7 +248,6 @@ public class GtkImage extends Image
|
|||
|
||||
isLoaded = true;
|
||||
observers = null;
|
||||
offScreen = false;
|
||||
props = new Hashtable();
|
||||
errorLoading = false;
|
||||
}
|
||||
|
@ -301,7 +279,7 @@ public class GtkImage extends Image
|
|||
throw new IllegalArgumentException ("Couldn't load image.");
|
||||
}
|
||||
byte[] array = baos.toByteArray();
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
synchronized(pixbufLock)
|
||||
{
|
||||
if (loadImageFromData(array) != true)
|
||||
throw new IllegalArgumentException ("Couldn't load image.");
|
||||
|
@ -312,23 +290,6 @@ public class GtkImage extends Image
|
|||
props = new Hashtable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an empty GtkImage.
|
||||
*/
|
||||
public GtkImage (int width, int height)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
props = new Hashtable();
|
||||
isLoaded = true;
|
||||
observers = null;
|
||||
offScreen = true;
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
{
|
||||
createPixmap();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a scaled version of the src bitmap, using the GDK.
|
||||
*/
|
||||
|
@ -339,12 +300,11 @@ public class GtkImage extends Image
|
|||
props = new Hashtable();
|
||||
isLoaded = true;
|
||||
observers = null;
|
||||
offScreen = false;
|
||||
|
||||
// Use the GDK scaling method.
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
synchronized(pixbufLock)
|
||||
{
|
||||
createScaledPixmap(src, hints);
|
||||
createScaledPixbuf(src, hints);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -354,19 +314,30 @@ public class GtkImage extends Image
|
|||
*/
|
||||
GtkImage (Pointer pixbuf)
|
||||
{
|
||||
pixmap = pixbuf;
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
this.pixbuf = pixbuf;
|
||||
synchronized(pixbufLock)
|
||||
{
|
||||
createFromPixbuf();
|
||||
}
|
||||
isLoaded = true;
|
||||
observers = null;
|
||||
offScreen = false;
|
||||
props = new Hashtable();
|
||||
}
|
||||
|
||||
// The singleton GtkImage that is returned on errors by GtkToolkit.
|
||||
private static GtkImage errorImage;
|
||||
/**
|
||||
* Wraps a buffer with a GtkImage.
|
||||
*
|
||||
* @param bufferPointer a pointer to an ARGB32 buffer
|
||||
*/
|
||||
GtkImage(int width, int height, long bufferPointer)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
props = new Hashtable();
|
||||
isLoaded = true;
|
||||
observers = null;
|
||||
initFromBuffer( bufferPointer );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an empty GtkImage with the errorLoading flag set.
|
||||
|
@ -385,7 +356,7 @@ public class GtkImage extends Image
|
|||
|
||||
/**
|
||||
* Native helper function for constructor that takes a pixbuf Pointer.
|
||||
* Should be called with the GdkPixbufDecoder.pixbufLock held.
|
||||
* Should be called with the pixbufLock held.
|
||||
*/
|
||||
private native void createFromPixbuf();
|
||||
|
||||
|
@ -407,9 +378,9 @@ public class GtkImage extends Image
|
|||
|
||||
isLoaded = true;
|
||||
deliver();
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
synchronized(pixbufLock)
|
||||
{
|
||||
createPixmap();
|
||||
createPixbuf();
|
||||
setPixels(pixels);
|
||||
}
|
||||
}
|
||||
|
@ -450,30 +421,28 @@ public class GtkImage extends Image
|
|||
return null;
|
||||
|
||||
int[] pixels;
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
synchronized (pixbufLock)
|
||||
{
|
||||
pixels = getPixels();
|
||||
if (!errorLoading)
|
||||
pixels = getPixels();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
return new MemoryImageSource(width, height, nativeModel, pixels,
|
||||
0, width);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a GdkGraphics context for this pixmap.
|
||||
* Does nothing. Should not be called.
|
||||
*/
|
||||
public Graphics getGraphics ()
|
||||
{
|
||||
if (!isLoaded)
|
||||
return null;
|
||||
if (offScreen)
|
||||
return new GdkGraphics(this);
|
||||
else
|
||||
throw new IllegalAccessError("This method only works for off-screen"
|
||||
+" Images.");
|
||||
throw new IllegalAccessError("This method only works for off-screen"
|
||||
+" Images.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a scaled instance of this pixmap.
|
||||
* Returns a scaled instance of this pixbuf.
|
||||
*/
|
||||
public Image getScaledInstance(int width,
|
||||
int height,
|
||||
|
@ -500,9 +469,9 @@ public class GtkImage extends Image
|
|||
{
|
||||
observers = new Vector();
|
||||
isLoaded = false;
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
synchronized(pixbufLock)
|
||||
{
|
||||
freePixmap();
|
||||
freePixbuf();
|
||||
}
|
||||
source.startProduction(new GtkImageConsumer(this, source));
|
||||
}
|
||||
|
@ -512,9 +481,9 @@ public class GtkImage extends Image
|
|||
{
|
||||
if (isLoaded)
|
||||
{
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
synchronized(pixbufLock)
|
||||
{
|
||||
freePixmap();
|
||||
freePixbuf();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -535,104 +504,6 @@ public class GtkImage extends Image
|
|||
return ImageObserver.ALLBITS | ImageObserver.WIDTH | ImageObserver.HEIGHT;
|
||||
}
|
||||
|
||||
// Drawing methods ////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Draws an image with eventual scaling/transforming.
|
||||
*/
|
||||
public boolean drawImage (GdkGraphics g, int dx1, int dy1, int dx2, int dy2,
|
||||
int sx1, int sy1, int sx2, int sy2,
|
||||
Color bgcolor, ImageObserver observer)
|
||||
{
|
||||
if (addObserver(observer))
|
||||
return false;
|
||||
|
||||
boolean flipX = (dx1 > dx2)^(sx1 > sx2);
|
||||
boolean flipY = (dy1 > dy2)^(sy1 > sy2);
|
||||
int dstWidth = Math.abs (dx2 - dx1);
|
||||
int dstHeight = Math.abs (dy2 - dy1);
|
||||
int srcWidth = Math.abs (sx2 - sx1);
|
||||
int srcHeight = Math.abs (sy2 - sy1);
|
||||
int srcX = (sx1 < sx2) ? sx1 : sx2;
|
||||
int srcY = (sy1 < sy2) ? sy1 : sy2;
|
||||
int dstX = (dx1 < dx2) ? dx1 : dx2;
|
||||
int dstY = (dy1 < dy2) ? dy1 : dy2;
|
||||
|
||||
// Clipping. This requires the dst to be scaled as well,
|
||||
if (srcWidth > width)
|
||||
{
|
||||
dstWidth = (int)((double)dstWidth*((double)width/(double)srcWidth));
|
||||
srcWidth = width - srcX;
|
||||
}
|
||||
|
||||
if (srcHeight > height)
|
||||
{
|
||||
dstHeight = (int)((double)dstHeight*((double)height/(double)srcHeight));
|
||||
srcHeight = height - srcY;
|
||||
}
|
||||
|
||||
if (srcWidth + srcX > width)
|
||||
{
|
||||
dstWidth = (int)((double)dstWidth * (double)(width - srcX)/(double)srcWidth);
|
||||
srcWidth = width - srcX;
|
||||
}
|
||||
|
||||
if (srcHeight + srcY > height)
|
||||
{
|
||||
dstHeight = (int)((double)dstHeight * (double)(width - srcY)/(double)srcHeight);
|
||||
srcHeight = height - srcY;
|
||||
}
|
||||
|
||||
if ( this.width <= 0 || this.height <= 0 )
|
||||
return true;
|
||||
|
||||
if ( srcWidth <= 0 || srcHeight <= 0 || dstWidth <= 0 || dstHeight <= 0)
|
||||
return true;
|
||||
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
{
|
||||
if(bgcolor != null)
|
||||
drawPixelsScaledFlipped (g, bgcolor.getRed (), bgcolor.getGreen (),
|
||||
bgcolor.getBlue (),
|
||||
flipX, flipY,
|
||||
srcX, srcY,
|
||||
srcWidth, srcHeight,
|
||||
dstX, dstY,
|
||||
dstWidth, dstHeight,
|
||||
true);
|
||||
else
|
||||
drawPixelsScaledFlipped (g, 0, 0, 0, flipX, flipY,
|
||||
srcX, srcY, srcWidth, srcHeight,
|
||||
dstX, dstY, dstWidth, dstHeight,
|
||||
false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws an image to the GdkGraphics context, at (x,y) scaled to
|
||||
* width and height, with optional compositing with a background color.
|
||||
*/
|
||||
public boolean drawImage (GdkGraphics g, int x, int y, int width, int height,
|
||||
Color bgcolor, ImageObserver observer)
|
||||
{
|
||||
if (addObserver(observer))
|
||||
return false;
|
||||
|
||||
if ( this.width <= 0 || this.height <= 0 )
|
||||
return true;
|
||||
|
||||
synchronized(GdkPixbufDecoder.pixbufLock)
|
||||
{
|
||||
if(bgcolor != null)
|
||||
drawPixelsScaled(g, bgcolor.getRed (), bgcolor.getGreen (),
|
||||
bgcolor.getBlue (), x, y, width, height, true);
|
||||
else
|
||||
drawPixelsScaled(g, 0, 0, 0, x, y, width, height, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Private methods ////////////////////////////////////////////////
|
||||
|
||||
|
|
|
@ -78,31 +78,12 @@ import javax.imageio.spi.IIORegistry;
|
|||
this class. If getPeer() ever goes away, we can implement a hash table
|
||||
that will keep up with every window's peer, but for now this is faster. */
|
||||
|
||||
/**
|
||||
* This class accesses a system property called
|
||||
* <tt>gnu.java.awt.peer.gtk.Graphics</tt>. If the property is defined and
|
||||
* equal to "Graphics2D", the cairo-based GdkGraphics2D will be used in
|
||||
* drawing contexts. Any other value will cause the older GdkGraphics
|
||||
* object to be used.
|
||||
*/
|
||||
public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
|
||||
{
|
||||
Hashtable containers = new Hashtable();
|
||||
static EventQueue q;
|
||||
static boolean useGraphics2dSet;
|
||||
static boolean useGraphics2d;
|
||||
static Thread mainThread;
|
||||
|
||||
public static boolean useGraphics2D()
|
||||
{
|
||||
if (useGraphics2dSet)
|
||||
return useGraphics2d;
|
||||
useGraphics2d = System.getProperty("gnu.java.awt.peer.gtk.Graphics",
|
||||
"Graphics").equals("Graphics2D");
|
||||
useGraphics2dSet = true;
|
||||
return useGraphics2d;
|
||||
}
|
||||
|
||||
static native void gtkInit(int portableNativeSync);
|
||||
|
||||
static
|
||||
|
@ -178,10 +159,7 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
|
|||
Image image;
|
||||
try
|
||||
{
|
||||
if (useGraphics2D())
|
||||
image = GdkPixbufDecoder.createBufferedImage(filename);
|
||||
else
|
||||
image = new GtkImage(filename);
|
||||
image = CairoSurface.getBufferedImage( new GtkImage( filename ) );
|
||||
}
|
||||
catch (IllegalArgumentException iae)
|
||||
{
|
||||
|
@ -195,10 +173,7 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
|
|||
Image image;
|
||||
try
|
||||
{
|
||||
if (useGraphics2D())
|
||||
image = GdkPixbufDecoder.createBufferedImage(url);
|
||||
else
|
||||
image = new GtkImage(url);
|
||||
image = CairoSurface.getBufferedImage( new GtkImage( url ) );
|
||||
}
|
||||
catch (IllegalArgumentException iae)
|
||||
{
|
||||
|
@ -209,13 +184,13 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
|
|||
|
||||
public Image createImage (ImageProducer producer)
|
||||
{
|
||||
if (producer == null)
|
||||
return null;
|
||||
|
||||
Image image;
|
||||
try
|
||||
{
|
||||
if (useGraphics2D())
|
||||
image = GdkPixbufDecoder.createBufferedImage(producer);
|
||||
else
|
||||
image = new GtkImage(producer);
|
||||
image = CairoSurface.getBufferedImage( new GtkImage( producer ) );
|
||||
}
|
||||
catch (IllegalArgumentException iae)
|
||||
{
|
||||
|
@ -230,16 +205,9 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
|
|||
Image image;
|
||||
try
|
||||
{
|
||||
if (useGraphics2D())
|
||||
image = GdkPixbufDecoder.createBufferedImage(imagedata,
|
||||
imageoffset,
|
||||
imagelength);
|
||||
else
|
||||
{
|
||||
byte[] datacopy = new byte[imagelength];
|
||||
System.arraycopy(imagedata, imageoffset, datacopy, 0, imagelength);
|
||||
return new GtkImage(datacopy);
|
||||
}
|
||||
byte[] data = new byte[ imagelength ];
|
||||
System.arraycopy(imagedata, imageoffset, data, 0, imagelength);
|
||||
image = CairoSurface.getBufferedImage( new GtkImage( data ) );
|
||||
}
|
||||
catch (IllegalArgumentException iae)
|
||||
{
|
||||
|
@ -256,7 +224,7 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
|
|||
*/
|
||||
public ImageProducer createImageProducer(URL url)
|
||||
{
|
||||
return new GdkPixbufDecoder(url);
|
||||
return createImage( url ).getSource();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -568,13 +536,23 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
|
|||
|
||||
protected EventQueue getSystemEventQueueImpl()
|
||||
{
|
||||
synchronized (GtkToolkit.class)
|
||||
// GCJ LOCAL: workaround a GCJ problem accessing
|
||||
// GtkToolkit.class
|
||||
try
|
||||
{
|
||||
synchronized (Class.forName ("gnu.java.awt.peer.gtk.GtkToolkit"))
|
||||
{
|
||||
if (q == null)
|
||||
{
|
||||
q = new EventQueue();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* GtkVolatileImage.java -- a hardware-accelerated image buffer
|
||||
/* GtkVolatileImage.java -- wraps an X pixmap
|
||||
Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
@ -38,6 +38,7 @@ exception statement from your version. */
|
|||
package gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.ImageCapabilities;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
@ -46,44 +47,68 @@ import java.awt.image.VolatileImage;
|
|||
|
||||
public class GtkVolatileImage extends VolatileImage
|
||||
{
|
||||
private int width;
|
||||
private int height;
|
||||
int width, height;
|
||||
private ImageCapabilities caps;
|
||||
|
||||
public GtkVolatileImage(int width, int height)
|
||||
{
|
||||
this(width, height, null);
|
||||
}
|
||||
/**
|
||||
* Don't touch, accessed from native code.
|
||||
*/
|
||||
long nativePointer;
|
||||
|
||||
public GtkVolatileImage(int width, int height, ImageCapabilities caps)
|
||||
native long init(GtkComponentPeer component, int width, int height);
|
||||
|
||||
native void destroy();
|
||||
|
||||
native int[] getPixels();
|
||||
|
||||
native void copyArea( int x, int y, int w, int h, int dx, int dy );
|
||||
|
||||
native void drawVolatile( long ptr, int x, int y, int w, int h );
|
||||
|
||||
public GtkVolatileImage(GtkComponentPeer component,
|
||||
int width, int height, ImageCapabilities caps)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.caps = caps;
|
||||
nativePointer = init( component, width, height );
|
||||
}
|
||||
|
||||
public GtkVolatileImage(int width, int height, ImageCapabilities caps)
|
||||
{
|
||||
this(null, width, height, caps);
|
||||
}
|
||||
|
||||
public GtkVolatileImage(int width, int height)
|
||||
{
|
||||
this(null, width, height, null);
|
||||
}
|
||||
|
||||
public void finalize()
|
||||
{
|
||||
dispose();
|
||||
}
|
||||
|
||||
public void dispose()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
// FIXME: should return a buffered image snapshot of the accelerated
|
||||
// visual
|
||||
public BufferedImage getSnapshot()
|
||||
{
|
||||
return null;
|
||||
CairoSurface cs = new CairoSurface( width, height );
|
||||
cs.setPixels( getPixels() );
|
||||
return CairoSurface.getBufferedImage( cs );
|
||||
}
|
||||
|
||||
public int getWidth()
|
||||
public Graphics getGraphics()
|
||||
{
|
||||
return width;
|
||||
return createGraphics();
|
||||
}
|
||||
|
||||
public int getHeight()
|
||||
{
|
||||
return height;
|
||||
}
|
||||
|
||||
// FIXME: should return a graphics wrapper around this image's
|
||||
// visual
|
||||
public Graphics2D createGraphics()
|
||||
{
|
||||
return null;
|
||||
return new VolatileImageGraphics( this );
|
||||
}
|
||||
|
||||
public int validate(GraphicsConfiguration gc)
|
||||
|
@ -101,18 +126,28 @@ public class GtkVolatileImage extends VolatileImage
|
|||
return caps;
|
||||
}
|
||||
|
||||
public synchronized Object getProperty (String name, ImageObserver observer)
|
||||
public int getWidth()
|
||||
{
|
||||
return null;
|
||||
return width;
|
||||
}
|
||||
|
||||
public synchronized int getWidth (ImageObserver observer)
|
||||
public int getHeight()
|
||||
{
|
||||
return height;
|
||||
}
|
||||
|
||||
public int getWidth(java.awt.image.ImageObserver observer)
|
||||
{
|
||||
return width;
|
||||
}
|
||||
|
||||
public synchronized int getHeight (ImageObserver observer)
|
||||
public int getHeight(java.awt.image.ImageObserver observer)
|
||||
{
|
||||
return height;
|
||||
}
|
||||
|
||||
public Object getProperty(String name, ImageObserver observer)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,122 @@
|
|||
/* VolatileImageGraphics.java
|
||||
Copyright (C) 2006 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 gnu.java.awt.peer.gtk;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.font.GlyphVector;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.awt.image.DataBufferInt;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.DirectColorModel;
|
||||
import java.awt.image.RenderedImage;
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
public class VolatileImageGraphics extends ComponentGraphics
|
||||
{
|
||||
private GtkVolatileImage owner;
|
||||
|
||||
public VolatileImageGraphics(GtkVolatileImage img)
|
||||
{
|
||||
this.owner = img;
|
||||
cairo_t = initFromVolatile( owner.nativePointer, img.width, img.height );
|
||||
setup( cairo_t );
|
||||
setClip( new Rectangle( 0, 0, img.width, img.height) );
|
||||
}
|
||||
|
||||
private VolatileImageGraphics(VolatileImageGraphics copy)
|
||||
{
|
||||
this.owner = copy.owner;
|
||||
initFromVolatile( owner.nativePointer, owner.width, owner.height );
|
||||
setClip( new Rectangle( 0, 0, owner.width, owner.height) );
|
||||
copy( copy, cairo_t );
|
||||
}
|
||||
|
||||
public void copyAreaImpl(int x, int y, int width, int height, int dx, int dy)
|
||||
{
|
||||
owner.copyArea(x, y, width, height, dx, dy);
|
||||
}
|
||||
|
||||
public GraphicsConfiguration getDeviceConfiguration()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public Graphics create()
|
||||
{
|
||||
return new VolatileImageGraphics( this );
|
||||
}
|
||||
|
||||
|
||||
public boolean drawImage(Image img, int x, int y, ImageObserver observer)
|
||||
{
|
||||
if( img instanceof GtkVolatileImage )
|
||||
{
|
||||
owner.drawVolatile( ((GtkVolatileImage)img).nativePointer,
|
||||
x, y,
|
||||
((GtkVolatileImage)img).width,
|
||||
((GtkVolatileImage)img).height );
|
||||
return true;
|
||||
}
|
||||
return super.drawImage( img, x, y, observer );
|
||||
}
|
||||
|
||||
public boolean drawImage(Image img, int x, int y, int width, int height,
|
||||
ImageObserver observer)
|
||||
{
|
||||
if( img instanceof GtkVolatileImage )
|
||||
{
|
||||
owner.drawVolatile( ((GtkVolatileImage)img).nativePointer,
|
||||
x, y, width, height );
|
||||
return true;
|
||||
}
|
||||
return super.drawImage( img, x, y, width, height, observer );
|
||||
}
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ public interface SwingComponent
|
|||
|
||||
/**
|
||||
* Handles a mouse event. This is usually forwarded to
|
||||
* {@link Component#processMouseMotionEvent(MouseEvent)} of the swing
|
||||
* {@link java.awt.Component#processMouseMotionEvent(MouseEvent)} of the swing
|
||||
* component.
|
||||
*
|
||||
* @param ev the mouse event
|
||||
|
@ -71,7 +71,7 @@ public interface SwingComponent
|
|||
|
||||
/**
|
||||
* Handles a mouse motion event. This is usually forwarded to
|
||||
* {@link Component#processMouseEvent(MouseEvent)} of the swing
|
||||
* {@link java.awt.Component#processMouseEvent(MouseEvent)} of the swing
|
||||
* component.
|
||||
*
|
||||
* @param ev the mouse motion event
|
||||
|
@ -80,7 +80,7 @@ public interface SwingComponent
|
|||
|
||||
/**
|
||||
* Handles a key event. This is usually forwarded to
|
||||
* {@link Component#processKeyEvent(KeyEvent)} of the swing
|
||||
* {@link java.awt.Component#processKeyEvent(KeyEvent)} of the swing
|
||||
* component.
|
||||
*
|
||||
* @param ev the key event
|
||||
|
|
|
@ -48,6 +48,8 @@ import java.awt.Font;
|
|||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.Image;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
|
@ -98,8 +100,9 @@ public class SwingComponentPeer
|
|||
|
||||
/**
|
||||
* Creates a SwingComponentPeer instance. Subclasses are expected to call
|
||||
* this constructor and thereafter call {@link #init(Component, JComponent)}
|
||||
* in order to setup the AWT and Swing components properly.
|
||||
* this constructor and thereafter call
|
||||
* {@link #init(Component, SwingComponent)} in order to setup the AWT and
|
||||
* Swing components properly.
|
||||
*/
|
||||
protected SwingComponentPeer()
|
||||
{
|
||||
|
@ -164,9 +167,12 @@ public class SwingComponentPeer
|
|||
*/
|
||||
public Image createImage(int width, int height)
|
||||
{
|
||||
Component parent = awtComponent.getParent();
|
||||
ComponentPeer parentPeer = parent.getPeer();
|
||||
return parentPeer.createImage(width, height);
|
||||
GraphicsEnvironment graphicsEnv =
|
||||
GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
GraphicsDevice dev = graphicsEnv.getDefaultScreenDevice();
|
||||
GraphicsConfiguration conf = dev.getDefaultConfiguration();
|
||||
Image image = conf.createCompatibleImage(width, height);
|
||||
return image;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -442,20 +448,6 @@ public class SwingComponentPeer
|
|||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares an image for rendering on this component. This is called by
|
||||
* {@link Component#prepareImage(Image, int, int, ImageObserver)}.
|
||||
*
|
||||
* @param img the image to prepare
|
||||
* @param width the desired width of the rendered image
|
||||
* @param height the desired height of the rendered image
|
||||
* @param ob the image observer to be notified of updates in the preparation
|
||||
* process
|
||||
*
|
||||
* @return <code>true</code> if the image has been fully prepared,
|
||||
* <code>false</code> otherwise (in which case the image observer
|
||||
* receives updates)
|
||||
*/
|
||||
public void paint(Graphics graphics)
|
||||
{
|
||||
// FIXME: I don't know what this method is supposed to do.
|
||||
|
@ -478,8 +470,17 @@ public class SwingComponentPeer
|
|||
public boolean prepareImage(Image img, int width, int height, ImageObserver ob)
|
||||
{
|
||||
Component parent = awtComponent.getParent();
|
||||
ComponentPeer parentPeer = parent.getPeer();
|
||||
return parentPeer.prepareImage(img, width, height, ob);
|
||||
boolean res;
|
||||
if(parent != null)
|
||||
{
|
||||
ComponentPeer parentPeer = parent.getPeer();
|
||||
res = parentPeer.prepareImage(img, width, height, ob);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = Toolkit.getDefaultToolkit().prepareImage(img, width, height, ob);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public void print(Graphics graphics)
|
||||
|
|
|
@ -92,7 +92,12 @@ public class SwingContainerPeer
|
|||
*/
|
||||
public Insets getInsets()
|
||||
{
|
||||
return insets();
|
||||
Insets retVal;
|
||||
if (swingComponent != null)
|
||||
retVal = swingComponent.getJComponent().getInsets();
|
||||
else
|
||||
retVal = new Insets(0, 0, 0, 0);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,6 +214,8 @@ public class SwingContainerPeer
|
|||
protected void handleMouseEvent(MouseEvent ev)
|
||||
{
|
||||
Component comp = awtComponent.getComponentAt(ev.getPoint());
|
||||
if(comp == null)
|
||||
comp = awtComponent;
|
||||
if (comp != null)
|
||||
{
|
||||
ComponentPeer peer = comp.getPeer();
|
||||
|
|
|
@ -53,9 +53,9 @@ import java.awt.peer.FramePeer;
|
|||
* As a minimum, a subclass must implement all the remaining abstract methods
|
||||
* as well as the following methods:
|
||||
* <ul>
|
||||
* <li>{@link ComponentPeer#getLocationOnScreen()}</li>
|
||||
* <li>{@link ComponentPeer#getGraphics()}</li>
|
||||
* <li>{@link ComponentPeer#createImage(int, int)}</li>
|
||||
* <li>{@link java.awt.peer.ComponentPeer#getLocationOnScreen()}</li>
|
||||
* <li>{@link java.awt.peer.ComponentPeer#getGraphics()}</li>
|
||||
* <li>{@link java.awt.peer.ComponentPeer#createImage(int, int)}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author Roman Kennke (kennke@aicas.com)
|
||||
|
|
|
@ -174,7 +174,7 @@ public class SwingMenuBarPeer
|
|||
/**
|
||||
* Adds a help menu to the menu bar.
|
||||
*
|
||||
* @param m the menu to add
|
||||
* @param menu the menu to add
|
||||
*/
|
||||
public void addHelpMenu(Menu menu)
|
||||
{
|
||||
|
|
|
@ -283,7 +283,7 @@ public class SwingTextFieldPeer
|
|||
* @param startPos the start index of the selection
|
||||
* @param endPos the start index of the selection
|
||||
*/
|
||||
public void select(int start_pos, int endPos)
|
||||
public void select(int startPos, int endPos)
|
||||
{
|
||||
// TODO: Must be implemented.
|
||||
}
|
||||
|
|
|
@ -48,9 +48,9 @@ import java.awt.peer.WindowPeer;
|
|||
* As a minimum, a subclass must implement all the remaining abstract methods
|
||||
* as well as the following methods:
|
||||
* <ul>
|
||||
* <li>{@link ComponentPeer#getLocationOnScreen()}</li>
|
||||
* <li>{@link ComponentPeer#getGraphics()}</li>
|
||||
* <li>{@link ComponentPeer#createImage(int, int)}</li>
|
||||
* <li>{@link java.awt.peer.ComponentPeer#getLocationOnScreen()}</li>
|
||||
* <li>{@link java.awt.peer.ComponentPeer#getGraphics()}</li>
|
||||
* <li>{@link java.awt.peer.ComponentPeer#createImage(int, int)}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author Roman Kennke (kennke@aicas.com)
|
||||
|
|
|
@ -0,0 +1,518 @@
|
|||
/* JavaPrinterGraphics.java -- AWT printer rendering class.
|
||||
Copyright (C) 2006 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 gnu.java.awt.print;
|
||||
|
||||
import gnu.java.awt.peer.gtk.CairoSurface;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Image;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.awt.image.PixelGrabber;
|
||||
import java.awt.print.PageFormat;
|
||||
import java.awt.print.Pageable;
|
||||
import java.awt.print.Paper;
|
||||
import java.awt.print.Printable;
|
||||
import java.awt.print.PrinterException;
|
||||
import java.awt.print.PrinterGraphics;
|
||||
import java.awt.print.PrinterJob;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.AttributedCharacterIterator;
|
||||
|
||||
/**
|
||||
* Graphics context to draw to PostScript.
|
||||
*
|
||||
* @author Sven de Marothy
|
||||
*/
|
||||
public class JavaPrinterGraphics extends Graphics implements PrinterGraphics
|
||||
{
|
||||
|
||||
/**
|
||||
* The used graphics context.
|
||||
*/
|
||||
private Graphics g;
|
||||
|
||||
/**
|
||||
* The associated printer job.
|
||||
*/
|
||||
private PrinterJob printerJob;
|
||||
|
||||
/**
|
||||
* Rendering resolution
|
||||
*/
|
||||
private static final double DPI = 72.0;
|
||||
|
||||
/**
|
||||
* Rendered image size.
|
||||
*/
|
||||
private int xSize, ySize;
|
||||
|
||||
/**
|
||||
* The image to render to.
|
||||
*/
|
||||
private Image image;
|
||||
|
||||
public JavaPrinterGraphics( PrinterJob printerJob )
|
||||
{
|
||||
this.printerJob = printerJob;
|
||||
}
|
||||
|
||||
/**
|
||||
* Spool a document to PostScript.
|
||||
* If Pageable is non-null, it will print that, otherwise it will use
|
||||
* the supplied printable and pageFormat.
|
||||
*/
|
||||
public SpooledDocument spoolPostScript(Printable printable,
|
||||
PageFormat pageFormat,
|
||||
Pageable pageable)
|
||||
throws PrinterException
|
||||
{
|
||||
try
|
||||
{
|
||||
// spool to a temporary file
|
||||
File temp = File.createTempFile("cpspool", ".ps");
|
||||
temp.deleteOnExit();
|
||||
|
||||
PrintWriter out = new PrintWriter
|
||||
(new BufferedWriter
|
||||
(new OutputStreamWriter
|
||||
(new FileOutputStream(temp), "ISO8859_1"), 1000000));
|
||||
|
||||
writePSHeader(out);
|
||||
|
||||
if(pageable != null)
|
||||
{
|
||||
for(int index = 0; index < pageable.getNumberOfPages(); index++)
|
||||
spoolPage(out, pageable.getPrintable(index),
|
||||
pageable.getPageFormat(index), index);
|
||||
}
|
||||
else
|
||||
{
|
||||
int index = 0;
|
||||
while(spoolPage(out, printable, pageFormat, index++) ==
|
||||
Printable.PAGE_EXISTS);
|
||||
}
|
||||
out.println("%%Trailer");
|
||||
out.println("%%EOF");
|
||||
out.close();
|
||||
return new SpooledDocument( temp );
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
PrinterException pe = new PrinterException();
|
||||
pe.initCause(e);
|
||||
throw pe;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Spools a single page, returns NO_SUCH_PAGE unsuccessful,
|
||||
* PAGE_EXISTS if it was.
|
||||
*/
|
||||
public int spoolPage(PrintWriter out,
|
||||
Printable printable,
|
||||
PageFormat pageFormat,
|
||||
int index) throws IOException, PrinterException
|
||||
{
|
||||
initImage( pageFormat );
|
||||
if(printable.print(this, pageFormat, index) == Printable.NO_SUCH_PAGE)
|
||||
return Printable.NO_SUCH_PAGE;
|
||||
g.dispose();
|
||||
g = null;
|
||||
writePage( out, pageFormat );
|
||||
return Printable.PAGE_EXISTS;
|
||||
}
|
||||
|
||||
private void initImage(PageFormat pageFormat)
|
||||
{
|
||||
// Create a really big image and draw to that.
|
||||
xSize = (int)(DPI*pageFormat.getWidth()/72.0);
|
||||
ySize = (int)(DPI*pageFormat.getHeight()/72.0);
|
||||
|
||||
// Swap X and Y sizes if it's a Landscape page.
|
||||
if( pageFormat.getOrientation() != PageFormat.PORTRAIT )
|
||||
{
|
||||
int t = xSize;
|
||||
xSize = ySize;
|
||||
ySize = t;
|
||||
}
|
||||
|
||||
// FIXME: This should at least be BufferedImage.
|
||||
// Fix once we have a working B.I.
|
||||
// Graphics2D should also be supported of course.
|
||||
image = CairoSurface.getBufferedImage(xSize, ySize);
|
||||
|
||||
g = image.getGraphics();
|
||||
setColor(Color.white);
|
||||
fillRect(0, 0, xSize, ySize);
|
||||
setColor(Color.black);
|
||||
}
|
||||
|
||||
private void writePSHeader(PrintWriter out)
|
||||
{
|
||||
out.println("%!PS-Adobe-3.0");
|
||||
out.println("%%Title: "+printerJob.getJobName());
|
||||
out.println("%%Creator: GNU Classpath ");
|
||||
out.println("%%DocumentData: Clean8Bit");
|
||||
|
||||
out.println("%%DocumentNeededResources: font Times-Roman Helvetica Courier");
|
||||
// out.println("%%Pages: "+); // FIXME # pages.
|
||||
out.println("%%EndComments");
|
||||
|
||||
out.println("%%BeginProlog");
|
||||
out.println("%%EndProlog");
|
||||
out.println("%%BeginSetup");
|
||||
|
||||
// FIXME: Paper name
|
||||
// E.g. "A4" "Letter"
|
||||
// out.println("%%BeginFeature: *PageSize A4");
|
||||
|
||||
out.println("%%EndFeature");
|
||||
|
||||
out.println("%%EndSetup");
|
||||
|
||||
// out.println("%%Page: 1 1");
|
||||
}
|
||||
|
||||
private void writePage(PrintWriter out, PageFormat pageFormat)
|
||||
{
|
||||
out.println("%%BeginPageSetup");
|
||||
|
||||
Paper p = pageFormat.getPaper();
|
||||
double pWidth = p.getWidth();
|
||||
double pHeight = p.getHeight();
|
||||
|
||||
if( pageFormat.getOrientation() == PageFormat.PORTRAIT )
|
||||
out.println( "%%Orientation: Portrait" );
|
||||
else
|
||||
{
|
||||
out.println( "%%Orientation: Landscape" );
|
||||
double t = pWidth;
|
||||
pWidth = pHeight;
|
||||
pHeight = t;
|
||||
}
|
||||
|
||||
out.println("gsave % first save");
|
||||
|
||||
// 595x842; 612x792 respectively
|
||||
out.println("<< /PageSize [" +pWidth + " "+pHeight+ "] >> setpagedevice");
|
||||
|
||||
// invert the Y axis so that we get screen-like coordinates instead.
|
||||
AffineTransform pageTransform = new AffineTransform();
|
||||
if( pageFormat.getOrientation() == PageFormat.REVERSE_LANDSCAPE )
|
||||
{
|
||||
pageTransform.translate(pWidth, pHeight);
|
||||
pageTransform.scale(-1.0, -1.0);
|
||||
}
|
||||
concatCTM(out, pageTransform);
|
||||
out.println("%%EndPageSetup");
|
||||
|
||||
out.println("gsave");
|
||||
|
||||
|
||||
// Draw the image
|
||||
out.println(xSize+" "+ySize+" 8 [1 0 0 -1 0 "+ySize+" ]");
|
||||
out.println("{currentfile 3 string readhexstring pop} bind");
|
||||
out.println("false 3 colorimage");
|
||||
int[] pixels = new int[xSize * ySize];
|
||||
PixelGrabber pg = new PixelGrabber(image, 0, 0, xSize, ySize, pixels, 0, xSize);
|
||||
|
||||
try {
|
||||
pg.grabPixels();
|
||||
} catch (InterruptedException e) {
|
||||
out.println("% Bug getting pixels!");
|
||||
}
|
||||
|
||||
int n = 0;
|
||||
for (int j = 0; j < ySize; j++) {
|
||||
for (int i = 0; i < xSize; i++) {
|
||||
out.print( colorTripleHex(pixels[j * xSize + i]) );
|
||||
if(((++n)%11) == 0) out.println();
|
||||
}
|
||||
}
|
||||
|
||||
out.println();
|
||||
out.println("%%EOF");
|
||||
out.println("grestore");
|
||||
out.println("showpage");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a nonsperated hex RGB triple, e.g. FFFFFF = white
|
||||
*/
|
||||
private String colorTripleHex(int num){
|
||||
String s = "";
|
||||
|
||||
try {
|
||||
s = Integer.toHexString( ( num & 0x00FFFFFF ) );
|
||||
if( s.length() < 6 )
|
||||
{
|
||||
s = "000000"+s;
|
||||
return s.substring(s.length()-6);
|
||||
}
|
||||
} catch (Exception e){
|
||||
s = "FFFFFF";
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
private void concatCTM(PrintWriter out, AffineTransform Tx){
|
||||
double[] matrixElements = new double[6];
|
||||
Tx.getMatrix(matrixElements);
|
||||
|
||||
out.print("[ ");
|
||||
for(int i=0;i<6;i++)
|
||||
out.print(matrixElements[i]+" ");
|
||||
out.println("] concat");
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/**
|
||||
* PrinterGraphics method - Returns the printer job associated with this object.
|
||||
*/
|
||||
public PrinterJob getPrinterJob()
|
||||
{
|
||||
return printerJob;
|
||||
}
|
||||
|
||||
/**
|
||||
* The rest of the methods here are just pass-throughs to g.
|
||||
*/
|
||||
public void clearRect(int x, int y, int width, int height)
|
||||
{
|
||||
g.clearRect(x, y, width, height);
|
||||
}
|
||||
|
||||
public void clipRect(int x, int y, int width, int height)
|
||||
{
|
||||
g.clipRect(x, y, width, height);
|
||||
}
|
||||
|
||||
public void copyArea(int x, int y, int width, int height, int dx, int dy)
|
||||
{
|
||||
g.copyArea(x, y, width, height, dx, dy);
|
||||
}
|
||||
|
||||
public Graphics create()
|
||||
{
|
||||
return g.create();
|
||||
}
|
||||
|
||||
public void dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public void drawArc(int x, int y, int width, int height, int startAngle,
|
||||
int arcAngle)
|
||||
{
|
||||
g.drawArc(x, y, width, height, startAngle, arcAngle);
|
||||
}
|
||||
|
||||
public boolean drawImage(Image img, int x, int y, Color bgcolor,
|
||||
ImageObserver observer)
|
||||
{
|
||||
return g.drawImage(img, x, y, bgcolor, observer);
|
||||
}
|
||||
|
||||
public boolean drawImage(Image img, int x, int y, ImageObserver observer)
|
||||
{
|
||||
return g.drawImage(img, x, y, observer);
|
||||
}
|
||||
|
||||
public boolean drawImage(Image img, int x, int y, int width, int height,
|
||||
Color bgcolor, ImageObserver observer)
|
||||
{
|
||||
return g.drawImage(img, x, y, width, height, bgcolor, observer);
|
||||
}
|
||||
|
||||
public boolean drawImage(Image img, int x, int y, int width, int height,
|
||||
ImageObserver observer)
|
||||
{
|
||||
return g.drawImage(img, x, y, width, height, observer);
|
||||
}
|
||||
|
||||
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2,
|
||||
int sx1, int sy1, int sx2, int sy2, Color bgcolor,
|
||||
ImageObserver observer)
|
||||
{
|
||||
return g.drawImage(img, dx1, dy1, dx2, dy2,
|
||||
sx1, sy1, sx2, sy2, bgcolor, observer);
|
||||
}
|
||||
|
||||
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2,
|
||||
int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
|
||||
{
|
||||
return g.drawImage(img, dx1, dy1, dx2, dy2,
|
||||
sx1, sy1, sx2, sy2, observer);
|
||||
}
|
||||
|
||||
public void drawLine(int x1, int y1, int x2, int y2)
|
||||
{
|
||||
g.drawLine(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
public void drawOval(int x, int y, int width, int height)
|
||||
{
|
||||
g.drawOval(x, y, width, height);
|
||||
}
|
||||
|
||||
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
|
||||
{
|
||||
g.drawPolygon(xPoints, yPoints, nPoints);
|
||||
}
|
||||
|
||||
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
|
||||
{
|
||||
g.drawPolyline(xPoints, yPoints, nPoints);
|
||||
}
|
||||
|
||||
public void drawRoundRect(int x, int y, int width, int height,
|
||||
int arcWidth, int arcHeight)
|
||||
{
|
||||
g.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
|
||||
}
|
||||
|
||||
public void drawString(AttributedCharacterIterator iterator, int x, int y)
|
||||
{
|
||||
g.drawString(iterator, x, y);
|
||||
}
|
||||
|
||||
public void drawString(String str, int x, int y)
|
||||
{
|
||||
g.drawString(str, x, y);
|
||||
}
|
||||
|
||||
public void fillArc(int x, int y, int width, int height,
|
||||
int startAngle, int arcAngle)
|
||||
{
|
||||
g.fillArc(x, y, width, height, startAngle, arcAngle);
|
||||
}
|
||||
|
||||
public void fillOval(int x, int y, int width, int height)
|
||||
{
|
||||
g.fillOval(x, y, width, height);
|
||||
}
|
||||
|
||||
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
|
||||
{
|
||||
g.fillPolygon(xPoints, yPoints, nPoints);
|
||||
}
|
||||
|
||||
public void fillRect(int x, int y, int width, int height)
|
||||
{
|
||||
g.fillRect(x, y, width, height);
|
||||
}
|
||||
|
||||
public void fillRoundRect(int x, int y, int width, int height,
|
||||
int arcWidth, int arcHeight)
|
||||
{
|
||||
g.fillRoundRect(x, y, width, height, arcWidth, arcHeight);
|
||||
}
|
||||
|
||||
public Shape getClip()
|
||||
{
|
||||
return g.getClip();
|
||||
}
|
||||
|
||||
public Rectangle getClipBounds()
|
||||
{
|
||||
return g.getClipBounds();
|
||||
}
|
||||
|
||||
public Color getColor()
|
||||
{
|
||||
return g.getColor();
|
||||
}
|
||||
|
||||
public Font getFont()
|
||||
{
|
||||
return g.getFont();
|
||||
}
|
||||
|
||||
public FontMetrics getFontMetrics(Font f)
|
||||
{
|
||||
return g.getFontMetrics(f);
|
||||
}
|
||||
|
||||
public void setClip(int x, int y, int width, int height)
|
||||
{
|
||||
g.setClip(x, y, width, height);
|
||||
}
|
||||
|
||||
public void setClip(Shape clip)
|
||||
{
|
||||
g.setClip(clip);
|
||||
}
|
||||
|
||||
public void setColor(Color c)
|
||||
{
|
||||
g.setColor(c);
|
||||
}
|
||||
|
||||
public void setFont(Font font)
|
||||
{
|
||||
g.setFont(font);
|
||||
}
|
||||
|
||||
public void setPaintMode()
|
||||
{
|
||||
g.setPaintMode();
|
||||
}
|
||||
|
||||
public void setXORMode(Color c1)
|
||||
{
|
||||
g.setXORMode(c1);
|
||||
}
|
||||
|
||||
public void translate(int x, int y)
|
||||
{
|
||||
g.translate(x, y);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,403 @@
|
|||
/* JavaPrinterJob.java -- AWT printing implemented on javax.print.
|
||||
Copyright (C) 2006 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 gnu.java.awt.print;
|
||||
|
||||
import java.awt.HeadlessException;
|
||||
import java.awt.print.PageFormat;
|
||||
import java.awt.print.Pageable;
|
||||
import java.awt.print.Printable;
|
||||
import java.awt.print.PrinterException;
|
||||
import java.awt.print.PrinterJob;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.print.CancelablePrintJob;
|
||||
import javax.print.DocFlavor;
|
||||
import javax.print.DocPrintJob;
|
||||
import javax.print.PrintException;
|
||||
import javax.print.PrintService;
|
||||
import javax.print.PrintServiceLookup;
|
||||
import javax.print.ServiceUI;
|
||||
import javax.print.attribute.HashPrintRequestAttributeSet;
|
||||
import javax.print.attribute.IntegerSyntax;
|
||||
import javax.print.attribute.PrintRequestAttributeSet;
|
||||
import javax.print.attribute.TextSyntax;
|
||||
import javax.print.attribute.standard.Copies;
|
||||
import javax.print.attribute.standard.JobName;
|
||||
import javax.print.attribute.standard.OrientationRequested;
|
||||
import javax.print.attribute.standard.RequestingUserName;
|
||||
|
||||
/**
|
||||
* This is the default implementation of PrinterJob
|
||||
*
|
||||
* @author Sven de Marothy
|
||||
*/
|
||||
public class JavaPrinterJob extends PrinterJob
|
||||
{
|
||||
/**
|
||||
* The print service associated with this job
|
||||
*/
|
||||
private PrintService printer = null;
|
||||
|
||||
/**
|
||||
* Printing options;
|
||||
*/
|
||||
private PrintRequestAttributeSet attributes;
|
||||
|
||||
/**
|
||||
* Available print services
|
||||
*/
|
||||
private static PrintService[] services;
|
||||
|
||||
/**
|
||||
* The actual print job.
|
||||
*/
|
||||
private DocPrintJob printJob;
|
||||
|
||||
/**
|
||||
* The Printable object to print.
|
||||
*/
|
||||
private Printable printable;
|
||||
|
||||
/**
|
||||
* Page format.
|
||||
*/
|
||||
private PageFormat pageFormat;
|
||||
|
||||
/**
|
||||
* A pageable, or null
|
||||
*/
|
||||
private Pageable pageable = null;
|
||||
|
||||
/**
|
||||
* Cancelled or not
|
||||
*/
|
||||
private boolean cancelled = false;
|
||||
|
||||
static
|
||||
{
|
||||
// lookup all services without any constraints
|
||||
services = PrintServiceLookup.lookupPrintServices
|
||||
(DocFlavor.INPUT_STREAM.POSTSCRIPT, null);
|
||||
}
|
||||
|
||||
private static final Class copyClass = (new Copies(1)).getClass();
|
||||
private static final Class jobNameClass = (new JobName("", null)).getClass();
|
||||
private static final Class userNameClass = (new RequestingUserName("", null)).getClass();
|
||||
|
||||
/**
|
||||
* Initializes a new instance of <code>PrinterJob</code>.
|
||||
*/
|
||||
public JavaPrinterJob()
|
||||
{
|
||||
attributes = new HashPrintRequestAttributeSet();
|
||||
setCopies(1);
|
||||
setJobName("Java Printing");
|
||||
pageFormat = new PageFormat(); // default page format.
|
||||
}
|
||||
|
||||
private void getPageAttributes()
|
||||
{
|
||||
OrientationRequested orientation = (OrientationRequested)
|
||||
attributes.get( OrientationRequested.LANDSCAPE.getCategory() );
|
||||
if( orientation == null)
|
||||
return;
|
||||
|
||||
if( orientation.equals(OrientationRequested.PORTRAIT) )
|
||||
pageFormat.setOrientation(PageFormat.PORTRAIT);
|
||||
else if( orientation.equals(OrientationRequested.LANDSCAPE) )
|
||||
pageFormat.setOrientation(PageFormat.LANDSCAPE);
|
||||
else if( orientation.equals(OrientationRequested.REVERSE_LANDSCAPE) )
|
||||
pageFormat.setOrientation(PageFormat.REVERSE_LANDSCAPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of copies to be printed.
|
||||
*
|
||||
* @return The number of copies to be printed.
|
||||
*/
|
||||
public int getCopies()
|
||||
{
|
||||
return ((IntegerSyntax)attributes.get( jobNameClass )).getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the number of copies to be printed.
|
||||
*
|
||||
* @param copies The number of copies to be printed.
|
||||
*/
|
||||
public void setCopies(int copies)
|
||||
{
|
||||
attributes.add( new Copies( copies ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the print job.
|
||||
*
|
||||
* @return The name of the print job.
|
||||
*/
|
||||
public String getJobName()
|
||||
{
|
||||
return ((TextSyntax)attributes.get( jobNameClass )).getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of the print job.
|
||||
*
|
||||
* @param job_name The name of the print job.
|
||||
*/
|
||||
public void setJobName(String job_name)
|
||||
{
|
||||
attributes.add( new JobName(job_name, Locale.getDefault()) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the printing user name.
|
||||
*
|
||||
* @return The printing username.
|
||||
*/
|
||||
public String getUserName()
|
||||
{
|
||||
return ((TextSyntax)attributes.get( userNameClass )).getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels an in progress print job.
|
||||
*/
|
||||
public void cancel()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(printJob != null && (printJob instanceof CancelablePrintJob))
|
||||
{
|
||||
((CancelablePrintJob)printJob).cancel();
|
||||
cancelled = true;
|
||||
}
|
||||
}
|
||||
catch(PrintException pe)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests whether or not this job has been cancelled.
|
||||
*
|
||||
* @return <code>true</code> if this job has been cancelled, <code>false</code>
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean isCancelled()
|
||||
{
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clones the specified <code>PageFormat</code> object then alters the
|
||||
* clone so that it represents the default page format.
|
||||
*
|
||||
* @param page_format The <code>PageFormat</code> to clone.
|
||||
*
|
||||
* @return A new default page format.
|
||||
*/
|
||||
public PageFormat defaultPage(PageFormat page_format)
|
||||
{
|
||||
return new PageFormat();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a dialog box to the user which allows the page format
|
||||
* attributes to be modified.
|
||||
*
|
||||
* @param page_format The <code>PageFormat</code> object to modify.
|
||||
*
|
||||
* @return The modified <code>PageFormat</code>.
|
||||
*/
|
||||
public PageFormat pageDialog(PageFormat page_format)
|
||||
throws HeadlessException
|
||||
{
|
||||
return defaultPage(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the pages.
|
||||
*/
|
||||
public void print() throws PrinterException
|
||||
{
|
||||
if( printable == null && pageable == null ) // nothing to print?
|
||||
return;
|
||||
|
||||
PostScriptGraphics2D pg = new PostScriptGraphics2D( this );
|
||||
SpooledDocument doc = pg.spoolPostScript( printable, pageFormat,
|
||||
pageable );
|
||||
|
||||
cancelled = false;
|
||||
printJob = printer.createPrintJob();
|
||||
try
|
||||
{
|
||||
printJob.print(doc, attributes);
|
||||
}
|
||||
catch (PrintException pe)
|
||||
{
|
||||
PrinterException p = new PrinterException();
|
||||
p.initCause(pe);
|
||||
throw p;
|
||||
}
|
||||
// no printjob active.
|
||||
printJob = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the page with given attributes.
|
||||
*/
|
||||
public void print (PrintRequestAttributeSet attributes)
|
||||
throws PrinterException
|
||||
{
|
||||
this.attributes = attributes;
|
||||
print();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a dialog box to the user which allows the print job
|
||||
* attributes to be modified.
|
||||
*
|
||||
* @return <code>false</code> if the user cancels the dialog box,
|
||||
* <code>true</code> otherwise.
|
||||
*/
|
||||
public boolean printDialog() throws HeadlessException
|
||||
{
|
||||
return printDialog( attributes );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a dialog box to the user which allows the print job
|
||||
* attributes to be modified.
|
||||
*
|
||||
* @return <code>false</code> if the user cancels the dialog box,
|
||||
* <code>true</code> otherwise.
|
||||
*/
|
||||
public boolean printDialog(PrintRequestAttributeSet attributes)
|
||||
throws HeadlessException
|
||||
{
|
||||
PrintService chosenPrinter = ServiceUI.printDialog
|
||||
(null, 50, 50, services, null,
|
||||
DocFlavor.INPUT_STREAM.POSTSCRIPT, attributes);
|
||||
|
||||
getPageAttributes();
|
||||
|
||||
if( chosenPrinter != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
setPrintService( chosenPrinter );
|
||||
}
|
||||
catch(PrinterException pe)
|
||||
{
|
||||
// Should not happen.
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This sets the pages that are to be printed.
|
||||
*
|
||||
* @param pageable The pages to be printed, which may not be <code>null</code>.
|
||||
*/
|
||||
public void setPageable(Pageable pageable)
|
||||
{
|
||||
if( pageable == null )
|
||||
throw new NullPointerException("Pageable cannot be null.");
|
||||
this.pageable = pageable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets this specified <code>Printable</code> as the one to use for
|
||||
* rendering the pages on the print device.
|
||||
*
|
||||
* @param printable The <code>Printable</code> for the print job.
|
||||
*/
|
||||
public void setPrintable(Printable printable)
|
||||
{
|
||||
this.printable = printable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>Printable</code> and the page format for the pages
|
||||
* to be printed.
|
||||
*
|
||||
* @param printable The <code>Printable</code> for the print job.
|
||||
* @param page_format The <code>PageFormat</code> for the print job.
|
||||
*/
|
||||
public void setPrintable(Printable printable, PageFormat page_format)
|
||||
{
|
||||
this.printable = printable;
|
||||
this.pageFormat = page_format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes any alterations to the specified <code>PageFormat</code>
|
||||
* necessary to make it work with the current printer. The alterations
|
||||
* are made to a clone of the input object, which is then returned.
|
||||
*
|
||||
* @param page_format The <code>PageFormat</code> to validate.
|
||||
*
|
||||
* @return The validated <code>PageFormat</code>.
|
||||
*/
|
||||
public PageFormat validatePage(PageFormat page_format)
|
||||
{
|
||||
// FIXME
|
||||
return page_format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the printer for this print job to service. Subclasses that
|
||||
* support setting the print service override this method. Throws
|
||||
* PrinterException when the class doesn't support setting the printer,
|
||||
* the service doesn't support Pageable or Printable interfaces for 2D
|
||||
* print output.
|
||||
* @param service The new printer to use.
|
||||
* @throws PrinterException if service is not valid.
|
||||
*/
|
||||
public void setPrintService(PrintService service)
|
||||
throws PrinterException
|
||||
{
|
||||
if(!service.isDocFlavorSupported(DocFlavor.INPUT_STREAM.POSTSCRIPT))
|
||||
throw new PrinterException("This printer service is not supported.");
|
||||
printer = service;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,91 @@
|
|||
/* SpooledDocument.java -- Reurgitate a spooled PostScript file
|
||||
Copyright (C) 2006 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 gnu.java.awt.print;
|
||||
|
||||
import javax.print.Doc;
|
||||
import javax.print.DocFlavor;
|
||||
import javax.print.attribute.DocAttributeSet;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.Reader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class SpooledDocument implements Doc
|
||||
{
|
||||
private FileInputStream fis;
|
||||
|
||||
public SpooledDocument(File file)
|
||||
{
|
||||
try
|
||||
{
|
||||
fis = new FileInputStream(file);
|
||||
}
|
||||
catch (FileNotFoundException ffne)
|
||||
{
|
||||
// Shouldn't happen.
|
||||
}
|
||||
}
|
||||
|
||||
public DocAttributeSet getAttributes()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public DocFlavor getDocFlavor()
|
||||
{
|
||||
return DocFlavor.INPUT_STREAM.POSTSCRIPT;
|
||||
}
|
||||
|
||||
public Object getPrintData()
|
||||
{
|
||||
return fis;
|
||||
}
|
||||
|
||||
public Reader getReaderForText()
|
||||
{
|
||||
return new InputStreamReader(fis);
|
||||
}
|
||||
|
||||
public InputStream getStreamForBytes()
|
||||
{
|
||||
return fis;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,192 @@
|
|||
/* CharacterAttributeTranslator.java --
|
||||
Copyright (C) 2006 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 gnu.javax.swing.text.html;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.HashMap;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import javax.swing.text.MutableAttributeSet;
|
||||
import javax.swing.text.StyleConstants;
|
||||
import javax.swing.text.html.HTML.Attribute;
|
||||
import javax.swing.text.html.HTML.Tag;
|
||||
|
||||
/**
|
||||
* This is a small utility class to translate HTML character attributes to
|
||||
* Swing StyleConstants
|
||||
*/
|
||||
public class CharacterAttributeTranslator
|
||||
{
|
||||
/**
|
||||
* Maps color name to its hex encoding.
|
||||
*/
|
||||
private static final HashMap colorMap = new HashMap();
|
||||
static
|
||||
{
|
||||
colorMap.put("aqua" , "#00FFFF");
|
||||
colorMap.put("blue" , "#0000FF");
|
||||
colorMap.put("black", "#000000");
|
||||
colorMap.put("fuchsia" , "#FF00FF");
|
||||
colorMap.put("gray" , "#808080");
|
||||
colorMap.put("green" , "#008000");
|
||||
colorMap.put("lime" , "#00FF00");
|
||||
colorMap.put("maroon" , "#800000");
|
||||
colorMap.put("navy" , "#000080");
|
||||
colorMap.put("olive" , "#808000");
|
||||
colorMap.put("purple" , "#800080");
|
||||
colorMap.put("red" , "#FF0000");
|
||||
colorMap.put("silver" , "#C0C0C0");
|
||||
colorMap.put("teal" , "#008080");
|
||||
colorMap.put("white" , "#FFFFFF");
|
||||
colorMap.put("yellow" , "#FFFF00");
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert the color string represenation into java.awt.Color. The valid
|
||||
* values are like "aqua" , "#00FFFF" or "rgb(1,6,44)".
|
||||
*
|
||||
* @param colorName the color to convert.
|
||||
* @return the matching java.awt.color
|
||||
*/
|
||||
private static Color getColor(String colorName)
|
||||
{
|
||||
colorName = colorName.toLowerCase();
|
||||
try
|
||||
{
|
||||
if (colorName.startsWith("rgb"))
|
||||
{
|
||||
// rgb(red, green, blue) notation.
|
||||
StringTokenizer st = new StringTokenizer(colorName, " ,()");
|
||||
String representation = st.nextToken();
|
||||
|
||||
// Return null if the representation is not supported.
|
||||
if (! representation.equals("rgb"))
|
||||
return null;
|
||||
int red = Integer.parseInt(st.nextToken());
|
||||
int green = Integer.parseInt(st.nextToken());
|
||||
int blue = Integer.parseInt(st.nextToken());
|
||||
|
||||
return new Color(red, green, blue);
|
||||
}
|
||||
else
|
||||
{
|
||||
String s2 = (String) colorMap.get(colorName);
|
||||
if (s2 == null)
|
||||
s2 = colorName;
|
||||
return Color.decode(s2);
|
||||
}
|
||||
}
|
||||
catch (Exception nex)
|
||||
{
|
||||
// Can be either number format exception or illegal argument
|
||||
// exception.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate the HTML character attribute to the Swing style constant.
|
||||
*
|
||||
* @param charAttr the character attributes of the html tag
|
||||
* @param t the html tag itself
|
||||
* @param a the attribute set where the translated attributes will be stored
|
||||
*
|
||||
* @return true if some attributes were translated, false otherwise.
|
||||
*/
|
||||
public static boolean translateTag(MutableAttributeSet charAttr,
|
||||
Tag t, MutableAttributeSet a)
|
||||
{
|
||||
if(t == Tag.FONT)
|
||||
{
|
||||
Object color = a.getAttribute(Attribute.COLOR);
|
||||
if(color != null)
|
||||
{
|
||||
Color c = getColor(color.toString());
|
||||
if( c == null )
|
||||
return false;
|
||||
charAttr.addAttribute(StyleConstants.Foreground, c);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(a.getAttribute(Attribute.SIZE) != null)
|
||||
{
|
||||
// FIXME
|
||||
// charAttr.addAttribute(StyleConstants.FontSize,
|
||||
// new java.lang.Integer(72));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if( t == Tag.B )
|
||||
{
|
||||
charAttr.addAttribute(StyleConstants.Bold, Boolean.TRUE);
|
||||
return true;
|
||||
}
|
||||
|
||||
if( t == Tag.I )
|
||||
{
|
||||
charAttr.addAttribute(StyleConstants.Italic, Boolean.TRUE);
|
||||
return true;
|
||||
}
|
||||
|
||||
if( t == Tag.U )
|
||||
{
|
||||
charAttr.addAttribute(StyleConstants.Underline, Boolean.TRUE);
|
||||
return true;
|
||||
}
|
||||
|
||||
if( t == Tag.STRIKE )
|
||||
{
|
||||
charAttr.addAttribute(StyleConstants.StrikeThrough, Boolean.TRUE);
|
||||
return true;
|
||||
}
|
||||
|
||||
if( t == Tag.SUP )
|
||||
{
|
||||
charAttr.addAttribute(StyleConstants.Superscript, Boolean.TRUE);
|
||||
return true;
|
||||
}
|
||||
|
||||
if( t == Tag.SUB )
|
||||
{
|
||||
charAttr.addAttribute(StyleConstants.Subscript, Boolean.TRUE);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,213 @@
|
|||
/* CombinedAttributes.java -- A two combined sets of attributes
|
||||
Copyright (C) 2006 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 gnu.javax.swing.text.html;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Enumeration;
|
||||
|
||||
import javax.swing.text.AttributeSet;
|
||||
import javax.swing.text.SimpleAttributeSet;
|
||||
|
||||
/**
|
||||
* Contains the two combined attribute sets what are searched subsequently.
|
||||
* This is used to combine style sheet attributes with the HTML view attributes.
|
||||
* The parent cannot be used as the view may have its own attribute hierarchy.
|
||||
*
|
||||
* @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
|
||||
*/
|
||||
public class CombinedAttributes implements AttributeSet, Serializable
|
||||
{
|
||||
/**
|
||||
* Returns the elements from both enumerations.
|
||||
*/
|
||||
class CombinedEnumeration implements Enumeration
|
||||
{
|
||||
/**
|
||||
* Create a combined enumeration that enumerates over two enumerations.
|
||||
*
|
||||
* @param first the first enumeration to enumerate
|
||||
* @param second the second enumeration to enumerate
|
||||
*/
|
||||
CombinedEnumeration(Enumeration first, Enumeration second)
|
||||
{
|
||||
a = first;
|
||||
b = second;
|
||||
}
|
||||
|
||||
/**
|
||||
* The first enumeration (elements returned first)
|
||||
*/
|
||||
final Enumeration a;
|
||||
|
||||
/**
|
||||
* The second enumeration (elements returned later)
|
||||
*/
|
||||
final Enumeration b;
|
||||
|
||||
/** @inheritDoc */
|
||||
public boolean hasMoreElements()
|
||||
{
|
||||
return a.hasMoreElements() || b.hasMoreElements();
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
public Object nextElement()
|
||||
{
|
||||
return a.hasMoreElements() ? a.nextElement():b.nextElement();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The first attribute set.
|
||||
*/
|
||||
final AttributeSet a;
|
||||
|
||||
/**
|
||||
* The second attribute set.
|
||||
*/
|
||||
final AttributeSet b;
|
||||
|
||||
/**
|
||||
* Create the CombinedAttributes what search in the two sets. If any of the
|
||||
* two passed sets is null, another set is returned. Otherwise, the combined
|
||||
* attribute set is returned.
|
||||
*
|
||||
* @param primary the first set (searched first)
|
||||
* @param secondary the second set (searched later).
|
||||
*/
|
||||
public static AttributeSet combine(AttributeSet primary,
|
||||
AttributeSet secondary)
|
||||
{
|
||||
if (primary == null)
|
||||
return secondary;
|
||||
else if (secondary == null)
|
||||
return primary;
|
||||
else
|
||||
return new CombinedAttributes(primary, secondary);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the CombinedAttributes what search in the two sets.
|
||||
*
|
||||
* @param primary the first set (searched first)
|
||||
* @param secondary the second set (searched later).
|
||||
*/
|
||||
private CombinedAttributes(AttributeSet primary, AttributeSet secondary)
|
||||
{
|
||||
a = primary;
|
||||
b = secondary;
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
public boolean containsAttribute(Object name, Object value)
|
||||
{
|
||||
return a.containsAttribute(name, value) || b.containsAttribute(name, value);
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
public boolean containsAttributes(AttributeSet attributes)
|
||||
{
|
||||
Enumeration names = attributes.getAttributeNames();
|
||||
Object name;
|
||||
while (names.hasMoreElements())
|
||||
{
|
||||
name = names.nextElement();
|
||||
if (!containsAttribute(name, attributes.getAttribute(name)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
public AttributeSet copyAttributes()
|
||||
{
|
||||
SimpleAttributeSet copy = new SimpleAttributeSet();
|
||||
copy.addAttributes(a);
|
||||
copy.addAttributes(b);
|
||||
return copy;
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
public Object getAttribute(Object key)
|
||||
{
|
||||
Object value = a.getAttribute(key);
|
||||
if (value == null)
|
||||
value = b.getAttribute(key);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
public int getAttributeCount()
|
||||
{
|
||||
return a.getAttributeCount()+b.getAttributeCount();
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
public Enumeration getAttributeNames()
|
||||
{
|
||||
return new CombinedEnumeration(a.getAttributeNames(), b.getAttributeNames());
|
||||
}
|
||||
|
||||
/**
|
||||
* There is no one.
|
||||
*
|
||||
* @return null, always.
|
||||
*/
|
||||
public AttributeSet getResolveParent()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
public boolean isDefined(Object attrName)
|
||||
{
|
||||
return a.isDefined(attrName) || b.isDefined(attrName);
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
public boolean isEqual(AttributeSet attr)
|
||||
{
|
||||
if (attr.getAttributeCount() == getAttributeCount())
|
||||
return containsAttributes(attr);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,282 @@
|
|||
package gnu.javax.swing.text.html;
|
||||
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Graphics;
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.plaf.metal.MetalLookAndFeel;
|
||||
|
||||
/**
|
||||
* Creates icons for ImageView. The icons reflect the basic ideas of the Sun's
|
||||
* icons as they would be described in the text (sheet of paper with image and
|
||||
* broken sheet of paper with image). They are not pixel to pixel identical and
|
||||
* contain elements from the metal icon factory.
|
||||
*
|
||||
* @author Audrius Meskauskas (audriusa@bioinformatics.org)
|
||||
*/
|
||||
public class ImageViewIconFactory
|
||||
{
|
||||
private static Icon noImageIcon;
|
||||
|
||||
private static Icon loadingImageIcon;
|
||||
|
||||
/**
|
||||
* This icon reflects the general concept (broken sheet of paper with
|
||||
* image), but is currently not pixel to pixel identical with the Sun's
|
||||
* implementation.
|
||||
*/
|
||||
public static class NoImageIcon implements Icon, Serializable
|
||||
{
|
||||
/**
|
||||
* Creates a new icon.
|
||||
*/
|
||||
public NoImageIcon()
|
||||
{
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the icon, in pixels.
|
||||
*
|
||||
* @return The width of the icon.
|
||||
*/
|
||||
public int getIconWidth()
|
||||
{
|
||||
return 38;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the icon, in pixels.
|
||||
*
|
||||
* @return The height of the icon.
|
||||
*/
|
||||
public int getIconHeight()
|
||||
{
|
||||
return 38;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paints the icon using colors from the {@link MetalLookAndFeel}.
|
||||
*
|
||||
* @param c
|
||||
* the component (ignored).
|
||||
* @param g
|
||||
* the graphics device.
|
||||
* @param x
|
||||
* the x-coordinate for the top-left of the icon.
|
||||
* @param y
|
||||
* the y-coordinate for the top-left of the icon.
|
||||
*/
|
||||
public void paintIcon(Component c, Graphics g, int x, int y)
|
||||
{
|
||||
// frame
|
||||
Color savedColor = g.getColor();
|
||||
|
||||
g.setColor(MetalLookAndFeel.getBlack());
|
||||
|
||||
g.drawLine(x, y, x + 19, y);
|
||||
|
||||
g.drawLine(x, y + 1, x, y + 5);
|
||||
g.drawLine(x, y + 13, x, y + 25);
|
||||
|
||||
g.drawLine(x, y + 25, x + 22, y + 25);
|
||||
|
||||
g.drawLine(x + 22, y + 25, x + 22, y + 21);
|
||||
g.drawLine(x + 22, y + 13, x + 22, y + 6);
|
||||
|
||||
g.drawLine(x + 22, y + 6, x + 19, y);
|
||||
|
||||
g.drawLine(x + 17, y + 2, x + 21, y + 6);
|
||||
|
||||
g.drawLine(x + 18, y + 1, x + 19, y + 1);
|
||||
|
||||
g.setColor(MetalLookAndFeel.getControlShadow());
|
||||
|
||||
g.drawLine(x + 1, y + 1, x + 17, y + 1);
|
||||
|
||||
g.drawLine(x + 1, y + 1, x + 1, y + 5);
|
||||
g.drawLine(x + 1, y + 13, x + 1, y + 24);
|
||||
|
||||
g.drawLine(x + 1, y + 24, x + 21, y + 24);
|
||||
|
||||
g.drawLine(x + 21, y + 24, x + 21, y + 21);
|
||||
g.drawLine(x + 21, y + 13, x + 21, y + 7);
|
||||
|
||||
g.drawLine(x + 18, y + 2, x + 20, y + 4);
|
||||
|
||||
// Breaking line
|
||||
|
||||
// Shadow
|
||||
g.drawLine(x + 1, y + 6, x + 20, y + 13);
|
||||
g.drawLine(x + 1, y + 13, x + 20, y + 20);
|
||||
|
||||
// Edge
|
||||
g.setColor(MetalLookAndFeel.getBlack());
|
||||
g.drawLine(x, y + 6, x + 21, y + 14);
|
||||
g.drawLine(x, y + 12, x + 21, y + 20);
|
||||
|
||||
// Picture
|
||||
|
||||
y += 1;
|
||||
x += 3;
|
||||
|
||||
g.setColor(MetalLookAndFeel.getBlack());
|
||||
|
||||
// roof
|
||||
g.drawLine(x + 4, y + 5, x + 8, y + 1);
|
||||
g.drawLine(x + 8, y + 1, x + 15, y + 8);
|
||||
|
||||
// chimney
|
||||
g.drawLine(x + 11, y + 2, x + 11, y + 4);
|
||||
g.drawLine(x + 12, y + 2, x + 12, y + 5);
|
||||
|
||||
g.setColor(MetalLookAndFeel.getControlDarkShadow());
|
||||
|
||||
// roof paint
|
||||
int xx = x + 8;
|
||||
for (int i = 0; i < 4; i++)
|
||||
g.drawLine(xx - i, y + 2 + i, xx + i, y + 2 + i);
|
||||
g.fillRect(x + 4, y + 6, 9, 2);
|
||||
|
||||
// base of house
|
||||
g.drawLine(x + 3, y + 14, x + 3, y + 18);
|
||||
g.drawLine(x + 3, y + 18, x + 13, y + 18);
|
||||
|
||||
g.setColor(savedColor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This icon reflects the general concept (sheet of paper with image), but is
|
||||
* currently not pixel to pixel identical with the Sun's implementation.
|
||||
*/
|
||||
public static class LoadingImageIcon implements Icon, Serializable
|
||||
{
|
||||
|
||||
/**
|
||||
* Creates a new icon.
|
||||
*/
|
||||
public LoadingImageIcon()
|
||||
{
|
||||
// Nothing to do here.
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the icon, in pixels.
|
||||
*
|
||||
* @return The width of the icon.
|
||||
*/
|
||||
public int getIconWidth()
|
||||
{
|
||||
return 38;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the icon, in pixels.
|
||||
*
|
||||
* @return The height of the icon.
|
||||
*/
|
||||
public int getIconHeight()
|
||||
{
|
||||
return 38;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paints the icon using colors from the {@link MetalLookAndFeel}.
|
||||
*
|
||||
* @param c
|
||||
* the component (ignored).
|
||||
* @param g
|
||||
* the graphics device.
|
||||
* @param x
|
||||
* the x-coordinate for the top-left of the icon.
|
||||
* @param y
|
||||
* the y-coordinate for the top-left of the icon.
|
||||
*/
|
||||
public void paintIcon(Component c, Graphics g, int x, int y)
|
||||
{
|
||||
// frame
|
||||
Color savedColor = g.getColor();
|
||||
|
||||
g.setColor(Color.black);
|
||||
g.drawLine(x, y, x + 19, y);
|
||||
g.drawLine(x, y + 1, x, y + 25);
|
||||
g.drawLine(x, y + 25, x + 22, y + 25);
|
||||
g.drawLine(x + 22, y + 25, x + 22, y + 6);
|
||||
g.drawLine(x + 22, y + 6, x + 19, y);
|
||||
|
||||
g.drawLine(x + 17, y + 2, x + 21, y + 6);
|
||||
g.drawLine(x + 18, y + 1, x + 19, y + 1);
|
||||
|
||||
g.setColor(new Color(204, 204, 255));
|
||||
|
||||
g.drawLine(x + 1, y + 1, x + 17, y + 1);
|
||||
g.drawLine(x + 1, y + 1, x + 1, y + 24);
|
||||
g.drawLine(x + 1, y + 24, x + 21, y + 24);
|
||||
g.drawLine(x + 21, y + 24, x + 21, y + 7);
|
||||
g.drawLine(x + 18, y + 2, x + 20, y + 4);
|
||||
|
||||
// Picture (house)
|
||||
|
||||
y += 3;
|
||||
x += 3;
|
||||
|
||||
g.setColor(MetalLookAndFeel.getBlack());
|
||||
|
||||
// roof
|
||||
g.drawLine(x + 1, y + 8, x + 8, y + 1);
|
||||
g.drawLine(x + 8, y + 1, x + 15, y + 8);
|
||||
|
||||
// base of house
|
||||
g.drawLine(x + 3, y + 6, x + 3, y + 15);
|
||||
g.drawLine(x + 3, y + 15, x + 13, y + 15);
|
||||
g.drawLine(x + 13, y + 6, x + 13, y + 15);
|
||||
|
||||
// door frame
|
||||
g.drawLine(x + 6, y + 9, x + 6, y + 15);
|
||||
g.drawLine(x + 6, y + 9, x + 10, y + 9);
|
||||
g.drawLine(x + 10, y + 9, x + 10, y + 15);
|
||||
|
||||
// chimney
|
||||
g.drawLine(x + 11, y + 2, x + 11, y + 4);
|
||||
g.drawLine(x + 12, y + 2, x + 12, y + 5);
|
||||
|
||||
g.setColor(MetalLookAndFeel.getControlDarkShadow());
|
||||
|
||||
// roof paint
|
||||
int xx = x + 8;
|
||||
for (int i = 0; i < 4; i++)
|
||||
g.drawLine(xx - i, y + 2 + i, xx + i, y + 2 + i);
|
||||
g.fillRect(x + 4, y + 6, 9, 2);
|
||||
|
||||
// door knob
|
||||
g.drawLine(x + 9, y + 12, x + 9, y + 12);
|
||||
|
||||
// house paint
|
||||
g.setColor(MetalLookAndFeel.getPrimaryControl());
|
||||
g.drawLine(x + 4, y + 8, x + 12, y + 8);
|
||||
g.fillRect(x + 4, y + 9, 2, 6);
|
||||
g.fillRect(x + 11, y + 9, 2, 6);
|
||||
|
||||
g.setColor(savedColor);
|
||||
}
|
||||
}
|
||||
|
||||
public static Icon getNoImageIcon()
|
||||
{
|
||||
if (noImageIcon == null)
|
||||
noImageIcon = new NoImageIcon();
|
||||
return noImageIcon;
|
||||
}
|
||||
|
||||
public static Icon getLoadingImageIcon()
|
||||
{
|
||||
if (loadingImageIcon == null)
|
||||
loadingImageIcon = new LoadingImageIcon();
|
||||
return loadingImageIcon;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,263 @@
|
|||
/* SmallHtmlAttributeSet.java -- Small fixed HTML attribute set
|
||||
Copyright (C) 2006 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 gnu.javax.swing.text.html.parser;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Enumeration;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import javax.swing.text.AttributeSet;
|
||||
import javax.swing.text.html.HTML.Attribute;
|
||||
import javax.swing.text.html.HTML.Tag;
|
||||
|
||||
/**
|
||||
* Small fixed HTML attribute set. The most of the HTML elements contain only
|
||||
* several attributes. With four attributes, the number of operations in more
|
||||
* complex algorithms is not larger than using the naive algorithm.
|
||||
*
|
||||
* Same as HtmlAttributeSet, this set allows both strings and non-string as
|
||||
* keys. The strings are case insensitive, the non strings are compared with
|
||||
* .equals.
|
||||
*
|
||||
* @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
|
||||
*/
|
||||
public class SmallHtmlAttributeSet
|
||||
implements AttributeSet, Cloneable, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1;
|
||||
|
||||
/**
|
||||
* The keys, stored in this attribute set.
|
||||
*/
|
||||
final Object[] keys;
|
||||
|
||||
/**
|
||||
* The values, stored in this attribute set.
|
||||
*/
|
||||
final Object[] values;
|
||||
|
||||
/**
|
||||
* The parent, used for resolving the values, not found in this set.
|
||||
*/
|
||||
final AttributeSet parent;
|
||||
|
||||
/**
|
||||
* Create a new small fixed attribute set that contains the unchangeable copy
|
||||
* of the passed attribute set and inherits its parent.
|
||||
*
|
||||
* @param copyFrom the attribute set, containing the attribute values to copy.
|
||||
*/
|
||||
public SmallHtmlAttributeSet(AttributeSet copyFrom)
|
||||
{
|
||||
int n = copyFrom.getAttributeCount();
|
||||
|
||||
keys = new Object[n];
|
||||
values = new Object[n];
|
||||
parent = copyFrom.getResolveParent();
|
||||
|
||||
Enumeration en = copyFrom.getAttributeNames();
|
||||
Object key;
|
||||
Object value;
|
||||
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
key = en.nextElement();
|
||||
keys[i] = key;
|
||||
value = copyFrom.getAttribute(key);
|
||||
if (value instanceof String)
|
||||
value = ((String) value).toLowerCase();
|
||||
values[i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean containsAttribute(Object name, Object value)
|
||||
{
|
||||
Object contains = getAttribute(name);
|
||||
if (value == null)
|
||||
return value == contains;
|
||||
else
|
||||
return value.equals(contains);
|
||||
}
|
||||
|
||||
public boolean containsAttributes(AttributeSet attributes)
|
||||
{
|
||||
if (attributes == this)
|
||||
return true;
|
||||
Object v;
|
||||
for (int i = 0; i < keys.length; i++)
|
||||
{
|
||||
v = attributes.getAttribute(keys[i]);
|
||||
if (v != values[i])
|
||||
{
|
||||
if (values[i] == null)
|
||||
return false;
|
||||
else if (! values[i].equals(v))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* THIS can be safely returned as the set is not mutable.
|
||||
*/
|
||||
public AttributeSet copyAttributes()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attribute value, matching this key. If not found in this set, the
|
||||
* call is delegated to parent.
|
||||
*
|
||||
* @return the value, matching key (or null if none).
|
||||
*/
|
||||
public Object getAttribute(Object key)
|
||||
{
|
||||
// Null and HTML attributes or tags can be searched by direct comparison.
|
||||
if (key == null || key instanceof Attribute || key instanceof Tag)
|
||||
{
|
||||
for (int i = 0; i < keys.length; i++)
|
||||
{
|
||||
if (keys[i] == key)
|
||||
return values[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Strings are case insensitive. Only string can be match the string.
|
||||
else if (key instanceof String)
|
||||
{
|
||||
String ks = (String) key;
|
||||
for (int i = 0; i < keys.length; i++)
|
||||
{
|
||||
if (keys[i] instanceof String)
|
||||
if (ks.equalsIgnoreCase((String) keys[i]))
|
||||
return values[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise, defaults to .equals
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < keys.length; i++)
|
||||
{
|
||||
if (key.equals(keys[i]))
|
||||
return values[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (parent != null)
|
||||
return parent.getAttribute(key);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of the stored attributes.
|
||||
*/
|
||||
public int getAttributeCount()
|
||||
{
|
||||
return keys.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enumeration, containing the attribute names. No guard agains the
|
||||
* concurent modification is required as the set is not mutable.
|
||||
*/
|
||||
public Enumeration getAttributeNames()
|
||||
{
|
||||
return new Enumeration()
|
||||
{
|
||||
int p = 0;
|
||||
|
||||
public boolean hasMoreElements()
|
||||
{
|
||||
return p < keys.length;
|
||||
}
|
||||
|
||||
public Object nextElement()
|
||||
{
|
||||
if (p < keys.length)
|
||||
return keys[p++];
|
||||
else
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the parent that this set uses to resolve the not found attributes.
|
||||
*/
|
||||
public AttributeSet getResolveParent()
|
||||
{
|
||||
return parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given attribute is defined in this set (not in the parent).
|
||||
*/
|
||||
public boolean isDefined(Object attrName)
|
||||
{
|
||||
if (attrName instanceof String)
|
||||
attrName = ((String) attrName).toLowerCase();
|
||||
|
||||
for (int i = 0; i < keys.length; i++)
|
||||
{
|
||||
if (attrName.equals(keys[i]))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check this set and another set for equality by content.
|
||||
*/
|
||||
public boolean isEqual(AttributeSet attr)
|
||||
{
|
||||
return keys.length == attr.getAttributeCount() && containsAttributes(attr);
|
||||
}
|
||||
|
||||
/**
|
||||
* It is safe to return THIS on cloning, if one happens.
|
||||
*/
|
||||
protected Object clone()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -46,6 +46,7 @@ import javax.swing.text.html.HTML;
|
|||
|
||||
/**
|
||||
* A set, adapted to store HTML attributes.
|
||||
*
|
||||
* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
|
||||
*/
|
||||
public class htmlAttributeSet
|
||||
|
@ -53,23 +54,34 @@ public class htmlAttributeSet
|
|||
{
|
||||
public static final htmlAttributeSet EMPTY_HTML_ATTRIBUTE_SET =
|
||||
new htmlAttributeSet();
|
||||
|
||||
AttributeSet parent;
|
||||
|
||||
/**
|
||||
* Looks in this set and, if not found, later looks in the parent set.
|
||||
* Calls toString(), allowing to pass as HTML.Attribute, as String
|
||||
* to this method.
|
||||
* @param key A key to search for a value.
|
||||
* Looks in this set and, if not found, later looks in the parent set. Calls
|
||||
* toString(), allowing to pass as HTML.Attribute, as String to this method.
|
||||
*
|
||||
* @param _key A key to search for a value.
|
||||
* @return The value, if one is defined.
|
||||
*/
|
||||
public Object getAttribute(Object _key)
|
||||
{
|
||||
Object v = super.getAttribute(_key);
|
||||
if (v != null || _key == null)
|
||||
return v;
|
||||
|
||||
Object key = _key.toString().toLowerCase();
|
||||
|
||||
Object v = super.getAttribute(key);
|
||||
v = super.getAttribute(key);
|
||||
if (v != null)
|
||||
return v;
|
||||
else if (parent != null)
|
||||
|
||||
key = HTML.getAttributeKey((String) key);
|
||||
v = super.getAttribute(key);
|
||||
if (v != null)
|
||||
return v;
|
||||
|
||||
if (parent != null)
|
||||
return parent.getAttribute(key);
|
||||
else
|
||||
return null;
|
||||
|
@ -85,26 +97,29 @@ public class htmlAttributeSet
|
|||
final Enumeration enumeration = super.getAttributeNames();
|
||||
|
||||
return new Enumeration()
|
||||
{
|
||||
public boolean hasMoreElements()
|
||||
{
|
||||
public boolean hasMoreElements()
|
||||
{
|
||||
return enumeration.hasMoreElements();
|
||||
}
|
||||
return enumeration.hasMoreElements();
|
||||
}
|
||||
|
||||
public Object nextElement()
|
||||
{
|
||||
Object key = enumeration.nextElement();
|
||||
HTML.Attribute hKey = HTML.getAttributeKey((String) key);
|
||||
if (hKey != null)
|
||||
return hKey;
|
||||
else
|
||||
return key;
|
||||
}
|
||||
};
|
||||
public Object nextElement()
|
||||
{
|
||||
Object key = enumeration.nextElement();
|
||||
if (key instanceof String)
|
||||
{
|
||||
HTML.Attribute hKey = HTML.getAttributeKey((String) key);
|
||||
if (hKey != null)
|
||||
return hKey;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the parent set, containing the default values.
|
||||
*
|
||||
* @param a_parent
|
||||
*/
|
||||
public void setResolveParent(AttributeSet a_parent)
|
||||
|
@ -114,7 +129,8 @@ public class htmlAttributeSet
|
|||
|
||||
/**
|
||||
* Get the parent set, containing the default values.
|
||||
* @return
|
||||
*
|
||||
* @return the parent, used to resolve the attributes.
|
||||
*/
|
||||
public AttributeSet getResolveParent()
|
||||
{
|
||||
|
@ -123,11 +139,45 @@ public class htmlAttributeSet
|
|||
|
||||
/**
|
||||
* Add the attribute to this attribute set.
|
||||
* @param key Attribute key (will be case insensitive)
|
||||
*
|
||||
* @param key Attribute key (if string, it will be case insensitive)
|
||||
* @param value Attribute value
|
||||
*/
|
||||
public void addAttribute(Object key, Object value)
|
||||
{
|
||||
super.addAttribute(key.toString().toLowerCase(), value);
|
||||
if (key instanceof String)
|
||||
super.addAttribute(((String) key).toLowerCase(), value);
|
||||
else
|
||||
super.addAttribute(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy attributes. The returned copy does not longer contains the extended
|
||||
* features, needed to participate in the HTML parsing. The returned set may
|
||||
* not be mutable.
|
||||
*/
|
||||
public AttributeSet copyAttributes()
|
||||
{
|
||||
if (getAttributeCount() <= 8)
|
||||
// For the small size, typical in HTML tags, the direct iteration is
|
||||
// faster than more complex algorithms.
|
||||
return new SmallHtmlAttributeSet(this);
|
||||
else
|
||||
return (AttributeSet) clone();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a clone of the attribute set.
|
||||
*
|
||||
* @return A clone of the attribute set.
|
||||
*/
|
||||
public Object clone()
|
||||
{
|
||||
htmlAttributeSet set = new htmlAttributeSet();
|
||||
set.addAttributes(this);
|
||||
AttributeSet parent = getResolveParent();
|
||||
if (parent != null)
|
||||
set.setResolveParent(parent);
|
||||
return set;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,8 +65,6 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AWK = @AWK@
|
||||
BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
|
||||
BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
|
||||
CAIRO_CFLAGS = @CAIRO_CFLAGS@
|
||||
CAIRO_LIBS = @CAIRO_LIBS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
|
@ -93,8 +91,12 @@ CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
|
|||
CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
|
||||
CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
|
||||
CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
|
||||
CREATE_PLUGIN_FALSE = @CREATE_PLUGIN_FALSE@
|
||||
CREATE_PLUGIN_TRUE = @CREATE_PLUGIN_TRUE@
|
||||
CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
|
||||
CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
|
||||
CREATE_WRAPPERS_FALSE = @CREATE_WRAPPERS_FALSE@
|
||||
CREATE_WRAPPERS_TRUE = @CREATE_WRAPPERS_TRUE@
|
||||
CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
|
||||
CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
|
||||
CXX = @CXX@
|
||||
|
@ -117,6 +119,8 @@ EXAMPLESDIR = @EXAMPLESDIR@
|
|||
EXEEXT = @EXEEXT@
|
||||
FASTJAR = @FASTJAR@
|
||||
FIND = @FIND@
|
||||
FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
|
||||
FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
|
||||
FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
|
||||
FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
|
||||
FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
|
||||
|
@ -132,9 +136,8 @@ FREETYPE2_LIBS = @FREETYPE2_LIBS@
|
|||
GCJ = @GCJ@
|
||||
GCJX = @GCJX@
|
||||
GJDOC = @GJDOC@
|
||||
GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@
|
||||
GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
|
||||
GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
|
||||
|
@ -156,6 +159,7 @@ KJC = @KJC@
|
|||
LDFLAGS = @LDFLAGS@
|
||||
LIBDEBUG = @LIBDEBUG@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBMAGIC = @LIBMAGIC@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
|
@ -169,6 +173,8 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
|||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR = @MKDIR@
|
||||
MOC = @MOC@
|
||||
MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
|
||||
MOZILLA_LIBS = @MOZILLA_LIBS@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
|
@ -182,6 +188,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
|
|||
PATH_TO_GLIBJ_ZIP = @PATH_TO_GLIBJ_ZIP@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PLUGIN_DIR = @PLUGIN_DIR@
|
||||
QT_CFLAGS = @QT_CFLAGS@
|
||||
QT_LIBS = @QT_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
|
@ -201,11 +208,13 @@ USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
|
|||
USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@
|
||||
USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@
|
||||
VERSION = @VERSION@
|
||||
VM_BINARY = @VM_BINARY@
|
||||
WARNING_CFLAGS = @WARNING_CFLAGS@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
XSLT_CFLAGS = @XSLT_CFLAGS@
|
||||
XSLT_LIBS = @XSLT_LIBS@
|
||||
XTEST_LIBS = @XTEST_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
|
|
|
@ -9,9 +9,6 @@
|
|||
/* Define to enable support for local sockets. */
|
||||
#undef ENABLE_LOCAL_SOCKETS
|
||||
|
||||
/* defined if cairo support was built in */
|
||||
#undef GTK_CAIRO
|
||||
|
||||
/* Define to 1 if you have the `accept' function. */
|
||||
#undef HAVE_ACCEPT
|
||||
|
||||
|
@ -99,9 +96,15 @@
|
|||
/* Define to 1 if you have the `lseek' function. */
|
||||
#undef HAVE_LSEEK
|
||||
|
||||
/* Define to 1 if you have the `lstat' function. */
|
||||
#undef HAVE_LSTAT
|
||||
|
||||
/* Define to 1 if you have the `madvise' function. */
|
||||
#undef HAVE_MADVISE
|
||||
|
||||
/* Define to 1 if you have the <magic.h> header file. */
|
||||
#undef HAVE_MAGIC_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
|
@ -132,6 +135,9 @@
|
|||
/* Define to 1 if you have the `read' function. */
|
||||
#undef HAVE_READ
|
||||
|
||||
/* Define to 1 if you have the `readlink' function. */
|
||||
#undef HAVE_READLINK
|
||||
|
||||
/* Define to 1 if you have the `recvfrom' function. */
|
||||
#undef HAVE_RECVFROM
|
||||
|
||||
|
@ -230,6 +236,12 @@
|
|||
/* Define to 1 if you have the `write' function. */
|
||||
#undef HAVE_WRITE
|
||||
|
||||
/* Define to 1 if you have libXrandr. */
|
||||
#undef HAVE_XRANDR
|
||||
|
||||
/* Define to 1 if you have libXrender. */
|
||||
#undef HAVE_XRENDER
|
||||
|
||||
/* Define if the host machine stores words of multi-word integers in
|
||||
big-endian order. */
|
||||
#undef HOST_WORDS_BIG_ENDIAN
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
|
||||
#ifndef __gnu_java_awt_peer_gtk_CairoGraphics2D__
|
||||
#define __gnu_java_awt_peer_gtk_CairoGraphics2D__
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_init (JNIEnv *env, jobject, jlong);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_disposeNative (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_drawPixels (JNIEnv *env, jobject, jintArray, jint, jint, jint, jdoubleArray);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setGradient (JNIEnv *env, jobject, jdouble, jdouble, jdouble, jdouble, jint, jint, jint, jint, jint, jint, jint, jint, jboolean);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setTexturePixels (JNIEnv *env, jobject, jintArray, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetMatrix (JNIEnv *env, jobject, jdoubleArray);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetOperator (JNIEnv *env, jobject, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetRGBAColor (JNIEnv *env, jobject, jdouble, jdouble, jdouble, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetFillRule (JNIEnv *env, jobject, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetLine (JNIEnv *env, jobject, jdouble, jint, jint, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetDash (JNIEnv *env, jobject, jdoubleArray, jint, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawGlyphVector (JNIEnv *env, jobject, jobject, jfloat, jfloat, jint, jintArray, jfloatArray);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelCurveTo (JNIEnv *env, jobject, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRectangle (JNIEnv *env, jobject, jdouble, jdouble, jdouble, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoNewPath (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoClosePath (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoMoveTo (JNIEnv *env, jobject, jdouble, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelMoveTo (JNIEnv *env, jobject, jdouble, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoLineTo (JNIEnv *env, jobject, jdouble, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelLineTo (JNIEnv *env, jobject, jdouble, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoCurveTo (JNIEnv *env, jobject, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoStroke (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoFill (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoClip (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoPreserveClip (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoResetClip (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSurfaceSetFilter (JNIEnv *env, jobject, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __gnu_java_awt_peer_gtk_CairoGraphics2D__ */
|
|
@ -0,0 +1,28 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
|
||||
#ifndef __gnu_java_awt_peer_gtk_CairoSurface__
|
||||
#define __gnu_java_awt_peer_gtk_CairoSurface__
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_create (JNIEnv *env, jobject, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_destroy (JNIEnv *env, jobject);
|
||||
JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_nativeGetElem (JNIEnv *env, jobject, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_nativeSetElem (JNIEnv *env, jobject, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_drawSurface (JNIEnv *env, jobject, jobject, jdoubleArray);
|
||||
JNIEXPORT jintArray JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_getPixels (JNIEnv *env, jobject, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_setPixels (JNIEnv *env, jobject, jintArray);
|
||||
JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_getFlippedBuffer (JNIEnv *env, jobject, jint);
|
||||
JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_newCairoContext (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoSurface_copyAreaNative (JNIEnv *env, jobject, jint, jint, jint, jint, jint, jint, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __gnu_java_awt_peer_gtk_CairoSurface__ */
|
|
@ -0,0 +1,26 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
|
||||
#ifndef __gnu_java_awt_peer_gtk_ComponentGraphics__
|
||||
#define __gnu_java_awt_peer_gtk_ComponentGraphics__
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_initState (JNIEnv *env, jobject, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_disposeSurface (JNIEnv *env, jobject, jlong);
|
||||
JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_initFromVolatile (JNIEnv *env, jobject, jlong, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_start_1gdk_1drawing (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_end_1gdk_1drawing (JNIEnv *env, jobject);
|
||||
JNIEXPORT jboolean JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_hasXRender (JNIEnv *env, jclass);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_copyAreaNative (JNIEnv *env, jobject, jobject, jint, jint, jint, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_drawVolatile (JNIEnv *env, jobject, jobject, jobject, jint, jint, jint, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __gnu_java_awt_peer_gtk_ComponentGraphics__ */
|
|
@ -0,0 +1,20 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
|
||||
#ifndef __gnu_java_awt_peer_gtk_ComponentGraphicsCopy__
|
||||
#define __gnu_java_awt_peer_gtk_ComponentGraphicsCopy__
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphicsCopy_getPixbuf (JNIEnv *env, jobject, jobject, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphicsCopy_copyPixbuf (JNIEnv *env, jobject, jobject, jobject, jint, jint, jint, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __gnu_java_awt_peer_gtk_ComponentGraphicsCopy__ */
|
|
@ -0,0 +1,22 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
|
||||
#ifndef __gnu_java_awt_peer_gtk_FreetypeGlyphVector__
|
||||
#define __gnu_java_awt_peer_gtk_FreetypeGlyphVector__
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyph (JNIEnv *env, jobject, jint);
|
||||
JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getKerning (JNIEnv *env, jobject, jint, jint);
|
||||
JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getMetricsNative (JNIEnv *env, jobject, jint);
|
||||
JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphOutlineNative (JNIEnv *env, jobject, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __gnu_java_awt_peer_gtk_FreetypeGlyphVector__ */
|
|
@ -13,10 +13,11 @@ extern "C"
|
|||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_initStaticState (JNIEnv *env, jclass);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_initState (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_dispose (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont (JNIEnv *env, jobject, jstring, jint, jint, jboolean);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont (JNIEnv *env, jobject, jstring, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_getFontMetrics (JNIEnv *env, jobject, jdoubleArray);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics (JNIEnv *env, jobject, jstring, jdoubleArray);
|
||||
JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_getGlyphVector (JNIEnv *env, jobject, jstring, jobject, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_releasePeerGraphicsResource (JNIEnv *env, jobject);
|
||||
JNIEXPORT jbyteArray JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTrueTypeTable (JNIEnv *env, jobject, jbyte, jbyte, jbyte, jbyte);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -10,6 +10,10 @@ extern "C"
|
|||
{
|
||||
#endif
|
||||
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_initStaticState (JNIEnv *env, jclass);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeInitState (JNIEnv *env, jobject);
|
||||
JNIEXPORT jobjectArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeGetScreenDevices (JNIEnv *env, jobject);
|
||||
JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeGetDefaultScreenDevice (JNIEnv *env, jobject);
|
||||
JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeGetNumFontFamilies (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeGetFontFamilies (JNIEnv *env, jobject, jobjectArray);
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
|
||||
#ifndef __gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice__
|
||||
#define __gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice__
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_initStaticState (JNIEnv *env, jclass);
|
||||
JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetFixedDisplayMode (JNIEnv *env, jobject, jobject);
|
||||
JNIEXPORT jstring JNICALL Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetIDString (JNIEnv *env, jobject);
|
||||
JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetDisplayModeIndex (JNIEnv *env, jobject, jobject);
|
||||
JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetDisplayModeRate (JNIEnv *env, jobject, jobject);
|
||||
JNIEXPORT jobjectArray JNICALL Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetDisplayModes (JNIEnv *env, jobject, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeSetDisplayMode (JNIEnv *env, jobject, jobject, jint, jshort);
|
||||
JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetBounds (JNIEnv *env, jobject);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice__ */
|
|
@ -11,10 +11,12 @@ extern "C"
|
|||
#endif
|
||||
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_setText (JNIEnv *env, jobject, jstring);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_setFont (JNIEnv *env, jobject, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_getExtents (JNIEnv *env, jobject, jdoubleArray, jdoubleArray);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_indexToPos (JNIEnv *env, jobject, jint, jdoubleArray);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_initState (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_dispose (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_cairoDrawGdkTextLayout (JNIEnv *env, jobject, jobject, jfloat, jfloat);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_initStaticState (JNIEnv *env, jclass);
|
||||
JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_getOutline (JNIEnv *env, jobject, jobject);
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ extern "C"
|
|||
#endif
|
||||
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_realize (JNIEnv *env, jobject);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetS
|
|||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetParent (JNIEnv *env, jobject, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetRequestFocus (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetDispatchKeyEvent (JNIEnv *env, jobject, jint, jlong, jint, jint, jint);
|
||||
JNIEXPORT jboolean JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_isRealized (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_realize (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_setNativeEventMask (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_setNativeBounds (JNIEnv *env, jobject, jint, jint, jint, jint);
|
||||
|
|
|
@ -10,15 +10,14 @@ extern "C"
|
|||
{
|
||||
#endif
|
||||
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_initFromBuffer (JNIEnv *env, jobject, jlong);
|
||||
JNIEXPORT jintArray JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_getPixels (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_setPixels (JNIEnv *env, jobject, jintArray);
|
||||
JNIEXPORT jboolean JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_loadPixbuf (JNIEnv *env, jobject, jstring);
|
||||
JNIEXPORT jboolean JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_loadImageFromData (JNIEnv *env, jobject, jbyteArray);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_createPixmap (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_freePixmap (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_createScaledPixmap (JNIEnv *env, jobject, jobject, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_drawPixelsScaled (JNIEnv *env, jobject, jobject, jint, jint, jint, jint, jint, jint, jint, jboolean);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_drawPixelsScaledFlipped (JNIEnv *env, jobject, jobject, jint, jint, jint, jboolean, jboolean, jint, jint, jint, jint, jint, jint, jint, jint, jboolean);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_createPixbuf (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_freePixbuf (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_createScaledPixbuf (JNIEnv *env, jobject, jobject, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_createFromPixbuf (JNIEnv *env, jobject);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
|
||||
#ifndef __gnu_java_awt_peer_gtk_GtkVolatileImage__
|
||||
#define __gnu_java_awt_peer_gtk_GtkVolatileImage__
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_GtkVolatileImage_init (JNIEnv *env, jobject, jobject, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkVolatileImage_destroy (JNIEnv *env, jobject);
|
||||
JNIEXPORT jintArray JNICALL Java_gnu_java_awt_peer_gtk_GtkVolatileImage_getPixels (JNIEnv *env, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkVolatileImage_copyArea (JNIEnv *env, jobject, jint, jint, jint, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkVolatileImage_drawVolatile (JNIEnv *env, jobject, jlong, jint, jint, jint, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __gnu_java_awt_peer_gtk_GtkVolatileImage__ */
|
|
@ -363,7 +363,7 @@ public class BasicStroke implements Stroke
|
|||
* Compares this <code>BasicStroke</code> for equality with an arbitrary
|
||||
* object. This method returns <code>true</code> if and only if:
|
||||
* <ul>
|
||||
* <li><code>o</code> is an instanceof <code>BasicStroke</code>;<li>
|
||||
* <li><code>o</code> is an instanceof <code>BasicStroke</code>;</li>
|
||||
* <li>this object has the same width, line cap style, line join style,
|
||||
* miter limit, dash array and dash phase as <code>o</code>.</li>
|
||||
* </ul>
|
||||
|
|
|
@ -117,7 +117,7 @@ class ColorPaintContext implements PaintContext
|
|||
{
|
||||
cachedRaster = new ColorRaster(colorModel, 0, 0, width, height, color);
|
||||
}
|
||||
return cachedRaster.createChild(0 ,0 ,width ,height ,x ,y , null);
|
||||
return cachedRaster.createChild(0 ,0 ,width ,height ,0 ,0 , null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,13 +138,13 @@ class ColorPaintContext implements PaintContext
|
|||
* @param rgbPixel The RGB value of the color for this raster.
|
||||
*/
|
||||
ColorRaster(ColorModel cm,int x, int y, int width, int height, int rgbPixel)
|
||||
{
|
||||
{
|
||||
super(cm.createCompatibleSampleModel(width,height),new Point(x,y));
|
||||
Object pixel = cm.getDataElements(rgbPixel,null);
|
||||
getSampleModel().setDataElements(0, 0,
|
||||
width, height,
|
||||
multiplyData(pixel,null,width*height),
|
||||
dataBuffer);
|
||||
int[] pixelComps = cm.getComponents(pixel, null, 0);
|
||||
int[] d = (int[]) multiplyData(pixelComps,null,width*height);
|
||||
getSampleModel().setPixels(0, 0, width, height, d,
|
||||
dataBuffer);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2067,11 +2067,9 @@ public abstract class Component
|
|||
*/
|
||||
public VolatileImage createVolatileImage(int width, int height)
|
||||
{
|
||||
if (GraphicsEnvironment.isHeadless())
|
||||
return null;
|
||||
GraphicsConfiguration config = getGraphicsConfiguration();
|
||||
return config == null ? null
|
||||
: config.createCompatibleVolatileImage(width, height);
|
||||
if (peer != null)
|
||||
return peer.createVolatileImage(width, height);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2090,11 +2088,9 @@ public abstract class Component
|
|||
ImageCapabilities caps)
|
||||
throws AWTException
|
||||
{
|
||||
if (GraphicsEnvironment.isHeadless())
|
||||
return null;
|
||||
GraphicsConfiguration config = getGraphicsConfiguration();
|
||||
return config == null ? null
|
||||
: config.createCompatibleVolatileImage(width, height, caps);
|
||||
if (peer != null)
|
||||
return peer.createVolatileImage(width, height);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4810,8 +4806,38 @@ p * <li>the set of backward traversal keys
|
|||
{
|
||||
Object target = e.getSource ();
|
||||
Event translated = null;
|
||||
|
||||
if (e instanceof WindowEvent)
|
||||
{
|
||||
WindowEvent we = (WindowEvent) e;
|
||||
int id = we.id;
|
||||
int newId = 0;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case WindowEvent.WINDOW_DEICONIFIED:
|
||||
newId = Event.WINDOW_DEICONIFY;
|
||||
break;
|
||||
case WindowEvent.WINDOW_CLOSED:
|
||||
case WindowEvent.WINDOW_CLOSING:
|
||||
newId = Event.WINDOW_DESTROY;
|
||||
break;
|
||||
case WindowEvent.WINDOW_ICONIFIED:
|
||||
newId = Event.WINDOW_ICONIFY;
|
||||
break;
|
||||
case WindowEvent.WINDOW_GAINED_FOCUS:
|
||||
newId = Event.GOT_FOCUS;
|
||||
break;
|
||||
case WindowEvent.WINDOW_LOST_FOCUS:
|
||||
newId = Event.LOST_FOCUS;
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
if (e instanceof InputEvent)
|
||||
translated = new Event(target, 0, newId, 0, 0, 0, 0);
|
||||
}
|
||||
else if (e instanceof InputEvent)
|
||||
{
|
||||
InputEvent ie = (InputEvent) e;
|
||||
long when = ie.getWhen ();
|
||||
|
@ -5052,7 +5078,12 @@ p * <li>the set of backward traversal keys
|
|||
.dispatchEvent(e))
|
||||
return;
|
||||
case MouseEvent.MOUSE_PRESSED:
|
||||
if (isLightweight() && !e.isConsumed())
|
||||
// A mouse click on an enabled lightweight component
|
||||
// which has not yet been marked as consumed by any
|
||||
// other mouse listener results in a focus traversal
|
||||
// to that component.
|
||||
if (isLightweight()
|
||||
&& isEnabled() && !e.isConsumed())
|
||||
requestFocus();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -457,8 +457,44 @@ public class Container extends Component
|
|||
{
|
||||
synchronized (getTreeLock ())
|
||||
{
|
||||
while (ncomponents > 0)
|
||||
remove(0);
|
||||
// In order to allow the same bad tricks to be used as in RI
|
||||
// this code has to stay exactly that way: In a real-life app
|
||||
// a Container subclass implemented its own vector for
|
||||
// subcomponents, supplied additional addXYZ() methods
|
||||
// and overrode remove(int) and removeAll (the latter calling
|
||||
// super.removeAll() ).
|
||||
// By doing it this way, user code cannot prevent the correct
|
||||
// removal of components.
|
||||
for ( int index = 0; index < ncomponents; index++)
|
||||
{
|
||||
Component r = component[index];
|
||||
|
||||
ComponentListener[] list = r.getComponentListeners();
|
||||
for (int j = 0; j < list.length; j++)
|
||||
r.removeComponentListener(list[j]);
|
||||
|
||||
r.removeNotify();
|
||||
|
||||
if (layoutMgr != null)
|
||||
layoutMgr.removeLayoutComponent(r);
|
||||
|
||||
r.parent = null;
|
||||
|
||||
if (isShowing ())
|
||||
{
|
||||
// Post event to notify of removing the component.
|
||||
ContainerEvent ce
|
||||
= new ContainerEvent(this,
|
||||
ContainerEvent.COMPONENT_REMOVED,
|
||||
r);
|
||||
|
||||
getToolkit().getSystemEventQueue().postEvent(ce);
|
||||
}
|
||||
}
|
||||
|
||||
invalidate();
|
||||
|
||||
ncomponents = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -111,14 +111,16 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||
ancestor = current.getFocusCycleRootAncestor ();
|
||||
if (ancestor == prevAncestor)
|
||||
{
|
||||
// We've reached the top focus cycle root ancestor. Check
|
||||
// if it is root.
|
||||
if (ancestor != root)
|
||||
// We've reached the top focus cycle root ancestor. Check
|
||||
// if it is root.
|
||||
if (ancestor == null)
|
||||
ancestor = root;
|
||||
else if (ancestor != root)
|
||||
throw new IllegalArgumentException ("the given container is not"
|
||||
+ " a focus cycle root of the"
|
||||
+ " current component");
|
||||
else
|
||||
break;
|
||||
else
|
||||
break;
|
||||
}
|
||||
prevAncestor = ancestor;
|
||||
}
|
||||
|
@ -136,7 +138,6 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||
return getFirstComponent ((Container) current);
|
||||
|
||||
Container parent = current.getParent ();
|
||||
|
||||
synchronized (parent.getTreeLock ())
|
||||
{
|
||||
Component[] components = parent.getComponents ();
|
||||
|
@ -146,47 +147,104 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||
// Find component's index.
|
||||
for (int i = 0; i < numComponents; i++)
|
||||
{
|
||||
if (components[i] == current)
|
||||
if (components[i].equals(current))
|
||||
componentIndex = i;
|
||||
}
|
||||
|
||||
// Search forward for the next acceptable component.
|
||||
for (int i = componentIndex + 1; i < numComponents; i++)
|
||||
{
|
||||
if (accept (components[i]))
|
||||
return components[i];
|
||||
|
||||
if (components[i] instanceof Container)
|
||||
{
|
||||
Component result = getFirstComponent ((Container) components[i]);
|
||||
|
||||
if (result != null
|
||||
&& implicitDownCycleTraversal)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// Search forward for the next acceptable component.
|
||||
// Search through all components at least one time
|
||||
// i.e. start at componentIndex + 1 --> nComponents -1 --> 0 ---> componentIndex
|
||||
int i = componentIndex + 1;
|
||||
int end = numComponents - 1;
|
||||
Component next = getNextAvailableComponent(components, i, end);
|
||||
if (next != null)
|
||||
return next;
|
||||
|
||||
// Now check remainder of components from 0 to componentIndex
|
||||
i = 0;
|
||||
end = componentIndex;
|
||||
next = getNextAvailableComponent(components, i, end);
|
||||
if (next != null)
|
||||
return next;
|
||||
|
||||
// No focusable components after current in its Container. So go
|
||||
// to the next Component after current's Container (parent).
|
||||
Component result = getComponentAfter (root, parent);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the next available component in the array between the given range.
|
||||
*
|
||||
* @param components - the array of components.
|
||||
* @param start - where to start
|
||||
* @param end - where to end
|
||||
* @return next component if found
|
||||
*/
|
||||
private Component getNextAvailableComponent(Component[] components, int start, int end)
|
||||
{
|
||||
while (start <= end)
|
||||
{
|
||||
Component c = components[start];
|
||||
|
||||
if (c.visible && c.isDisplayable() && c.enabled && c.focusable)
|
||||
return c;
|
||||
|
||||
if (c instanceof Container)
|
||||
{
|
||||
Component result = getFirstComponent((Container) c);
|
||||
|
||||
if (result != null && implicitDownCycleTraversal && result.visible
|
||||
&& result.isDisplayable() && result.enabled && result.focusable)
|
||||
return result;
|
||||
}
|
||||
start++;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the previous available component in the array between the given range.
|
||||
*
|
||||
* @param components - the array of components.
|
||||
* @param start - where to start
|
||||
* @param end - where to end
|
||||
* @return previous component if found
|
||||
*/
|
||||
Component getPrevAvailableComponent(Component[] components, int start, int end)
|
||||
{
|
||||
while (start >= end)
|
||||
{
|
||||
Component c = components[start];
|
||||
if (c.visible && c.isDisplayable() && c.enabled && c.focusable)
|
||||
return c;
|
||||
|
||||
if (c instanceof Container)
|
||||
{
|
||||
Component result = getLastComponent((Container) c);
|
||||
|
||||
if (result != null
|
||||
&& (result.visible && result.isDisplayable() && result.enabled && result.focusable))
|
||||
return result;
|
||||
}
|
||||
start--;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Component that should receive the focus before
|
||||
* <code>current</code>. <code>root</code> must be a focus cycle
|
||||
* root of current.
|
||||
*
|
||||
* <code>current</code>. <code>root</code> must be a focus cycle root of
|
||||
* current.
|
||||
*
|
||||
* @param root a focus cycle root of current
|
||||
* @param current a (possibly indirect) child of root, or root itself
|
||||
*
|
||||
* @return the previous Component in the focus traversal order for
|
||||
* root, or null if no acceptable Component exists.
|
||||
*
|
||||
* @exception IllegalArgumentException If root is not a focus cycle
|
||||
* root of current, or if either root or current is null.
|
||||
* @return the previous Component in the focus traversal order for root, or
|
||||
* null if no acceptable Component exists.
|
||||
* @exception IllegalArgumentException If root is not a focus cycle root of
|
||||
* current, or if either root or current is null.
|
||||
*/
|
||||
public Component getComponentBefore (Container root, Component current)
|
||||
{
|
||||
|
@ -207,7 +265,9 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||
{
|
||||
// We've reached the top focus cycle root ancestor. Check
|
||||
// if it is root.
|
||||
if (ancestor != root)
|
||||
if (ancestor == null)
|
||||
ancestor = root;
|
||||
else if (ancestor != root)
|
||||
throw new IllegalArgumentException ("the given container is not"
|
||||
+ " a focus cycle root of the"
|
||||
+ " current component");
|
||||
|
@ -244,20 +304,20 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||
componentIndex = i;
|
||||
}
|
||||
|
||||
// Search backward for the next acceptable component.
|
||||
for (int i = componentIndex - 1; i >= 0; i--)
|
||||
{
|
||||
if (accept (components[i]))
|
||||
return components[i];
|
||||
|
||||
if (components[i] instanceof Container)
|
||||
{
|
||||
Component result = getLastComponent ((Container) components[i]);
|
||||
|
||||
if (result != null)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
// Search through all components at least one time
|
||||
// i.e. start at componentIndex - 1 --> 0 --> numComponents -1 ---> componentIndex
|
||||
int i = componentIndex - 1;
|
||||
int end = 0;
|
||||
Component prev = getPrevAvailableComponent(components, i, end);
|
||||
if (prev != null)
|
||||
return prev;
|
||||
|
||||
// Now check remainder of components
|
||||
i = numComponents -1;
|
||||
end = componentIndex;
|
||||
prev = getPrevAvailableComponent(components, i, end);
|
||||
if (prev != null)
|
||||
return prev;
|
||||
|
||||
// No focusable components before current in its Container. So go
|
||||
// to the previous Component before current's Container (parent).
|
||||
|
@ -286,7 +346,8 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||
|| !root.isDisplayable ())
|
||||
return null;
|
||||
|
||||
if (accept (root))
|
||||
if (root.visible && root.isDisplayable() && root.enabled
|
||||
&& root.focusable)
|
||||
return root;
|
||||
|
||||
Component[] componentArray = root.getComponents ();
|
||||
|
@ -295,14 +356,16 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||
{
|
||||
Component component = componentArray [i];
|
||||
|
||||
if (accept (component))
|
||||
if (component.visible && component.isDisplayable() && component.enabled
|
||||
&& component.focusable)
|
||||
return component;
|
||||
|
||||
if (component instanceof Container)
|
||||
{
|
||||
Component result = getFirstComponent ((Container) component);
|
||||
|
||||
if (result != null)
|
||||
if (result != null
|
||||
&& (result.visible && result.isDisplayable() && result.enabled && result.focusable))
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -329,7 +392,8 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||
|| !root.isDisplayable ())
|
||||
return null;
|
||||
|
||||
if (accept (root))
|
||||
if (root.visible && root.isDisplayable() && root.enabled
|
||||
&& root.focusable)
|
||||
return root;
|
||||
|
||||
Component[] componentArray = root.getComponents ();
|
||||
|
@ -338,14 +402,17 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
|
|||
{
|
||||
Component component = componentArray [i];
|
||||
|
||||
if (accept (component))
|
||||
if (component.visible && component.isDisplayable() && component.enabled
|
||||
&& component.focusable)
|
||||
return component;
|
||||
|
||||
if (component instanceof Container)
|
||||
{
|
||||
Component result = getLastComponent ((Container) component);
|
||||
|
||||
if (result != null)
|
||||
if (result != null &&
|
||||
result.visible && result.isDisplayable() && result.enabled
|
||||
&& result.focusable)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -274,10 +274,12 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager
|
|||
|
||||
public boolean dispatchKeyEvent (KeyEvent e)
|
||||
{
|
||||
Component focusOwner = getGlobalPermanentFocusOwner ();
|
||||
|
||||
Component focusOwner = getFocusOwner();
|
||||
if (focusOwner == null)
|
||||
focusOwner = getFocusedWindow();
|
||||
|
||||
if (focusOwner != null)
|
||||
redispatchEvent(focusOwner, e);
|
||||
redispatchEvent(focusOwner, e);
|
||||
|
||||
// Loop through all registered KeyEventPostProcessors, giving
|
||||
// each a chance to process this event.
|
||||
|
@ -294,7 +296,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager
|
|||
// MenuShortcut.
|
||||
if (postProcessKeyEvent (e))
|
||||
return true;
|
||||
|
||||
|
||||
// Always return true.
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -43,6 +43,11 @@ package java.awt;
|
|||
*/
|
||||
class EventDispatchThread extends Thread
|
||||
{
|
||||
/**
|
||||
* The default priority when no property has been set.
|
||||
*/
|
||||
private static final int DEFAULT_PRIORITY = NORM_PRIORITY + 1;
|
||||
|
||||
private static int dispatchThreadNum;
|
||||
|
||||
private EventQueue queue;
|
||||
|
@ -52,7 +57,22 @@ class EventDispatchThread extends Thread
|
|||
super();
|
||||
setName("AWT-EventQueue-" + ++dispatchThreadNum);
|
||||
this.queue = queue;
|
||||
setPriority(NORM_PRIORITY + 1);
|
||||
|
||||
int priority = DEFAULT_PRIORITY;
|
||||
try
|
||||
{
|
||||
String priorityString =
|
||||
System.getProperty("gnu.awt.dispatchthread.priority");
|
||||
if (priorityString != null)
|
||||
{
|
||||
priority = Integer.parseInt(priorityString);
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
// Ignore and use default.
|
||||
}
|
||||
setPriority(priority);
|
||||
}
|
||||
|
||||
public void run()
|
||||
|
|
|
@ -1013,7 +1013,7 @@ public class Font implements Serializable
|
|||
*/
|
||||
public int getNumGlyphs()
|
||||
{
|
||||
return peer.getMissingGlyphCode(this);
|
||||
return peer.getNumGlyphs(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000, 2002, 2004 Free Software Foundation
|
||||
/* Copyright (C) 2000, 2002, 2004, 2006, Free Software Foundation
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -45,10 +45,35 @@ import java.awt.image.BufferedImageOp;
|
|||
import java.awt.image.ImageObserver;
|
||||
import java.awt.image.RenderedImage;
|
||||
import java.awt.image.renderable.RenderableImage;
|
||||
import java.awt.print.PageFormat;
|
||||
import java.awt.print.Printable;
|
||||
import java.text.AttributedCharacterIterator;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* An abstract class defining a device independent two-dimensional vector
|
||||
* graphics API. Concrete subclasses implement this API for output of
|
||||
* vector graphics to: (*)
|
||||
* <p>
|
||||
* <ul>
|
||||
* <li>a {@link javax.swing.JComponent} - in the
|
||||
* {@link javax.swing.JComponent#paint(Graphics)} method, the incoming
|
||||
* {@link Graphics} should always be an instance of
|
||||
* <code>Graphics2D</code> (*);</li>
|
||||
* <li>a {@link BufferedImage} - see
|
||||
* {@link BufferedImage#createGraphics()} (*);</li>
|
||||
* <li>a {@link java.awt.print.PrinterJob} - in the
|
||||
* {@link Printable#print(Graphics, PageFormat, int)} method, the incoming
|
||||
* {@link Graphics} should always be an instance of <code>Graphics2D</code>
|
||||
* (*).</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* (*) Support for this API is not fully implemented in GNU Classpath yet.
|
||||
* <p>
|
||||
* Third party libraries provide support for output to other formats via this
|
||||
* API, including encapsulated postscript (EPS), portable document format (PDF),
|
||||
* and scalable vector graphics (SVG).
|
||||
*
|
||||
* @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
|
||||
*/
|
||||
public abstract class Graphics2D extends Graphics
|
||||
|
@ -70,6 +95,14 @@ public abstract class Graphics2D extends Graphics
|
|||
super.fill3DRect(x, y, width, height, raised);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws an outline around a shape using the current stroke and paint.
|
||||
*
|
||||
* @param shape the shape (<code>null</code> not permitted).
|
||||
*
|
||||
* @see #getStroke()
|
||||
* @see #getPaint()
|
||||
*/
|
||||
public abstract void draw(Shape shape);
|
||||
|
||||
public abstract boolean drawImage(Image image, AffineTransform xform,
|
||||
|
@ -86,18 +119,57 @@ public abstract class Graphics2D extends Graphics
|
|||
public abstract void drawRenderableImage(RenderableImage image,
|
||||
AffineTransform xform);
|
||||
|
||||
/**
|
||||
* Draws a string at the specified location, using the current font.
|
||||
*
|
||||
* @param text the string to draw.
|
||||
* @param x the x-coordinate.
|
||||
* @param y the y-coordinate.
|
||||
*
|
||||
* @see Graphics#setFont(Font)
|
||||
*/
|
||||
public abstract void drawString(String text, int x, int y);
|
||||
|
||||
/**
|
||||
* Draws a string at the specified location, using the current font.
|
||||
*
|
||||
* @param text the string to draw.
|
||||
* @param x the x-coordinate.
|
||||
* @param y the y-coordinate.
|
||||
*
|
||||
* @see Graphics#setFont(Font)
|
||||
*/
|
||||
public abstract void drawString(String text, float x, float y);
|
||||
|
||||
/**
|
||||
* Draws an attributed string at the specified location.
|
||||
*
|
||||
* @param iterator the source of the attributed text.
|
||||
* @param x the x-coordinate.
|
||||
* @param y the y-coordinate.
|
||||
*/
|
||||
public abstract void drawString(AttributedCharacterIterator iterator,
|
||||
int x, int y);
|
||||
|
||||
/**
|
||||
* Draws an attributed string at the specified location.
|
||||
*
|
||||
* @param iterator the source of the attributed text.
|
||||
* @param x the x-coordinate.
|
||||
* @param y the y-coordinate.
|
||||
*/
|
||||
public abstract void drawString(AttributedCharacterIterator iterator,
|
||||
float x, float y);
|
||||
|
||||
// public abstract void drawGlyphVector(GlyphVector g, float x, float y);
|
||||
|
||||
/**
|
||||
* Fills the interior of the specified <code>shape</code> using the current
|
||||
* paint.
|
||||
*
|
||||
* @param shape the shape to fill (<code>null</code> not permitted).
|
||||
*
|
||||
* @see #draw(Shape)
|
||||
* @see #getPaint()
|
||||
*/
|
||||
public abstract void fill(Shape shape);
|
||||
|
||||
public abstract boolean hit(Rectangle rect, Shape text,
|
||||
|
@ -105,21 +177,72 @@ public abstract class Graphics2D extends Graphics
|
|||
|
||||
public abstract GraphicsConfiguration getDeviceConfiguration();
|
||||
|
||||
/**
|
||||
* Sets the current compositing rule.
|
||||
*
|
||||
* @param comp the composite.
|
||||
*
|
||||
* @see #getComposite()
|
||||
*/
|
||||
public abstract void setComposite(Composite comp);
|
||||
|
||||
|
||||
/**
|
||||
* Sets the paint to be used for subsequent drawing operations.
|
||||
*
|
||||
* @param paint the paint (<code>null</code> not permitted).
|
||||
*
|
||||
* @see #getPaint()
|
||||
*/
|
||||
public abstract void setPaint(Paint paint);
|
||||
|
||||
/**
|
||||
* Sets the stroke to be used for subsequent drawing operations.
|
||||
*
|
||||
* @param stroke the stroke (<code>null</code> not permitted).
|
||||
*
|
||||
* @see #getStroke()
|
||||
*/
|
||||
public abstract void setStroke(Stroke stroke);
|
||||
|
||||
/**
|
||||
* Adds or updates a hint in the current rendering hints table.
|
||||
*
|
||||
* @param hintKey the hint key.
|
||||
* @param hintValue the hint value.
|
||||
*/
|
||||
public abstract void setRenderingHint(RenderingHints.Key hintKey,
|
||||
Object hintValue);
|
||||
|
||||
/**
|
||||
* Returns the current value of a rendering hint.
|
||||
*
|
||||
* @param hintKey the key for the hint.
|
||||
*
|
||||
* @return The value for the specified hint.
|
||||
*/
|
||||
public abstract Object getRenderingHint(RenderingHints.Key hintKey);
|
||||
|
||||
/**
|
||||
* Replaces the current rendering hints with the supplied hints.
|
||||
*
|
||||
* @param hints the hints.
|
||||
*
|
||||
* @see #addRenderingHints(Map)
|
||||
*/
|
||||
public abstract void setRenderingHints(Map hints);
|
||||
|
||||
/**
|
||||
* Adds/updates the rendering hint.
|
||||
*
|
||||
* @param hints the hints to add or update.
|
||||
*/
|
||||
public abstract void addRenderingHints(Map hints);
|
||||
|
||||
/**
|
||||
* Returns the current rendering hints.
|
||||
*
|
||||
* @return The current rendering hints.
|
||||
*/
|
||||
public abstract RenderingHints getRenderingHints();
|
||||
|
||||
public abstract void translate(int x, int y);
|
||||
|
@ -134,25 +257,104 @@ public abstract class Graphics2D extends Graphics
|
|||
|
||||
public abstract void shear(double shearX, double shearY);
|
||||
|
||||
public abstract void transform(AffineTransform Tx);
|
||||
/**
|
||||
* Sets the current transform to a concatenation of <code>transform</code>
|
||||
* and the existing transform.
|
||||
*
|
||||
* @param transform the transform.
|
||||
*/
|
||||
public abstract void transform(AffineTransform transform);
|
||||
|
||||
public abstract void setTransform(AffineTransform Tx);
|
||||
/**
|
||||
* Sets the current transform. If the caller specifies a <code>null</code>
|
||||
* transform, this method should set the current transform to the
|
||||
* identity transform.
|
||||
*
|
||||
* @param transform the transform (<code>null</code> permitted).
|
||||
*
|
||||
* @see #getTransform()
|
||||
*/
|
||||
public abstract void setTransform(AffineTransform transform);
|
||||
|
||||
/**
|
||||
* Returns the current transform.
|
||||
*
|
||||
* @return The current transform.
|
||||
*
|
||||
* @see #setTransform(AffineTransform)
|
||||
*/
|
||||
public abstract AffineTransform getTransform();
|
||||
|
||||
/**
|
||||
* Returns the current paint.
|
||||
*
|
||||
* @return The current paint.
|
||||
*
|
||||
* @see #setPaint(Paint)
|
||||
*/
|
||||
public abstract Paint getPaint();
|
||||
|
||||
/**
|
||||
* Returns the current compositing rule.
|
||||
*
|
||||
* @return The current compositing rule.
|
||||
*
|
||||
* @see #setComposite(Composite)
|
||||
*/
|
||||
public abstract Composite getComposite();
|
||||
|
||||
/**
|
||||
* Sets the background color (used by the
|
||||
* {@link Graphics#clearRect(int, int, int, int)} method).
|
||||
*
|
||||
* @param color the color.
|
||||
*
|
||||
* @see #getBackground()
|
||||
*/
|
||||
public abstract void setBackground(Color color);
|
||||
|
||||
/**
|
||||
* Returns the color used by the
|
||||
* {@link Graphics#clearRect(int, int, int, int)} method.
|
||||
*
|
||||
* @return The background color.
|
||||
*
|
||||
* @see #setBackground(Color)
|
||||
*/
|
||||
public abstract Color getBackground();
|
||||
|
||||
/**
|
||||
* Returns the current stroke.
|
||||
*
|
||||
* @return The current stroke.
|
||||
*
|
||||
* @see #setStroke(Stroke)
|
||||
*/
|
||||
public abstract Stroke getStroke();
|
||||
|
||||
/**
|
||||
* Sets the clip region to the intersection of the current clipping region
|
||||
* and <code>s</code>.
|
||||
*
|
||||
* @param s the shape to intersect with the current clipping region.
|
||||
*
|
||||
* @see Graphics#setClip(Shape)
|
||||
*/
|
||||
public abstract void clip(Shape s);
|
||||
|
||||
public abstract FontRenderContext getFontRenderContext ();
|
||||
/**
|
||||
* Returns the font render context.
|
||||
*
|
||||
* @return The font render context.
|
||||
*/
|
||||
public abstract FontRenderContext getFontRenderContext();
|
||||
|
||||
public abstract void drawGlyphVector (GlyphVector g, float x, float y);
|
||||
/**
|
||||
* Draws a glyph vector at the specified location.
|
||||
*
|
||||
* @param g the glyph vector.
|
||||
* @param x the x-coordinate.
|
||||
* @param y the y-coordinate.
|
||||
*/
|
||||
public abstract void drawGlyphVector(GlyphVector g, float x, float y);
|
||||
}
|
||||
|
|
|
@ -65,6 +65,13 @@ import java.awt.image.VolatileImage;
|
|||
*/
|
||||
public abstract class GraphicsConfiguration
|
||||
{
|
||||
|
||||
/** The cached image capabilities. */
|
||||
private ImageCapabilities imageCapabilities;
|
||||
|
||||
/** The cached buffer capabilities. */
|
||||
private BufferCapabilities bufferCapabilities;
|
||||
|
||||
/**
|
||||
* The default constructor.
|
||||
*
|
||||
|
@ -218,9 +225,14 @@ public abstract class GraphicsConfiguration
|
|||
* @since 1.4
|
||||
*/
|
||||
public BufferCapabilities getBufferCapabilities()
|
||||
throws NotImplementedException
|
||||
{
|
||||
throw new Error("not implemented");
|
||||
if (imageCapabilities == null)
|
||||
getImageCapabilities();
|
||||
|
||||
if (bufferCapabilities == null)
|
||||
bufferCapabilities = new BufferCapabilities(imageCapabilities,
|
||||
imageCapabilities, null);
|
||||
return bufferCapabilities;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -230,8 +242,9 @@ public abstract class GraphicsConfiguration
|
|||
* @since 1.4
|
||||
*/
|
||||
public ImageCapabilities getImageCapabilities()
|
||||
throws NotImplementedException
|
||||
{
|
||||
throw new Error("not implemented");
|
||||
if (imageCapabilities == null)
|
||||
imageCapabilities = new ImageCapabilities(false);
|
||||
return imageCapabilities;
|
||||
}
|
||||
} // class GraphicsConfiguration
|
||||
|
|
|
@ -38,8 +38,6 @@ exception statement from your version. */
|
|||
|
||||
package java.awt;
|
||||
|
||||
import gnu.java.awt.AWTUtilities;
|
||||
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
|
@ -67,6 +65,13 @@ class LightweightDispatcher
|
|||
* as well as the MOUSE_RELEASED event following the dragging.
|
||||
*/
|
||||
private Component dragTarget;
|
||||
|
||||
/**
|
||||
* Stores the button number which started the drag operation. This is needed
|
||||
* because we want to handle only one drag operation and only the button that
|
||||
* started the dragging should be able to stop it (by a button release).
|
||||
*/
|
||||
private int dragButton;
|
||||
|
||||
/**
|
||||
* The last mouse event target. If the target changes, additional
|
||||
|
@ -121,15 +126,41 @@ class LightweightDispatcher
|
|||
/**
|
||||
* Handles all mouse events that are targetted at toplevel containers
|
||||
* (Window instances) and dispatches them to the correct lightweight child.
|
||||
*
|
||||
*
|
||||
* @param ev the mouse event
|
||||
* @return whether or not we found a lightweight that handled the event.
|
||||
*/
|
||||
private boolean handleMouseEvent(MouseEvent ev)
|
||||
{
|
||||
Window window = (Window) ev.getSource();
|
||||
Component target = window.findComponentAt(ev.getX(), ev.getY());
|
||||
target = findTarget(target);
|
||||
// Find the target for the mouse event. We first seach the deepest
|
||||
// component at the specified location. The we go up to its parent and
|
||||
// try to find a neighbor of the deepest component that is suitable as
|
||||
// mouse event target (it must be showing, at that location and have either
|
||||
// a MouseListener or MouseMotionListener installed). If no such component
|
||||
// is found, then we walk up the container hierarchy and find the next
|
||||
// container that has a MouseListener or MouseMotionListener installed.
|
||||
Component deepest = window.findComponentAt(ev.getX(), ev.getY());
|
||||
if (deepest == null)
|
||||
return false;
|
||||
Container parent = deepest.getParent();
|
||||
Point loc = ev.getPoint();
|
||||
loc = convertPointToChild(window, loc, parent);
|
||||
Component target = null;
|
||||
if (parent != null)
|
||||
{
|
||||
target = findTarget(parent, loc);
|
||||
while (target == null && parent != null)
|
||||
{
|
||||
if (parent.getMouseListeners().length > 0
|
||||
|| parent.getMouseMotionListeners().length > 0)
|
||||
{
|
||||
target = parent;
|
||||
}
|
||||
else
|
||||
parent = parent.getParent();
|
||||
}
|
||||
}
|
||||
if (target == null || target.isLightweight())
|
||||
{
|
||||
// Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target
|
||||
|
@ -138,18 +169,26 @@ class LightweightDispatcher
|
|||
{
|
||||
if (lastTarget != null)
|
||||
{
|
||||
Point p1 = AWTUtilities.convertPoint(window, ev.getX(),
|
||||
ev.getY(), lastTarget);
|
||||
Point p1 = convertPointToChild(window, ev.getPoint(),
|
||||
lastTarget);
|
||||
MouseEvent mouseExited =
|
||||
new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED,
|
||||
ev.getWhen(), ev.getModifiers(), p1.x, p1.y,
|
||||
ev.getClickCount(), ev.isPopupTrigger());
|
||||
lastTarget.dispatchEvent(mouseExited);
|
||||
}
|
||||
if (target != null)
|
||||
|
||||
// If a target exists dispatch the MOUSE_ENTERED event only if
|
||||
// there is currently no component from which a drag operation
|
||||
// started (dragTarget == null) or the target is that component
|
||||
// (dragTarget == target)
|
||||
// That way a user can click and hold on a button (putting it into
|
||||
// the armed state), move the cursor above other buttons without
|
||||
// affecting their rollover state and get back to the initial
|
||||
// button.
|
||||
if (target != null && (dragTarget == null || dragTarget == target))
|
||||
{
|
||||
Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(),
|
||||
target);
|
||||
Point p = convertPointToChild(window, ev.getPoint(), target);
|
||||
MouseEvent mouseEntered =
|
||||
new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(),
|
||||
ev.getModifiers(), p.x, p.y, ev.getClickCount(),
|
||||
|
@ -161,12 +200,30 @@ class LightweightDispatcher
|
|||
switch (ev.getID())
|
||||
{
|
||||
case MouseEvent.MOUSE_PRESSED:
|
||||
dragTarget = target;
|
||||
// Handle the start of a drag operation or discard the event if
|
||||
// one is already in progress. This prevents focus changes with the
|
||||
// other mouse buttons when one is used for dragging.
|
||||
if (dragTarget == null)
|
||||
{
|
||||
lastTarget = dragTarget = target;
|
||||
|
||||
// Save the button that started the drag operation.
|
||||
dragButton = ev.getButton();
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
break;
|
||||
case MouseEvent.MOUSE_RELEASED:
|
||||
if (dragTarget != null)
|
||||
target = dragTarget;
|
||||
dragTarget = null;
|
||||
// Stop the drag operation only when the button that started
|
||||
// it was released.
|
||||
if (dragTarget != null && dragButton == ev.getButton())
|
||||
{
|
||||
target = dragTarget;
|
||||
dragTarget = null;
|
||||
}
|
||||
|
||||
lastTarget = target;
|
||||
break;
|
||||
case MouseEvent.MOUSE_CLICKED:
|
||||
// When we receive a MOUSE_CLICKED, we set the target to the
|
||||
|
@ -174,27 +231,35 @@ class LightweightDispatcher
|
|||
// This is necessary for the case when the MOUSE_RELEASED has
|
||||
// caused the original target (like an internal component) go
|
||||
// away.
|
||||
// This line is the reason why it is not possible to move the
|
||||
// 'lastTarget = target' assignment before the switch-statement.
|
||||
target = lastTarget;
|
||||
break;
|
||||
case MouseEvent.MOUSE_DRAGGED:
|
||||
// We consider only dragTarget for redispatching the event still
|
||||
// we have to act in a way that the newly found target component
|
||||
// was handled.
|
||||
lastTarget = target;
|
||||
target = dragTarget;
|
||||
break;
|
||||
default:
|
||||
// Do nothing in other cases.
|
||||
// Only declare current target as the old value in all other
|
||||
// cases.
|
||||
lastTarget = target;
|
||||
break;
|
||||
}
|
||||
|
||||
lastTarget = target;
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
Point targetCoordinates =
|
||||
AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target);
|
||||
Point targetCoordinates = convertPointToChild(window,
|
||||
ev.getPoint(),
|
||||
target);
|
||||
int dx = targetCoordinates.x - ev.getX();
|
||||
int dy = targetCoordinates.y - ev.getY();
|
||||
ev.translatePoint(dx, dy);
|
||||
ev.setSource(target);
|
||||
target.dispatchEvent(ev);
|
||||
|
||||
// We reset the event, so that the normal event dispatching is not
|
||||
// influenced by this modified event.
|
||||
ev.setSource(window);
|
||||
|
@ -209,20 +274,66 @@ class LightweightDispatcher
|
|||
|
||||
/**
|
||||
* Finds the actual target for a mouseevent, starting at <code>c</code>.
|
||||
* This searches upwards the component hierarchy until it finds a component
|
||||
* that has a mouselistener attached.
|
||||
* This searches through the children of the container and finds the first
|
||||
* one which is showing, at the location from the mouse event and has
|
||||
* a MouseListener or MouseMotionListener attached. If no such child component
|
||||
* is found, null is returned.
|
||||
*
|
||||
* @param c the component to start searching from
|
||||
* @param c the container to search through
|
||||
* @param loc the mouse event point
|
||||
*
|
||||
* @return the actual receiver of the mouse event
|
||||
* @return the actual receiver of the mouse event, or null, if no such
|
||||
* component has been found
|
||||
*/
|
||||
private Component findTarget(Component c)
|
||||
private Component findTarget(Container c, Point loc)
|
||||
{
|
||||
Component target = c;
|
||||
while (target != null && target.getMouseListeners().length == 0)
|
||||
Component[] children = c.getComponents();
|
||||
Component target = null;
|
||||
if (c != null)
|
||||
{
|
||||
target = target.getParent();
|
||||
for (int i = 0; i < children.length; i++)
|
||||
{
|
||||
Component child = children[i];
|
||||
if (child.isShowing())
|
||||
{
|
||||
if (child.contains(loc.x - child.getX(), loc.y - child.getY())
|
||||
&& (child.getMouseListeners().length > 0
|
||||
|| child.getMouseMotionListeners().length > 0))
|
||||
{
|
||||
target = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a point in the parent's coordinate system to a child coordinate
|
||||
* system. The resulting point is stored in the same Point object and
|
||||
* returned.
|
||||
*
|
||||
* @param parent the parent component
|
||||
* @param p the point
|
||||
* @param child the child component
|
||||
*
|
||||
* @return the translated point
|
||||
*/
|
||||
private Point convertPointToChild(Component parent, Point p,
|
||||
Component child)
|
||||
{
|
||||
int offX = 0;
|
||||
int offY = 0;
|
||||
Component comp = child;
|
||||
while (comp != null && comp != parent)
|
||||
{
|
||||
offX += comp.getX();
|
||||
offY += comp.getY();
|
||||
comp = comp.getParent();
|
||||
}
|
||||
p.x -= offX;
|
||||
p.y -= offY;
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,42 +38,81 @@ exception statement from your version. */
|
|||
|
||||
package java.awt;
|
||||
|
||||
import gnu.classpath.NotImplementedException;
|
||||
import gnu.java.awt.java2d.TexturePaintContext;
|
||||
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ColorModel;
|
||||
|
||||
/** STUB CLASS ONLY */
|
||||
/**
|
||||
* This class provides a way to fill a Shape with a texture that is
|
||||
* specified by a BufferedImage.
|
||||
*/
|
||||
public class TexturePaint implements Paint
|
||||
{
|
||||
private final BufferedImage texture;
|
||||
private final Rectangle2D anchor;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param texture - the texture
|
||||
* @param anchor - the shape
|
||||
*/
|
||||
public TexturePaint(BufferedImage texture, Rectangle2D anchor)
|
||||
{
|
||||
this.texture = texture;
|
||||
this.anchor = anchor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the texture image.
|
||||
*
|
||||
* @return the texture
|
||||
*/
|
||||
public BufferedImage getImage()
|
||||
{
|
||||
return texture;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the shape anchor.
|
||||
*
|
||||
* @return the shape anchor
|
||||
*/
|
||||
public Rectangle2D getAnchorRect()
|
||||
{
|
||||
return anchor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the context used to paint the texture.
|
||||
*
|
||||
* @param cm - the ColorModel that receives the Paint data. Used only as a hint.
|
||||
* @param deviceBounds - the device space being rendered.
|
||||
* @param userBounds - the user space being rendered
|
||||
* @param xform - the AffineTransform from user space into device space
|
||||
* @param hints - a RenderingHints object that is used to specify how the
|
||||
* pattern is rendered
|
||||
* @return the paint context used to paint the texture
|
||||
*/
|
||||
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds,
|
||||
Rectangle2D userBounds,
|
||||
AffineTransform xform,
|
||||
RenderingHints hints)
|
||||
throws NotImplementedException
|
||||
AffineTransform xform, RenderingHints hints)
|
||||
{
|
||||
throw new Error("not implemented");
|
||||
// TODO: Maybe add some hook for providing alternative/accelerated
|
||||
// implementations of this.
|
||||
return new TexturePaintContext(this, deviceBounds, userBounds, xform);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the transparency mode.
|
||||
*
|
||||
* @return the transparency mode.
|
||||
*/
|
||||
public int getTransparency()
|
||||
throws NotImplementedException
|
||||
{
|
||||
throw new Error("not implemented");
|
||||
return texture.getTransparency();
|
||||
}
|
||||
} // class TexturePaint
|
||||
|
|
|
@ -544,7 +544,7 @@ public abstract class Toolkit
|
|||
return ClassLoader.getSystemClassLoader();
|
||||
}
|
||||
});
|
||||
Class cls = cl.loadClass(toolkit_name);
|
||||
Class cls = Class.forName(toolkit_name, true, cl);
|
||||
Object obj = cls.newInstance();
|
||||
if (!(obj instanceof Toolkit))
|
||||
throw new AWTError(toolkit_name + " is not a subclass of " +
|
||||
|
|
|
@ -38,8 +38,6 @@ exception statement from your version. */
|
|||
|
||||
package java.awt;
|
||||
|
||||
import gnu.classpath.NotImplementedException;
|
||||
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
|
@ -132,33 +130,7 @@ public class Window extends Container implements Accessible
|
|||
// cycle roots.
|
||||
focusCycleRoot = true;
|
||||
setLayout(new BorderLayout());
|
||||
|
||||
addWindowFocusListener (new WindowAdapter ()
|
||||
{
|
||||
public void windowGainedFocus (WindowEvent event)
|
||||
{
|
||||
if (windowFocusOwner != null)
|
||||
{
|
||||
// FIXME: move this section and the other similar
|
||||
// sections in Component into a separate method.
|
||||
EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue ();
|
||||
synchronized (eq)
|
||||
{
|
||||
KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
|
||||
Component currentFocusOwner = manager.getGlobalPermanentFocusOwner ();
|
||||
if (currentFocusOwner != null)
|
||||
{
|
||||
eq.postEvent (new FocusEvent (currentFocusOwner, FocusEvent.FOCUS_LOST,
|
||||
false, windowFocusOwner));
|
||||
eq.postEvent (new FocusEvent (windowFocusOwner, FocusEvent.FOCUS_GAINED,
|
||||
false, currentFocusOwner));
|
||||
}
|
||||
else
|
||||
eq.postEvent (new FocusEvent (windowFocusOwner, FocusEvent.FOCUS_GAINED, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
addWindowFocusListener();
|
||||
|
||||
GraphicsEnvironment g = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
graphicsConfiguration = g.getDefaultScreenDevice().getDefaultConfiguration();
|
||||
|
@ -169,7 +141,68 @@ public class Window extends Container implements Accessible
|
|||
this();
|
||||
graphicsConfiguration = gc;
|
||||
}
|
||||
|
||||
private void addWindowFocusListener()
|
||||
{
|
||||
addWindowFocusListener(new WindowAdapter()
|
||||
{
|
||||
public void windowGainedFocus(WindowEvent event)
|
||||
{
|
||||
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
|
||||
if (windowFocusOwner != null)
|
||||
{
|
||||
synchronized (eq)
|
||||
{
|
||||
KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
|
||||
Component currentFocusOwner = manager.getGlobalPermanentFocusOwner();
|
||||
if (currentFocusOwner != null)
|
||||
{
|
||||
eq.postEvent(new FocusEvent(currentFocusOwner,
|
||||
FocusEvent.FOCUS_LOST, false,
|
||||
windowFocusOwner));
|
||||
eq.postEvent(new FocusEvent(windowFocusOwner,
|
||||
FocusEvent.FOCUS_GAINED, false,
|
||||
currentFocusOwner));
|
||||
}
|
||||
else
|
||||
eq.postEvent(new FocusEvent(windowFocusOwner,
|
||||
FocusEvent.FOCUS_GAINED, false));
|
||||
}
|
||||
}
|
||||
else
|
||||
eq.postEvent(new FocusEvent(Window.this, FocusEvent.FOCUS_GAINED,
|
||||
false));
|
||||
}
|
||||
|
||||
public void windowLostFocus(WindowEvent event)
|
||||
{
|
||||
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
|
||||
if (windowFocusOwner != null)
|
||||
{
|
||||
synchronized (eq)
|
||||
{
|
||||
KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
|
||||
Component currentFocusOwner = manager.getGlobalPermanentFocusOwner();
|
||||
if (currentFocusOwner != null)
|
||||
{
|
||||
eq.postEvent(new FocusEvent(currentFocusOwner,
|
||||
FocusEvent.FOCUS_GAINED, false,
|
||||
windowFocusOwner));
|
||||
eq.postEvent(new FocusEvent(windowFocusOwner,
|
||||
FocusEvent.FOCUS_LOST, false,
|
||||
currentFocusOwner));
|
||||
}
|
||||
else
|
||||
eq.postEvent(new FocusEvent(windowFocusOwner,
|
||||
FocusEvent.FOCUS_LOST, false));
|
||||
}
|
||||
}
|
||||
else
|
||||
eq.postEvent(new FocusEvent(Window.this, FocusEvent.FOCUS_LOST, false));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of <code>Window</code> with the specified
|
||||
* parent. The window will initially be invisible.
|
||||
|
@ -1046,12 +1079,11 @@ public class Window extends Container implements Accessible
|
|||
/**
|
||||
* @since 1.2
|
||||
*
|
||||
* @deprecated
|
||||
* @deprecated replaced by Component.applyComponentOrientation.
|
||||
*/
|
||||
public void applyResourceBundle(ResourceBundle rb)
|
||||
throws NotImplementedException
|
||||
{
|
||||
throw new Error ("Not implemented");
|
||||
applyComponentOrientation(ComponentOrientation.getOrientation(rb));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* DragGestureRecognizer.java --
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002,2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -130,7 +130,7 @@ public abstract class DragGestureRecognizer implements Serializable
|
|||
public void resetRecognizer()
|
||||
throws NotImplementedException
|
||||
{
|
||||
throw new Error("not implemented");
|
||||
events = new ArrayList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,10 +154,15 @@ public abstract class DragGestureRecognizer implements Serializable
|
|||
dragGestureListener = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires a <code>DragGestureEvent</code> to the DragGestureListener
|
||||
* associated with this object, if there is one.
|
||||
*/
|
||||
protected void fireDragGestureRecognized(int dragAction, Point p)
|
||||
throws NotImplementedException
|
||||
{
|
||||
throw new Error("not implemented");
|
||||
if(dragGestureListener != null)
|
||||
dragGestureListener.dragGestureRecognized
|
||||
(new DragGestureEvent(this, dragAction, p, events));
|
||||
}
|
||||
|
||||
protected void appendEvent(InputEvent e)
|
||||
|
|
|
@ -38,8 +38,6 @@ exception statement from your version. */
|
|||
|
||||
package java.awt.font;
|
||||
|
||||
import gnu.classpath.NotImplementedException;
|
||||
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
/**
|
||||
|
@ -94,16 +92,18 @@ public final class GlyphMetrics
|
|||
return bounds;
|
||||
}
|
||||
|
||||
public float getLSB ()
|
||||
throws NotImplementedException
|
||||
public float getLSB()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
if (horizontal)
|
||||
return (float) bounds.getX();
|
||||
return (float) bounds.getY();
|
||||
}
|
||||
|
||||
public float getRSB ()
|
||||
throws NotImplementedException
|
||||
public float getRSB()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
if (horizontal)
|
||||
return (float) (advanceX - (bounds.getX() + bounds.getWidth()));
|
||||
return (float) (advanceY - (bounds.getY() + bounds.getHeight()));
|
||||
}
|
||||
|
||||
public int getType ()
|
||||
|
|
|
@ -38,8 +38,6 @@ exception statement from your version. */
|
|||
|
||||
package java.awt.font;
|
||||
|
||||
import gnu.classpath.NotImplementedException;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
|
@ -48,6 +46,7 @@ import java.awt.geom.Point2D;
|
|||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
/**
|
||||
* @author Lillian Angel (langel at redhat dot com)
|
||||
* @author Michael Koch
|
||||
*/
|
||||
public abstract class GlyphVector implements Cloneable
|
||||
|
@ -72,16 +71,22 @@ public abstract class GlyphVector implements Cloneable
|
|||
public abstract FontRenderContext getFontRenderContext ();
|
||||
|
||||
public int getGlyphCharIndex (int glyphIndex)
|
||||
throws NotImplementedException
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
return glyphIndex;
|
||||
}
|
||||
|
||||
public int[] getGlyphCharIndices (int beginGlyphIndex, int numEntries,
|
||||
int[] codeReturn)
|
||||
throws NotImplementedException
|
||||
public int[] getGlyphCharIndices(int beginGlyphIndex, int numEntries,
|
||||
int[] codeReturn)
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
if (codeReturn == null)
|
||||
codeReturn = new int[numEntries];
|
||||
|
||||
int i = 0;
|
||||
int j = beginGlyphIndex;
|
||||
while (j < numEntries)
|
||||
codeReturn[i++] = getGlyphCharIndex(j++);
|
||||
|
||||
return codeReturn;
|
||||
}
|
||||
|
||||
public abstract int getGlyphCode (int glyphIndex);
|
||||
|
@ -98,17 +103,27 @@ public abstract class GlyphVector implements Cloneable
|
|||
|
||||
public abstract Shape getGlyphOutline (int glyphIndex);
|
||||
|
||||
public Shape getGlyphOutline (int glyphIndex, float x, float y)
|
||||
throws NotImplementedException
|
||||
public Shape getGlyphOutline(int glyphIndex, float x, float y)
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
Shape s = getGlyphOutline(glyphIndex);
|
||||
|
||||
// This is the only way to translate the origin of a shape
|
||||
AffineTransform at = AffineTransform.getTranslateInstance(x, y);
|
||||
return at.createTransformedShape(s);
|
||||
}
|
||||
|
||||
public Rectangle getGlyphPixelBounds (int index, FontRenderContext renderFRC,
|
||||
float x, float y)
|
||||
throws NotImplementedException
|
||||
public Rectangle getGlyphPixelBounds(int index, FontRenderContext renderFRC,
|
||||
float x, float y)
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
Rectangle bounds = new Rectangle();
|
||||
Rectangle2D rect = getGlyphVisualBounds(index).getBounds2D();
|
||||
|
||||
bounds.x = (int) (rect.getX() + x);
|
||||
bounds.y = (int) (rect.getY() + y);
|
||||
bounds.width = (int) rect.getMaxX() - bounds.x;
|
||||
bounds.height = (int) rect.getMaxY() - bounds.y;
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
||||
public abstract Point2D getGlyphPosition (int glyphIndex);
|
||||
|
@ -121,10 +136,9 @@ public abstract class GlyphVector implements Cloneable
|
|||
|
||||
public abstract Shape getGlyphVisualBounds (int glyphIndex);
|
||||
|
||||
public int getLayoutFlags ()
|
||||
throws NotImplementedException
|
||||
public int getLayoutFlags()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
return 0;
|
||||
}
|
||||
|
||||
public abstract Rectangle2D getLogicalBounds ();
|
||||
|
@ -137,9 +151,16 @@ public abstract class GlyphVector implements Cloneable
|
|||
|
||||
public Rectangle getPixelBounds (FontRenderContext renderFRC,
|
||||
float x, float y)
|
||||
throws NotImplementedException
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
Rectangle bounds = new Rectangle();
|
||||
Rectangle2D rect = getVisualBounds();
|
||||
|
||||
bounds.x = (int) (rect.getX() + x);
|
||||
bounds.y = (int) (rect.getY() + y);
|
||||
bounds.width = (int) rect.getMaxX() - bounds.x;
|
||||
bounds.height = (int) rect.getMaxY() - bounds.y;
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
||||
public abstract Rectangle2D getVisualBounds ();
|
||||
|
|
|
@ -38,51 +38,100 @@ exception statement from your version. */
|
|||
|
||||
package java.awt.font;
|
||||
|
||||
import gnu.classpath.NotImplementedException;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
/**
|
||||
* This class represents a graphic embedded in text.
|
||||
*
|
||||
* @author Michael Koch
|
||||
* @author Lillian Angel (langel at redhat dot com)
|
||||
*/
|
||||
public abstract class GraphicAttribute
|
||||
{
|
||||
public static final int BOTTOM_ALIGNMENT = -2;
|
||||
public static final int BOTTOM_ALIGNMENT = - 2;
|
||||
public static final int CENTER_BASELINE = 1;
|
||||
public static final int HANGING_BASELINE = 2;
|
||||
public static final int ROMAN_BASELINE = 0;
|
||||
public static final int TOP_ALIGNMENT = -1;
|
||||
public static final int TOP_ALIGNMENT = - 1;
|
||||
|
||||
private int alignment;
|
||||
|
||||
protected GraphicAttribute (int alignment)
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param alignment - the alignment to use for the graphic
|
||||
*/
|
||||
protected GraphicAttribute(int alignment)
|
||||
{
|
||||
if (alignment < BOTTOM_ALIGNMENT || alignment > HANGING_BASELINE)
|
||||
throw new IllegalArgumentException("Invalid alignment");
|
||||
this.alignment = alignment;
|
||||
}
|
||||
|
||||
public abstract void draw (Graphics2D graphics, float x, float y);
|
||||
/**
|
||||
* Draws the graphic.
|
||||
*
|
||||
* @param graphics - the graphics configuration to use
|
||||
* @param x - the x location
|
||||
* @param y - the y location
|
||||
*/
|
||||
public abstract void draw(Graphics2D graphics, float x, float y);
|
||||
|
||||
public abstract float getAdvance ();
|
||||
/**
|
||||
* Gets the distance from the origin of its graphic to the right side of the
|
||||
* bounds of its graphic.
|
||||
*
|
||||
* @return the advance
|
||||
*/
|
||||
public abstract float getAdvance();
|
||||
|
||||
public final int getAlignment ()
|
||||
/**
|
||||
* Gets the positive distance from the origin of its graphic to the top of
|
||||
* bounds.
|
||||
*
|
||||
* @return the ascent
|
||||
*/
|
||||
public abstract float getAscent();
|
||||
|
||||
/**
|
||||
* Gets the distance from the origin of its graphic to the bottom of the bounds.
|
||||
*
|
||||
* @return the descent
|
||||
*/
|
||||
public abstract float getDescent();
|
||||
|
||||
/**
|
||||
* Gets the alignment.
|
||||
*
|
||||
* @return the alignment
|
||||
*/
|
||||
public final int getAlignment()
|
||||
{
|
||||
return alignment;
|
||||
}
|
||||
|
||||
public abstract float getAscent ();
|
||||
|
||||
public Rectangle2D getBounds ()
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Returns a Rectangle2D that encloses the rendered area.
|
||||
* Default bounds is the rectangle (0, -ascent, advance, ascent+descent).
|
||||
*
|
||||
* @return the bounds of the rendered area
|
||||
*/
|
||||
public Rectangle2D getBounds()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
float asc = getAscent();
|
||||
return new Rectangle2D.Float(0, - asc, getAdvance(), asc + getDescent());
|
||||
}
|
||||
|
||||
public abstract float getDescent ();
|
||||
|
||||
public GlyphJustificationInfo getJustificationInfo ()
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Returns the justification information for this object.
|
||||
*
|
||||
* @return the justification information
|
||||
*/
|
||||
public GlyphJustificationInfo getJustificationInfo()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
float adv = getAdvance();
|
||||
return new GlyphJustificationInfo(adv, false, 2, adv / 3, adv / 3, false,
|
||||
1, 0, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,82 +38,150 @@ exception statement from your version. */
|
|||
|
||||
package java.awt.font;
|
||||
|
||||
import gnu.classpath.NotImplementedException;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
/**
|
||||
* This is an implementation of GraphicAttribute which draws images in a
|
||||
* TextLayout.
|
||||
*
|
||||
* @author Lillian Angel
|
||||
* @author Michael Koch
|
||||
*/
|
||||
public final class ImageGraphicAttribute extends GraphicAttribute
|
||||
public final class ImageGraphicAttribute
|
||||
extends GraphicAttribute
|
||||
{
|
||||
private Image image;
|
||||
|
||||
public ImageGraphicAttribute (Image image, int alignment)
|
||||
private float originX;
|
||||
private float originY;
|
||||
|
||||
/**
|
||||
* Constucts an instance from the specified Image. The origin is at (0, 0).
|
||||
*
|
||||
* @param image - image to construct from.
|
||||
* @param alignment - the alignment
|
||||
*/
|
||||
public ImageGraphicAttribute(Image image, int alignment)
|
||||
{
|
||||
super (alignment);
|
||||
this(image, alignment, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constucts an instance from the specified Image. The origin is at (originX,
|
||||
* originY).
|
||||
*
|
||||
* @param image - image to construct from
|
||||
* @param alignment - the alignment
|
||||
* @param originX - x point of origin
|
||||
* @param originY - y point of origin
|
||||
*/
|
||||
public ImageGraphicAttribute(Image image, int alignment, float originX,
|
||||
float originY)
|
||||
{
|
||||
super(alignment);
|
||||
this.image = image;
|
||||
this.originX = originX;
|
||||
this.originY = originY;
|
||||
}
|
||||
|
||||
public ImageGraphicAttribute (Image image, int alignment, float originX,
|
||||
float originY)
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Draws the image at the specified location, relative to the
|
||||
* origin.
|
||||
*
|
||||
* @param g - the graphics to use to render the image
|
||||
* @param x - the x location
|
||||
* @param y - the y location
|
||||
*/
|
||||
public void draw(Graphics2D g, float x, float y)
|
||||
{
|
||||
super (alignment);
|
||||
this.image = image;
|
||||
|
||||
throw new Error ("not implemented");
|
||||
g.drawImage(image, (int) (x - originX), (int) (y - originY), null);
|
||||
}
|
||||
|
||||
public void draw (Graphics2D graphics, float x, float y)
|
||||
throws NotImplementedException
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
}
|
||||
|
||||
public boolean equals (Object obj)
|
||||
/**
|
||||
* Compares this to the specified Object
|
||||
*
|
||||
* @param obj - the object to compare
|
||||
* @return true if the obj and this are equivalent
|
||||
*/
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (! (obj instanceof ImageGraphicAttribute))
|
||||
return false;
|
||||
|
||||
return equals ((ImageGraphicAttribute) obj);
|
||||
return equals((ImageGraphicAttribute) obj);
|
||||
}
|
||||
|
||||
public boolean equals (ImageGraphicAttribute rhs)
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Compares this to the ImageGraphicAttribute given, by
|
||||
* comparing all fields and values.
|
||||
*
|
||||
* @param rhs - the ImageGraphicAttribute to compare
|
||||
* @return true if the object given is equivalent to this
|
||||
*/
|
||||
public boolean equals(ImageGraphicAttribute rhs)
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
return ((this == rhs) || ((this.getAscent() == rhs.getAscent())
|
||||
&& (this.getAdvance() == rhs.getAdvance())
|
||||
&& (this.getAlignment() == rhs.getAlignment())
|
||||
&& (this.getBounds().equals(rhs.getBounds()))
|
||||
&& (this.getDescent() == rhs.getDescent())
|
||||
&& (this.hashCode() == rhs.hashCode())
|
||||
&& (this.image.equals(rhs.image))
|
||||
&& (this.originX == rhs.originX)
|
||||
&& (this.originY == rhs.originY)));
|
||||
}
|
||||
|
||||
public float getAdvance ()
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Returns distance from the origin to the right edge of the image of this.
|
||||
*
|
||||
* @return the advance
|
||||
*/
|
||||
public float getAdvance()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
return Math.max(0, image.getWidth(null) - originX);
|
||||
}
|
||||
|
||||
public float getAscent ()
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Returns the the distance from the top of the image to the origin of this.
|
||||
*
|
||||
* @return the ascent.
|
||||
*/
|
||||
public float getAscent()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
return Math.max(0, originY);
|
||||
}
|
||||
|
||||
public Rectangle2D getBounds ()
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Gets the bounds of the object rendered, relative to the position.
|
||||
*
|
||||
* @return the bounds of the object rendered, relative to the position.
|
||||
*/
|
||||
public Rectangle2D getBounds()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
// This is equivalent to what Sun's JDK returns.
|
||||
// I am not entirely sure why the origin is negative.
|
||||
return new Rectangle2D.Float(- originX, - originY, image.getWidth(null),
|
||||
image.getHeight(null));
|
||||
}
|
||||
|
||||
public float getDescent ()
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Returns the distance from the origin to the bottom of the image.
|
||||
*
|
||||
* @return the descent
|
||||
*/
|
||||
public float getDescent()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
return Math.max(0, image.getHeight(null) - originY);
|
||||
}
|
||||
|
||||
public int hashCode ()
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Gets the hash code for this image.
|
||||
*
|
||||
* @return the hash code
|
||||
*/
|
||||
public int hashCode()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
return image.hashCode();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,74 +38,148 @@ exception statement from your version. */
|
|||
|
||||
package java.awt.font;
|
||||
|
||||
import gnu.classpath.NotImplementedException;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Shape;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
/**
|
||||
* This is an implementation of GraphicAttribute that draws shapes in a TextLayout.
|
||||
*
|
||||
* @author Lillian Angel (langel at redhat dot com)
|
||||
*/
|
||||
public final class ShapeGraphicAttribute extends GraphicAttribute
|
||||
{
|
||||
/** True if the shape should be filled. */
|
||||
public static final boolean FILL = false;
|
||||
|
||||
/** True if the shape should be stroked with a 1-pixel wide stroke. */
|
||||
public static final boolean STROKE = true;
|
||||
|
||||
private Shape shape;
|
||||
private boolean stroke;
|
||||
private Rectangle2D bounds;
|
||||
|
||||
public ShapeGraphicAttribute (Shape shape, int alignment, boolean stroke)
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param shape - the Shape to render. The Shape is rendered with its origin.
|
||||
* @param alignment - the alignment
|
||||
* @param stroke - true if the Shape should be stroked; false if the Shape
|
||||
* should be filled.
|
||||
*/
|
||||
public ShapeGraphicAttribute(Shape shape, int alignment, boolean stroke)
|
||||
{
|
||||
super (alignment);
|
||||
super(alignment);
|
||||
this.shape = shape;
|
||||
this.stroke = stroke;
|
||||
this.bounds = shape.getBounds2D();
|
||||
}
|
||||
|
||||
public void draw (Graphics2D graphics, float x, float y)
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Draws the graphic at the given location.
|
||||
*
|
||||
* @param graphics - the graphics to use.
|
||||
* @param x - the x location to draw at.
|
||||
* @param y - the y location to draw at.
|
||||
*/
|
||||
public void draw(Graphics2D graphics, float x, float y)
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
graphics.translate(x, y);
|
||||
if (stroke == STROKE)
|
||||
graphics.draw(shape);
|
||||
else
|
||||
graphics.fill(shape);
|
||||
graphics.translate(- x, - y);
|
||||
}
|
||||
|
||||
public boolean equals (Object obj)
|
||||
/**
|
||||
* Compares this ShapeGraphicAttribute to obj.
|
||||
*
|
||||
* @param obj - the object to compare.
|
||||
*/
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (! (obj instanceof ShapeGraphicAttribute))
|
||||
return false;
|
||||
|
||||
return equals ((ShapeGraphicAttribute) obj);
|
||||
return equals((ShapeGraphicAttribute) obj);
|
||||
}
|
||||
|
||||
public boolean equals (ShapeGraphicAttribute rhs)
|
||||
/**
|
||||
* Compares this ShapeGraphicAttribute to rhs.
|
||||
*
|
||||
* @param rhs - the ShapeGraphicAttribute to compare.
|
||||
*/
|
||||
public boolean equals(ShapeGraphicAttribute rhs)
|
||||
{
|
||||
return (shape.equals (rhs.shape)
|
||||
&& getAlignment () == rhs.getAlignment ()
|
||||
&& stroke == rhs.stroke);
|
||||
return (this == rhs || (this.shape.equals(rhs.shape)
|
||||
&& getAlignment() == rhs.getAlignment()
|
||||
&& stroke == rhs.stroke
|
||||
&& getAdvance() == rhs.getAdvance()
|
||||
&& getAscent() == rhs.getAscent()
|
||||
&& getBounds().equals(rhs.getBounds())
|
||||
&& getDescent() == rhs.getDescent()
|
||||
&& hashCode() == rhs.hashCode()));
|
||||
}
|
||||
|
||||
public float getAdvance ()
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Gets the distance from the origin of its Shape to the right side of the
|
||||
* bounds of its Shape.
|
||||
*
|
||||
* @return the advance
|
||||
*/
|
||||
public float getAdvance()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
return Math.max(0, (float) bounds.getMaxX());
|
||||
}
|
||||
|
||||
public float getAscent ()
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Gets the positive distance from the origin of its Shape to the top of
|
||||
* bounds.
|
||||
*
|
||||
* @return the ascent
|
||||
*/
|
||||
public float getAscent()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
return Math.max(0, -(float) bounds.getMinY());
|
||||
}
|
||||
|
||||
public Rectangle2D getBounds ()
|
||||
/**
|
||||
* Gets the distance from the origin of its Shape to the bottom of the bounds.
|
||||
*
|
||||
* @return the descent
|
||||
*/
|
||||
public float getDescent()
|
||||
{
|
||||
return shape.getBounds2D ();
|
||||
return Math.max(0, (float) bounds.getMaxY());
|
||||
}
|
||||
|
||||
public float getDescent ()
|
||||
throws NotImplementedException
|
||||
/**
|
||||
* Returns a Rectangle2D that encloses all of the bits drawn by this shape.
|
||||
*
|
||||
* @return the bounds of the shape.
|
||||
*/
|
||||
public Rectangle2D getBounds()
|
||||
{
|
||||
throw new Error ("not implemented");
|
||||
Rectangle2D.Float bounds = new Rectangle2D.Float();
|
||||
bounds.setRect(this.bounds);
|
||||
|
||||
if (stroke == STROKE)
|
||||
{
|
||||
bounds.width++;
|
||||
bounds.height++;
|
||||
}
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
||||
public int hashCode ()
|
||||
/**
|
||||
* Gets the hash code.
|
||||
*
|
||||
* @return the hash code.
|
||||
*/
|
||||
public int hashCode()
|
||||
{
|
||||
// FIXME: Check what SUN does here
|
||||
return shape.hashCode ();
|
||||
return shape.hashCode();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,8 +103,8 @@ public class InputContext
|
|||
while (e.hasMoreElements())
|
||||
{
|
||||
URL url = (URL) e.nextElement();
|
||||
BufferedReader in = null;
|
||||
String line = null;
|
||||
BufferedReader in;
|
||||
String line;
|
||||
try
|
||||
{
|
||||
in = new BufferedReader
|
||||
|
|
|
@ -80,7 +80,7 @@ public class BufferedImage extends Image
|
|||
TYPE_BYTE_INDEXED = 13;
|
||||
|
||||
static final int[] bits3 = { 8, 8, 8 };
|
||||
static final int[] bits4 = { 8, 8, 8 };
|
||||
static final int[] bits4 = { 8, 8, 8, 8 };
|
||||
static final int[] bits1byte = { 8 };
|
||||
static final int[] bits1ushort = { 16 };
|
||||
|
||||
|
|
|
@ -92,7 +92,12 @@ public abstract class ColorModel implements Transparency
|
|||
int transparency;
|
||||
boolean hasAlpha;
|
||||
boolean isAlphaPremultiplied;
|
||||
|
||||
|
||||
/**
|
||||
* The standard color model for the common sRGB.
|
||||
*/
|
||||
private static final ColorModel S_RGB_MODEL = new SRGBColorModel();
|
||||
|
||||
static int[] nArray(int value, int times)
|
||||
{
|
||||
int[] array = new int[times];
|
||||
|
@ -196,7 +201,7 @@ public abstract class ColorModel implements Transparency
|
|||
*/
|
||||
public static ColorModel getRGBdefault()
|
||||
{
|
||||
return new DirectColorModel(32, 0xff0000, 0xff00, 0xff, 0xff000000);
|
||||
return S_RGB_MODEL;
|
||||
}
|
||||
|
||||
public final boolean hasAlpha()
|
||||
|
@ -761,4 +766,56 @@ public abstract class ColorModel implements Transparency
|
|||
{
|
||||
return getClass().getName() + "[" + stringParam() + "]";
|
||||
}
|
||||
|
||||
/**
|
||||
* A color model optimized for standard sRGB.
|
||||
*/
|
||||
private static class SRGBColorModel
|
||||
extends DirectColorModel
|
||||
{
|
||||
|
||||
SRGBColorModel()
|
||||
{
|
||||
super(32,0x00FF0000,0x0000FF00,0x000000FF,0xFF000000);
|
||||
}
|
||||
|
||||
public int getAlpha(Object inData)
|
||||
{
|
||||
return ((((int[]) inData)[0]) >> 24) & 0xFF;
|
||||
}
|
||||
|
||||
public int getBlue(Object inData)
|
||||
{
|
||||
return ((((int[]) inData)[0])) & 0xFF;
|
||||
}
|
||||
|
||||
public int getGreen(Object inData)
|
||||
{
|
||||
return ((((int[]) inData)[0]) >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
public int getRed(Object inData)
|
||||
{
|
||||
return ((((int[]) inData)[0]) >> 16) & 0xFF;
|
||||
}
|
||||
|
||||
public int getRGB(Object inData)
|
||||
{
|
||||
return ((int[]) inData)[0];
|
||||
}
|
||||
|
||||
public Object getDataElements(int rgb, Object pixel)
|
||||
{
|
||||
if(pixel == null)
|
||||
{
|
||||
pixel = new int[]{rgb};
|
||||
}
|
||||
else
|
||||
{
|
||||
((int[]) pixel)[0] = rgb;
|
||||
}
|
||||
|
||||
return pixel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,9 +38,13 @@ exception statement from your version. */
|
|||
|
||||
package java.awt.print;
|
||||
|
||||
import java.awt.HeadlessException;
|
||||
import gnu.java.awt.print.JavaPrinterJob;
|
||||
|
||||
import java.awt.HeadlessException;
|
||||
import javax.print.PrintService;
|
||||
import javax.print.PrintServiceLookup;
|
||||
import javax.print.DocFlavor;
|
||||
import javax.print.StreamPrintServiceFactory;
|
||||
import javax.print.attribute.PrintRequestAttributeSet;
|
||||
|
||||
/**
|
||||
|
@ -60,8 +64,7 @@ public abstract class PrinterJob
|
|||
*/
|
||||
public static PrinterJob getPrinterJob()
|
||||
{
|
||||
// FIXME: Need to fix this to load a default implementation instance.
|
||||
return new NoPrinterJob();
|
||||
return new JavaPrinterJob();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -244,13 +247,11 @@ public abstract class PrinterJob
|
|||
*/
|
||||
public static PrintService[] lookupPrintServices()
|
||||
{
|
||||
return new PrintService[0];
|
||||
// FIXME:
|
||||
// Enable this when javax.print has this implemented.
|
||||
// return PrintServiceLookup.lookupPrintServices(
|
||||
// new DocFlavor("application/x-java-jvm-local-objectref",
|
||||
// "java.awt.print.Pageable"),
|
||||
// null);
|
||||
return PrintServiceLookup.lookupPrintServices
|
||||
(
|
||||
new DocFlavor("application/x-java-jvm-local-objectref",
|
||||
"java.awt.print.Pageable"),
|
||||
null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -263,8 +264,8 @@ public abstract class PrinterJob
|
|||
* @return Array of stream print services, could be empty.
|
||||
* @since 1.4
|
||||
*/
|
||||
// FIXME:
|
||||
// Enable when javax.print has StreamPrintServiceFactory
|
||||
// FIXME:
|
||||
// Enable when StreamPrintServiceFactory has lookupStreamServiceFactories
|
||||
// public static StreamPrintServiceFactory[] lookupStreamPrintServices(String mimeType)
|
||||
// {
|
||||
// return StreamPrintServiceFactory.lookupStreamServiceFactories(
|
||||
|
@ -282,7 +283,7 @@ public abstract class PrinterJob
|
|||
*/
|
||||
public PrintService getPrintService()
|
||||
{
|
||||
return null;
|
||||
return printer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -297,6 +298,6 @@ public abstract class PrinterJob
|
|||
public void setPrintService(PrintService service)
|
||||
throws PrinterException
|
||||
{
|
||||
throw new PrinterException();
|
||||
printer = service;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -481,7 +481,7 @@ public abstract class NumberFormat extends Format implements Cloneable
|
|||
*/
|
||||
public static NumberFormat getIntegerInstance(Locale locale)
|
||||
{
|
||||
NumberFormat format = computeInstance (locale, "numberFormat", "#,##0");
|
||||
NumberFormat format = computeInstance (locale, "integerFormat", "#,##0");
|
||||
format.setMaximumFractionDigits(0);
|
||||
format.setParseIntegerOnly (true);
|
||||
return format;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue