diff options
author | fitzsim <fitzsim@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-06-09 16:07:07 +0000 |
---|---|---|
committer | fitzsim <fitzsim@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-06-09 16:07:07 +0000 |
commit | 48591d852fc71f04d7083dcb0b37cf27b5d6942b (patch) | |
tree | 0802013820f309170e8ae5584b09e9672bab2cb6 /libjava/classpath/native/jni | |
parent | 5f2bd98fb3528fa948341bdac3f4c4ac9a177595 (diff) | |
download | gcc-48591d852fc71f04d7083dcb0b37cf27b5d6942b.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114510 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/native/jni')
37 files changed, 3264 insertions, 692 deletions
diff --git a/libjava/classpath/native/jni/Makefile.in b/libjava/classpath/native/jni/Makefile.in index 3bdeee20e4d..30e9f37fca6 100644 --- a/libjava/classpath/native/jni/Makefile.in +++ b/libjava/classpath/native/jni/Makefile.in @@ -72,8 +72,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@ @@ -100,8 +98,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@ @@ -124,6 +126,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@ @@ -139,9 +143,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@ @@ -163,6 +166,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -176,6 +180,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@ @@ -189,6 +195,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@ @@ -208,11 +215,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@ diff --git a/libjava/classpath/native/jni/classpath/Makefile.in b/libjava/classpath/native/jni/classpath/Makefile.in index b2e89f4934d..967dd6e8140 100644 --- a/libjava/classpath/native/jni/classpath/Makefile.in +++ b/libjava/classpath/native/jni/classpath/Makefile.in @@ -82,8 +82,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@ @@ -110,8 +108,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@ @@ -134,6 +136,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@ @@ -149,9 +153,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@ @@ -173,6 +176,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -186,6 +190,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@ @@ -199,6 +205,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@ @@ -218,11 +225,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@ diff --git a/libjava/classpath/native/jni/classpath/jcl.h b/libjava/classpath/native/jni/classpath/jcl.h index 514b7826291..d358aeb9c85 100644 --- a/libjava/classpath/native/jni/classpath/jcl.h +++ b/libjava/classpath/native/jni/classpath/jcl.h @@ -1,5 +1,5 @@ /* jcl.h - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -50,6 +50,10 @@ typedef jlong jpointer; #error "Unknown pointer size" #endif +/* Helper macros for going between pointers and jlongs. */ +#define JLONG_TO_PTR(T,P) ((T *)(long)P) +#define PTR_TO_JLONG(P) ((jlong)(long)P) + JNIEXPORT jclass JNICALL JCL_FindClass (JNIEnv * env, const char *className); JNIEXPORT void JNICALL JCL_ThrowException (JNIEnv * env, const char *className, diff --git a/libjava/classpath/native/jni/gtk-peer/.cvsignore b/libjava/classpath/native/jni/gtk-peer/.cvsignore new file mode 100644 index 00000000000..e9f2658a694 --- /dev/null +++ b/libjava/classpath/native/jni/gtk-peer/.cvsignore @@ -0,0 +1,8 @@ +*.o +*.a +*.lo +*.la +.libs +.deps +Makefile +Makefile.in diff --git a/libjava/classpath/native/jni/gtk-peer/Makefile.am b/libjava/classpath/native/jni/gtk-peer/Makefile.am index cdee1e5a790..fda823c0427 100644 --- a/libjava/classpath/native/jni/gtk-peer/Makefile.am +++ b/libjava/classpath/native/jni/gtk-peer/Makefile.am @@ -4,21 +4,18 @@ gcc_version := $(shell cat $(top_srcdir)/../../gcc/BASE-VER) gcjversionedlibdir = $(libdir)/gcj-$(gcc_version) gcjversionedlib_LTLIBRARIES = libgtkpeer.la -# Gtk/Cairo JNI sources. -if GTK_CAIRO - gtk_cairo_c_source_files = \ - gnu_java_awt_peer_gtk_GdkGraphics2D.c -else - gtk_cairo_c_source_files = -endif - -libgtkpeer_la_SOURCES = $(gtk_cairo_c_source_files) \ +# GTK JNI sources. +libgtkpeer_la_SOURCES = gnu_java_awt_peer_gtk_CairoSurface.c \ + gnu_java_awt_peer_gtk_CairoGraphics2D.c \ + gnu_java_awt_peer_gtk_ComponentGraphics.c \ + gnu_java_awt_peer_gtk_ComponentGraphicsCopy.c \ + gnu_java_awt_peer_gtk_FreetypeGlyphVector.c \ gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c \ gnu_java_awt_peer_gtk_GdkFontPeer.c \ - gnu_java_awt_peer_gtk_GdkGraphics.c \ gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c \ gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \ gnu_java_awt_peer_gtk_GdkRobotPeer.c \ + gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c \ gnu_java_awt_peer_gtk_GdkTextLayout.c \ gnu_java_awt_peer_gtk_GtkButtonPeer.c \ gnu_java_awt_peer_gtk_GtkCanvasPeer.c \ @@ -48,10 +45,12 @@ libgtkpeer_la_SOURCES = $(gtk_cairo_c_source_files) \ gnu_java_awt_peer_gtk_GtkTextFieldPeer.c \ gnu_java_awt_peer_gtk_GtkToolkit.c \ gnu_java_awt_peer_gtk_GtkWindowPeer.c \ + gnu_java_awt_peer_gtk_GtkVolatileImage.c \ + cairographics2d.h \ gthread-jni.c \ + gdkdisplay.h \ gdkfont.h \ gthread-jni.h \ - gtkcairopeer.h \ gtk_jawt.c \ gtkpeer.h @@ -62,12 +61,12 @@ libgtkpeer_la_LDFLAGS = -rpath $(gcjversionedlibdir) \ libgtkpeer_la_LIBADD = $(top_builddir)/native/jni/classpath/native_state.lo \ $(top_builddir)/native/jni/classpath/jcl.lo -AM_LDFLAGS = @CLASSPATH_MODULE@ @GTK_LIBS@ @CAIRO_LIBS@ @FREETYPE2_LIBS@ \ - @PANGOFT2_LIBS@ @X_PRE_LIBS@ @X_LIBS@ @X_EXTRA_LIBS@ -lX11 -lXtst +AM_LDFLAGS = @CLASSPATH_MODULE@ @GTK_LIBS@ @FREETYPE2_LIBS@ \ + @PANGOFT2_LIBS@ @X_PRE_LIBS@ @X_LIBS@ @X_EXTRA_LIBS@ @XTEST_LIBS@ AM_CPPFLAGS = @CLASSPATH_INCLUDES@ # Just the WARNING_CFLAGS. We cannot use the strict flags since the gtk # headers contain broken prototypes (by design, see gtkitemfactory.h). AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@ \ - @GTK_CFLAGS@ @CAIRO_CFLAGS@ @FREETYPE2_CFLAGS@ @PANGOFT2_CFLAGS@ \ + @GTK_CFLAGS@ @FREETYPE2_CFLAGS@ @PANGOFT2_CFLAGS@ \ @X_CFLAGS@ diff --git a/libjava/classpath/native/jni/gtk-peer/Makefile.in b/libjava/classpath/native/jni/gtk-peer/Makefile.in index ff3e5a1174c..9c155172121 100644 --- a/libjava/classpath/native/jni/gtk-peer/Makefile.in +++ b/libjava/classpath/native/jni/gtk-peer/Makefile.in @@ -64,53 +64,17 @@ LTLIBRARIES = $(gcjversionedlib_LTLIBRARIES) libgtkpeer_la_DEPENDENCIES = \ $(top_builddir)/native/jni/classpath/native_state.lo \ $(top_builddir)/native/jni/classpath/jcl.lo -am__libgtkpeer_la_SOURCES_DIST = \ - gnu_java_awt_peer_gtk_GdkGraphics2D.c \ - gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c \ - gnu_java_awt_peer_gtk_GdkFontPeer.c \ - gnu_java_awt_peer_gtk_GdkGraphics.c \ - gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c \ - gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \ - gnu_java_awt_peer_gtk_GdkRobotPeer.c \ - gnu_java_awt_peer_gtk_GdkTextLayout.c \ - gnu_java_awt_peer_gtk_GtkButtonPeer.c \ - gnu_java_awt_peer_gtk_GtkCanvasPeer.c \ - gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c \ - gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c \ - gnu_java_awt_peer_gtk_GtkCheckboxPeer.c \ - gnu_java_awt_peer_gtk_GtkChoicePeer.c \ - gnu_java_awt_peer_gtk_GtkClipboard.c \ - gnu_java_awt_peer_gtk_GtkComponentPeer.c \ - gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c \ - gnu_java_awt_peer_gtk_GtkFileDialogPeer.c \ - gnu_java_awt_peer_gtk_GtkFramePeer.c \ - gnu_java_awt_peer_gtk_GtkGenericPeer.c \ - gnu_java_awt_peer_gtk_GtkImage.c \ - gnu_java_awt_peer_gtk_GtkLabelPeer.c \ - gnu_java_awt_peer_gtk_GtkListPeer.c \ - gnu_java_awt_peer_gtk_GtkMenuBarPeer.c \ - gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c \ - gnu_java_awt_peer_gtk_GtkMenuItemPeer.c \ - gnu_java_awt_peer_gtk_GtkMenuPeer.c \ - gnu_java_awt_peer_gtk_GtkPanelPeer.c \ - gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c \ - gnu_java_awt_peer_gtk_GtkScrollbarPeer.c \ - gnu_java_awt_peer_gtk_GtkScrollPanePeer.c \ - gnu_java_awt_peer_gtk_GtkSelection.c \ - gnu_java_awt_peer_gtk_GtkTextAreaPeer.c \ - gnu_java_awt_peer_gtk_GtkTextFieldPeer.c \ - gnu_java_awt_peer_gtk_GtkToolkit.c \ - gnu_java_awt_peer_gtk_GtkWindowPeer.c gthread-jni.c gdkfont.h \ - gthread-jni.h gtkcairopeer.h gtk_jawt.c gtkpeer.h -@GTK_CAIRO_TRUE@am__objects_1 = \ -@GTK_CAIRO_TRUE@ gnu_java_awt_peer_gtk_GdkGraphics2D.lo -am_libgtkpeer_la_OBJECTS = $(am__objects_1) \ +am_libgtkpeer_la_OBJECTS = gnu_java_awt_peer_gtk_CairoSurface.lo \ + gnu_java_awt_peer_gtk_CairoGraphics2D.lo \ + gnu_java_awt_peer_gtk_ComponentGraphics.lo \ + gnu_java_awt_peer_gtk_ComponentGraphicsCopy.lo \ + gnu_java_awt_peer_gtk_FreetypeGlyphVector.lo \ gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo \ gnu_java_awt_peer_gtk_GdkFontPeer.lo \ - gnu_java_awt_peer_gtk_GdkGraphics.lo \ gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo \ gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo \ gnu_java_awt_peer_gtk_GdkRobotPeer.lo \ + gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.lo \ gnu_java_awt_peer_gtk_GdkTextLayout.lo \ gnu_java_awt_peer_gtk_GtkButtonPeer.lo \ gnu_java_awt_peer_gtk_GtkCanvasPeer.lo \ @@ -139,7 +103,8 @@ am_libgtkpeer_la_OBJECTS = $(am__objects_1) \ gnu_java_awt_peer_gtk_GtkTextAreaPeer.lo \ gnu_java_awt_peer_gtk_GtkTextFieldPeer.lo \ gnu_java_awt_peer_gtk_GtkToolkit.lo \ - gnu_java_awt_peer_gtk_GtkWindowPeer.lo gthread-jni.lo \ + gnu_java_awt_peer_gtk_GtkWindowPeer.lo \ + gnu_java_awt_peer_gtk_GtkVolatileImage.lo gthread-jni.lo \ gtk_jawt.lo libgtkpeer_la_OBJECTS = $(am_libgtkpeer_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include @@ -154,7 +119,7 @@ CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libgtkpeer_la_SOURCES) -DIST_SOURCES = $(am__libgtkpeer_la_SOURCES_DIST) +DIST_SOURCES = $(libgtkpeer_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -168,8 +133,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@ @@ -196,8 +159,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@ @@ -220,6 +187,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@ @@ -235,9 +204,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@ @@ -259,6 +227,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -272,6 +241,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@ @@ -285,6 +256,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@ @@ -304,11 +276,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@ @@ -366,19 +340,19 @@ vm_classes = @vm_classes@ gcc_version := $(shell cat $(top_srcdir)/../../gcc/BASE-VER) gcjversionedlibdir = $(libdir)/gcj-$(gcc_version) gcjversionedlib_LTLIBRARIES = libgtkpeer.la -@GTK_CAIRO_FALSE@gtk_cairo_c_source_files = -# Gtk/Cairo JNI sources. -@GTK_CAIRO_TRUE@gtk_cairo_c_source_files = \ -@GTK_CAIRO_TRUE@ gnu_java_awt_peer_gtk_GdkGraphics2D.c - -libgtkpeer_la_SOURCES = $(gtk_cairo_c_source_files) \ +# GTK JNI sources. +libgtkpeer_la_SOURCES = gnu_java_awt_peer_gtk_CairoSurface.c \ + gnu_java_awt_peer_gtk_CairoGraphics2D.c \ + gnu_java_awt_peer_gtk_ComponentGraphics.c \ + gnu_java_awt_peer_gtk_ComponentGraphicsCopy.c \ + gnu_java_awt_peer_gtk_FreetypeGlyphVector.c \ gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c \ gnu_java_awt_peer_gtk_GdkFontPeer.c \ - gnu_java_awt_peer_gtk_GdkGraphics.c \ gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c \ gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \ gnu_java_awt_peer_gtk_GdkRobotPeer.c \ + gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c \ gnu_java_awt_peer_gtk_GdkTextLayout.c \ gnu_java_awt_peer_gtk_GtkButtonPeer.c \ gnu_java_awt_peer_gtk_GtkCanvasPeer.c \ @@ -408,10 +382,12 @@ libgtkpeer_la_SOURCES = $(gtk_cairo_c_source_files) \ gnu_java_awt_peer_gtk_GtkTextFieldPeer.c \ gnu_java_awt_peer_gtk_GtkToolkit.c \ gnu_java_awt_peer_gtk_GtkWindowPeer.c \ + gnu_java_awt_peer_gtk_GtkVolatileImage.c \ + cairographics2d.h \ gthread-jni.c \ + gdkdisplay.h \ gdkfont.h \ gthread-jni.h \ - gtkcairopeer.h \ gtk_jawt.c \ gtkpeer.h @@ -421,15 +397,15 @@ libgtkpeer_la_LDFLAGS = -rpath $(gcjversionedlibdir) \ libgtkpeer_la_LIBADD = $(top_builddir)/native/jni/classpath/native_state.lo \ $(top_builddir)/native/jni/classpath/jcl.lo -AM_LDFLAGS = @CLASSPATH_MODULE@ @GTK_LIBS@ @CAIRO_LIBS@ @FREETYPE2_LIBS@ \ - @PANGOFT2_LIBS@ @X_PRE_LIBS@ @X_LIBS@ @X_EXTRA_LIBS@ -lX11 -lXtst +AM_LDFLAGS = @CLASSPATH_MODULE@ @GTK_LIBS@ @FREETYPE2_LIBS@ \ + @PANGOFT2_LIBS@ @X_PRE_LIBS@ @X_LIBS@ @X_EXTRA_LIBS@ @XTEST_LIBS@ AM_CPPFLAGS = @CLASSPATH_INCLUDES@ # Just the WARNING_CFLAGS. We cannot use the strict flags since the gtk # headers contain broken prototypes (by design, see gtkitemfactory.h). AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@ \ - @GTK_CFLAGS@ @CAIRO_CFLAGS@ @FREETYPE2_CFLAGS@ @PANGOFT2_CFLAGS@ \ + @GTK_CFLAGS@ @FREETYPE2_CFLAGS@ @PANGOFT2_CFLAGS@ \ @X_CFLAGS@ all: all-am @@ -501,13 +477,17 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_CairoGraphics2D.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_CairoSurface.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_ComponentGraphics.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_ComponentGraphicsCopy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_FreetypeGlyphVector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GdkFontPeer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GdkGraphics.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GdkGraphics2D.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GdkPixbufDecoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GdkRobotPeer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GdkTextLayout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GtkButtonPeer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GtkCanvasPeer.Plo@am__quote@ @@ -536,6 +516,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GtkTextAreaPeer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GtkTextFieldPeer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GtkToolkit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GtkVolatileImage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_awt_peer_gtk_GtkWindowPeer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gthread-jni.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtk_jawt.Plo@am__quote@ diff --git a/libjava/classpath/native/jni/gtk-peer/cairographics2d.h b/libjava/classpath/native/jni/gtk-peer/cairographics2d.h new file mode 100644 index 00000000000..2c12384deaf --- /dev/null +++ b/libjava/classpath/native/jni/gtk-peer/cairographics2d.h @@ -0,0 +1,119 @@ +/* cairographics2d.h -- + 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. */ + +#ifndef CAIROGRAPHICS2D_H +#define CAIROGRAPHICS2D_H + + +#include <cairo.h> +#include <gtk/gtk.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <config.h> +#include "native_state.h" +#include <gdk-pixbuf/gdk-pixbuf.h> + +#include <jni.h> + +/* + * These public final constants are part of the java2d public API, so we + * write them explicitly here to save fetching them from the constant pool + * all the time. + */ +enum java_awt_alpha_composite_rule + { + java_awt_alpha_composite_CLEAR = 1, + java_awt_alpha_composite_SRC = 2, + java_awt_alpha_composite_SRC_OVER = 3, + java_awt_alpha_composite_DST_OVER = 4, + java_awt_alpha_composite_SRC_IN = 5, + java_awt_alpha_composite_DST_IN = 6, + java_awt_alpha_composite_SRC_OUT = 7, + java_awt_alpha_composite_DST_OUT = 8, + java_awt_alpha_composite_DST = 9, + java_awt_alpha_composite_SRC_ATOP = 10, + java_awt_alpha_composite_DST_ATOP = 11, + java_awt_alpha_composite_XOR = 12 + }; + +enum java_awt_basic_stroke_join_rule + { + java_awt_basic_stroke_JOIN_MITER = 0, + java_awt_basic_stroke_JOIN_ROUND = 1, + java_awt_basic_stroke_JOIN_BEVEL = 2 + }; + +enum java_awt_basic_stroke_cap_rule + { + java_awt_basic_stroke_CAP_BUTT = 0, + java_awt_basic_stroke_CAP_ROUND = 1, + java_awt_basic_stroke_CAP_SQUARE = 2 + }; + +enum java_awt_geom_path_iterator_winding_rule + { + java_awt_geom_path_iterator_WIND_EVEN_ODD = 0, + java_awt_geom_path_iterator_WIND_NON_ZERO = 1 + }; + +enum java_awt_rendering_hints_filter + { + java_awt_rendering_hints_VALUE_INTERPOLATION_NEAREST_NEIGHBOR = 0, + java_awt_rendering_hints_VALUE_INTERPOLATION_BILINEAR = 1, + java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_SPEED = 2, + java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_QUALITY = 3, + java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_DEFAULT = 4 + + }; + +/** + * A structure which basically contains the cairo_t pointer. + * The rest is for gradient and texture fills. + */ +struct cairographics2d +{ + cairo_t *cr; + cairo_surface_t *pattern_surface; + cairo_pattern_t *pattern; + char *pattern_pixels; +}; + +cairo_t *cp_gtk_get_cairo_t(JNIEnv *env, + jobject cairographics2dobj); + +#endif diff --git a/libjava/classpath/native/jni/gtk-peer/gdkdisplay.h b/libjava/classpath/native/jni/gtk-peer/gdkdisplay.h new file mode 100644 index 00000000000..238ff9e2613 --- /dev/null +++ b/libjava/classpath/native/jni/gtk-peer/gdkdisplay.h @@ -0,0 +1,67 @@ +#ifndef __GDKDISPLAY_H__ +#define __GDKDISPLAY_H__ + +/* gdkdisplay.h -- Some global stuff related to displays & screens + 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. */ + +#include "gtkpeer.h" + +/* Allows storing GdkDisplay pointers in GdkGraphicsEnvironment instances. */ +extern struct state_table *cp_gtk_native_display_state_table; + +/* Allows storing GdkScreen pointers in GdkScreenGraphicsDevice instances. */ +extern struct state_table *cp_gtk_native_screen_state_table; + +#define NSA_DISPLAY_INIT(env, clazz) \ + cp_gtk_native_display_state_table = cp_gtk_init_state_table (env, clazz) + +#define NSA_GET_DISPLAY_PTR(env, obj) \ + cp_gtk_get_state (env, obj, cp_gtk_native_display_state_table) + +#define NSA_SET_DISPLAY_PTR(env, obj, ptr) \ + cp_gtk_set_state (env, obj, cp_gtk_native_display_state_table, (void *)ptr) + +#define NSA_SCREEN_INIT(env, clazz) \ + cp_gtk_native_screen_state_table = cp_gtk_init_state_table (env, clazz) + +#define NSA_GET_SCREEN_PTR(env, obj) \ + cp_gtk_get_state (env, obj, cp_gtk_native_screen_state_table) + +#define NSA_SET_SCREEN_PTR(env, obj, ptr) \ + cp_gtk_set_state (env, obj, cp_gtk_native_screen_state_table, (void *)ptr) + +#endif /* __GDKDISPLAY_H__ */ diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c new file mode 100644 index 00000000000..f4f7c28d37e --- /dev/null +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c @@ -0,0 +1,703 @@ +/* gnu_java_awt_peer_gtk_CairoGraphics2d.c + 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. */ + +#include "jcl.h" +#include "gdkfont.h" +#include "cairographics2d.h" +#include "gnu_java_awt_peer_gtk_CairoGraphics2D.h" +#include <gdk/gdktypes.h> +#include <gdk/gdkprivate.h> +#include <gdk/gdkx.h> + +#include <cairo-ft.h> +#include <cairo-xlib.h> + +#include <stdio.h> +#include <stdlib.h> + +static void install_font_peer(cairo_t *cr, struct peerfont *pfont); +static void update_pattern_transform (struct cairographics2d *gr); +static struct cairographics2d *getPointer(JNIEnv *env, jobject obj); + +static struct cairographics2d * +getPointer(JNIEnv *env, jobject obj) +{ + jclass cls; + jlong value; + jfieldID nofid; + cls = (*env)->GetObjectClass( env, obj ); + nofid = (*env)->GetFieldID( env, cls, "nativePointer", "J" ); + value = (*env)->GetLongField( env, obj, nofid ); + (*env)->DeleteLocalRef( env, cls ); + + return JLONG_TO_PTR(struct cairographics2d, value); +} + +/** + * Returns the cairo_t * associated with a CairoGraphics2D object, + * This is used by GdkTextLayout. + */ +cairo_t *cp_gtk_get_cairo_t(JNIEnv *env, + jobject cairographics2dobj) +{ + struct cairographics2d *gr = getPointer(env, cairographics2dobj); + g_assert(gr != NULL); + return gr->cr; +} + +/** + * Allocates the cairographics2d structure. + */ +JNIEXPORT jlong JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_init + (JNIEnv *env __attribute__ ((unused)), + jobject obj __attribute__ ((unused)), + jlong cairo_t_pointer) +{ + struct cairographics2d *g = NULL; + cairo_t *cr = JLONG_TO_PTR(cairo_t, cairo_t_pointer); + g_assert(cr != NULL); + + g = (struct cairographics2d *) g_malloc (sizeof (struct cairographics2d)); + + g_assert (g != NULL); + memset (g, 0, sizeof(struct cairographics2d)); + g->cr = cr; + + return PTR_TO_JLONG(g); +} + +/** + * Disposes of the cairographics2d structure. + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_disposeNative + (JNIEnv *env, jobject obj) +{ + struct cairographics2d *gr = getPointer(env, obj); + + if (gr == NULL) + return; + + if (gr->cr) + cairo_destroy (gr->cr); + + if (gr->pattern) + cairo_pattern_destroy (gr->pattern); + gr->pattern = NULL; + + if (gr->pattern_surface) + cairo_surface_destroy (gr->pattern_surface); + gr->pattern_surface = NULL; + + if (gr->pattern_pixels) + g_free(gr->pattern_pixels); + gr->pattern_pixels = NULL; + + g_free( gr ); +} + +/** + * Set the gradient. + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setGradient + (JNIEnv *env, jobject obj, + jdouble x1, jdouble y1, + jdouble x2, jdouble y2, + jint r1, jint g1, jint b1, jint a1, + jint r2, jint g2, jint b2, jint a2, + jboolean cyclic) +{ + struct cairographics2d *gr = NULL; + cairo_pattern_t* pattern; + cairo_extend_t extend; + + gr = getPointer (env, obj); + g_assert( gr != NULL ); + + pattern = cairo_pattern_create_linear(x1, y1, x2, y2); + g_assert( pattern != NULL ); + + cairo_pattern_add_color_stop_rgba(pattern, 0.0, r1 / 255.0, g1 / 255.0, + b1 / 255.0, a1 / 255.0); + + cairo_pattern_add_color_stop_rgba(pattern, 1.0, r2 / 255.0, g2 / 255.0, + b2 / 255.0, a2 / 255.0); + + extend = (cyclic == JNI_TRUE) ? CAIRO_EXTEND_REFLECT : CAIRO_EXTEND_NONE; + + cairo_pattern_set_extend( pattern, extend ); + + gr->pattern = pattern; + cairo_set_source(gr->cr, gr->pattern); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_setTexturePixels + (JNIEnv *env, jobject obj, jintArray jarr, jint w, jint h, jint stride) +{ + struct cairographics2d *gr = NULL; + jint *jpixels = NULL; + + gr = getPointer (env, obj); + g_assert (gr != NULL); + + if (gr->pattern) + cairo_pattern_destroy (gr->pattern); + + if (gr->pattern_surface) + cairo_surface_destroy (gr->pattern_surface); + + if (gr->pattern_pixels) + g_free (gr->pattern_pixels); + + gr->pattern = NULL; + gr->pattern_surface = NULL; + gr->pattern_pixels = NULL; + + gr->pattern_pixels = (char *) g_malloc (h * stride * 4); + g_assert (gr->pattern_pixels != NULL); + + jpixels = (*env)->GetIntArrayElements (env, jarr, NULL); + g_assert (jpixels != NULL); + memcpy (gr->pattern_pixels, jpixels, h * stride * 4); + (*env)->ReleaseIntArrayElements (env, jarr, jpixels, 0); + + gr->pattern_surface = cairo_image_surface_create_for_data ((unsigned char *)gr->pattern_pixels, + CAIRO_FORMAT_ARGB32, + w, h, stride * 4); + g_assert (gr->pattern_surface != NULL); + gr->pattern = cairo_pattern_create_for_surface (gr->pattern_surface); + g_assert (gr->pattern != NULL); + cairo_pattern_set_extend (gr->pattern, CAIRO_EXTEND_REPEAT); + cairo_set_source (gr->cr, gr->pattern); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_drawPixels + (JNIEnv *env, jobject obj, jintArray java_pixels, + jint w, jint h, jint stride, jdoubleArray java_matrix) +{ + jint *native_pixels = NULL; + jdouble *native_matrix = NULL; + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + native_pixels = (*env)->GetIntArrayElements (env, java_pixels, NULL); + native_matrix = (*env)->GetDoubleArrayElements (env, java_matrix, NULL); + g_assert (native_pixels != NULL); + g_assert (native_matrix != NULL); + g_assert ((*env)->GetArrayLength (env, java_matrix) == 6); + + { + cairo_matrix_t mat; + cairo_pattern_t *p; + cairo_surface_t *surf = cairo_image_surface_create_for_data ((unsigned char *)native_pixels, + CAIRO_FORMAT_ARGB32, + w, h, stride * 4); + cairo_matrix_init_identity (&mat); + cairo_matrix_init (&mat, + native_matrix[0], native_matrix[1], + native_matrix[2], native_matrix[3], + native_matrix[4], native_matrix[5]); + + p = cairo_pattern_create_for_surface (surf); + cairo_pattern_set_matrix (p, &mat); + if (gr->pattern) + cairo_pattern_set_filter (p, cairo_pattern_get_filter (gr->pattern)); + cairo_set_source (gr->cr, p); + cairo_paint (gr->cr); + cairo_pattern_destroy (p); + cairo_surface_destroy (surf); + } + + (*env)->ReleaseIntArrayElements (env, java_pixels, native_pixels, 0); + (*env)->ReleaseDoubleArrayElements (env, java_matrix, native_matrix, 0); +} + + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetMatrix + (JNIEnv *env, jobject obj, jdoubleArray java_matrix) +{ + jdouble *native_matrix = NULL; + struct cairographics2d *gr = getPointer (env, obj); + + native_matrix = (*env)->GetDoubleArrayElements (env, java_matrix, NULL); + g_assert (native_matrix != NULL); + g_assert ((*env)->GetArrayLength (env, java_matrix) == 6); + + { + cairo_matrix_t mat; + + cairo_matrix_init_identity (&mat); + cairo_matrix_init (&mat, + native_matrix[0], native_matrix[1], + native_matrix[2], native_matrix[3], + native_matrix[4], native_matrix[5]); + cairo_set_matrix (gr->cr, &mat); + } + + (*env)->ReleaseDoubleArrayElements (env, java_matrix, native_matrix, 0); + update_pattern_transform (gr); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawGlyphVector + (JNIEnv *env, jobject obj, + jobject font, + jfloat x, jfloat y, jint n, + jintArray java_codes, + jfloatArray java_positions) +{ + + struct cairographics2d *gr = NULL; + struct peerfont *pfont = NULL; + cairo_glyph_t *glyphs = NULL; + int *native_codes; + float *native_positions; + jint i = 0; + + g_assert (obj != NULL); + g_assert (java_codes != NULL); + g_assert (java_positions != NULL); + + gr = getPointer (env, obj); + g_assert (gr != NULL); + + pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, font); + g_assert (pfont != NULL); + + install_font_peer(gr->cr, pfont); + + glyphs = g_malloc( sizeof(cairo_glyph_t) * n); + g_assert (glyphs != NULL); + + native_codes = (*env)->GetIntArrayElements (env, java_codes, NULL); + native_positions = (*env)->GetFloatArrayElements (env, java_positions, NULL); + + for (i = 0; i < n; ++i) + { + glyphs[i].index = native_codes[i]; + glyphs[i].x = x + native_positions[ 2*i ]; + glyphs[i].y = y + native_positions[ 2*i + 1]; + } + + (*env)->ReleaseFloatArrayElements (env, java_positions, native_positions, 0); + (*env)->ReleaseIntArrayElements (env, java_codes, native_codes, 0); + + cairo_show_glyphs (gr->cr, glyphs, n); + + g_free(glyphs); +} + + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetOperator + (JNIEnv *env, jobject obj, jint op) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + switch ((enum java_awt_alpha_composite_rule) op) + { + case java_awt_alpha_composite_CLEAR: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_CLEAR); + break; + + case java_awt_alpha_composite_SRC: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_SOURCE); + break; + + case java_awt_alpha_composite_SRC_OVER: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_OVER); + break; + + case java_awt_alpha_composite_DST_OVER: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_DEST_OVER); + break; + + case java_awt_alpha_composite_SRC_IN: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_IN); + break; + + case java_awt_alpha_composite_DST_IN: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_DEST_IN); + break; + + case java_awt_alpha_composite_SRC_OUT: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_OUT); + break; + + case java_awt_alpha_composite_DST_OUT: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_DEST_OUT); + break; + + case java_awt_alpha_composite_DST: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_DEST); + break; + + case java_awt_alpha_composite_SRC_ATOP: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_ATOP); + break; + + case java_awt_alpha_composite_DST_ATOP: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_DEST_ATOP); + break; + + case java_awt_alpha_composite_XOR: + cairo_set_operator (gr->cr, CAIRO_OPERATOR_XOR); + break; + } +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetRGBAColor + (JNIEnv *env, jobject obj, jdouble r, jdouble g, jdouble b, jdouble a) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + cairo_set_source_rgba (gr->cr, r, g, b, a); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetFillRule + (JNIEnv *env, jobject obj, jint rule) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + switch ((enum java_awt_geom_path_iterator_winding_rule) rule) + { + case java_awt_geom_path_iterator_WIND_NON_ZERO: + cairo_set_fill_rule (gr->cr, CAIRO_FILL_RULE_WINDING); + break; + case java_awt_geom_path_iterator_WIND_EVEN_ODD: + cairo_set_fill_rule (gr->cr, CAIRO_FILL_RULE_EVEN_ODD); + break; + } +} + +/** + * Set the line style, except for dashes. + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetLine + (JNIEnv *env, jobject obj, jdouble width, int cap, int join, double miterLimit) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + /* set width */ + cairo_set_line_width (gr->cr, width); + + /* set cap */ + switch ((enum java_awt_basic_stroke_cap_rule) cap) + { + case java_awt_basic_stroke_CAP_BUTT: + cairo_set_line_cap (gr->cr, CAIRO_LINE_CAP_BUTT); + break; + + case java_awt_basic_stroke_CAP_ROUND: + cairo_set_line_cap (gr->cr, CAIRO_LINE_CAP_ROUND); + break; + + case java_awt_basic_stroke_CAP_SQUARE: + cairo_set_line_cap (gr->cr, CAIRO_LINE_CAP_SQUARE); + break; + } + + /* set join */ + switch ((enum java_awt_basic_stroke_join_rule) join) + { + case java_awt_basic_stroke_JOIN_MITER: + cairo_set_line_join (gr->cr, CAIRO_LINE_JOIN_MITER); + break; + + case java_awt_basic_stroke_JOIN_ROUND: + cairo_set_line_join (gr->cr, CAIRO_LINE_JOIN_ROUND); + break; + + case java_awt_basic_stroke_JOIN_BEVEL: + cairo_set_line_join (gr->cr, CAIRO_LINE_JOIN_BEVEL); + break; + } + + /* set miter */ + cairo_set_miter_limit (gr->cr, miterLimit); +} + +/** + * Set the line dashes + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetDash + (JNIEnv *env, jobject obj, jdoubleArray dashes, jint ndash, jdouble offset) +{ + jdouble *dasharr = NULL; + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + dasharr = (*env)->GetDoubleArrayElements (env, dashes, NULL); + g_assert (dasharr != NULL); + + cairo_set_dash (gr->cr, dasharr, ndash, offset); + + (*env)->ReleaseDoubleArrayElements (env, dashes, dasharr, 0); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoNewPath + (JNIEnv *env, jobject obj) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + cairo_new_path (gr->cr); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoMoveTo + (JNIEnv *env, jobject obj, jdouble x, jdouble y) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + cairo_move_to (gr->cr, x, y); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoLineTo + (JNIEnv *env, jobject obj, jdouble x, jdouble y) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + cairo_line_to (gr->cr, x, y); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoCurveTo + (JNIEnv *env, jobject obj, jdouble x1, jdouble y1, jdouble x2, jdouble y2, jdouble x3, jdouble y3) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + cairo_curve_to (gr->cr, x1, y1, x2, y2, x3, y3); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelMoveTo + (JNIEnv *env, jobject obj, jdouble dx, jdouble dy) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + cairo_rel_move_to (gr->cr, dx, dy); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelLineTo + (JNIEnv *env, jobject obj, jdouble dx, jdouble dy) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + cairo_rel_line_to (gr->cr, dx, dy); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRelCurveTo + (JNIEnv *env, jobject obj, jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2, jdouble dx3, jdouble dy3) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + cairo_rel_curve_to (gr->cr, dx1, dy1, dx2, dy2, dx3, dy3); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRectangle + (JNIEnv *env, jobject obj, jdouble x, jdouble y, jdouble width, jdouble height) +{ + struct cairographics2d *gr = getPointer (env, obj); + + cairo_rectangle (gr->cr, x, y, width, height); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoClosePath + (JNIEnv *env, jobject obj) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + cairo_close_path (gr->cr); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoStroke + (JNIEnv *env, jobject obj) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + cairo_stroke (gr->cr); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoFill + (JNIEnv *env, jobject obj) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + cairo_fill (gr->cr); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoClip + (JNIEnv *env, jobject obj) +{ + struct cairographics2d *gr = getPointer( env, obj ); + g_assert( gr != NULL ); + + cairo_clip( gr->cr ); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoResetClip + (JNIEnv *env, jobject obj) +{ + struct cairographics2d *gr = getPointer( env, obj ); + g_assert (gr != NULL); + + cairo_reset_clip( gr->cr ); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoPreserveClip +(JNIEnv *env, jobject obj) +{ + struct cairographics2d *gr = getPointer( env, obj ); + g_assert (gr != NULL); + + cairo_clip_preserve( gr->cr ); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSurfaceSetFilter + (JNIEnv *env, jobject obj, jint filter) +{ + struct cairographics2d *gr = getPointer (env, obj); + g_assert (gr != NULL); + + if (gr->pattern == NULL) + return; + + switch ((enum java_awt_rendering_hints_filter) filter) + { + case java_awt_rendering_hints_VALUE_INTERPOLATION_NEAREST_NEIGHBOR: + cairo_pattern_set_filter (gr->pattern, CAIRO_FILTER_NEAREST); + break; + case java_awt_rendering_hints_VALUE_INTERPOLATION_BILINEAR: + cairo_pattern_set_filter (gr->pattern, CAIRO_FILTER_BILINEAR); + break; + case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_SPEED: + cairo_pattern_set_filter (gr->pattern, CAIRO_FILTER_FAST); + break; + case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_DEFAULT: + cairo_pattern_set_filter (gr->pattern, CAIRO_FILTER_NEAREST); + break; + case java_awt_rendering_hints_VALUE_ALPHA_INTERPOLATION_QUALITY: + cairo_pattern_set_filter (gr->pattern, CAIRO_FILTER_BEST); + break; + } +} + +/************************** FONT STUFF ****************************/ +static void +install_font_peer(cairo_t *cr, + struct peerfont *pfont) +{ + cairo_font_face_t *ft; + FT_Face face = NULL; + + g_assert(cr != NULL); + g_assert(pfont != NULL); + + if (pfont->graphics_resource == NULL) + { + face = pango_ft2_font_get_face (pfont->font); + g_assert (face != NULL); + + ft = cairo_ft_font_face_create_for_ft_face (face, 0); + g_assert (ft != NULL); + + cairo_set_font_face (cr, ft); + cairo_font_face_destroy (ft); + cairo_set_font_size (cr, + (pango_font_description_get_size (pfont->desc) / + (double)PANGO_SCALE)); + ft = cairo_get_font_face (cr); + pfont->graphics_resource = ft; + } + else + { + ft = (cairo_font_face_t *) pfont->graphics_resource; + cairo_set_font_face (cr, ft); + cairo_set_font_size (cr, + (pango_font_description_get_size (pfont->desc) / + (double)PANGO_SCALE)); + } +} + +static void +update_pattern_transform (struct cairographics2d *gr) +{ + cairo_matrix_t mat; + + g_assert (gr != NULL); + if (gr->pattern == NULL) + return; + + cairo_get_matrix (gr->cr, &mat); + cairo_pattern_set_matrix (gr->pattern, &mat); +} + + diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c new file mode 100644 index 00000000000..3518aead590 --- /dev/null +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoSurface.c @@ -0,0 +1,312 @@ +/* gnu_java_awt_peer_gtk_CairoSurface.c + 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. */ + +#include "jcl.h" +#include "gtkpeer.h" +#include <cairo-xlib.h> +#include <gdk/gdkx.h> + +#include "gnu_java_awt_peer_gtk_CairoSurface.h" +#include "cairographics2d.h" + +/** + * Field names in CairoSurface.java + */ +#define SURFACE "surfacePointer" +#define BUFFER "bufferPointer" + +/* prototypes */ +static void *getNativeObject( JNIEnv *env, jobject obj, const char *pointer ); +static void setNativeObject( JNIEnv *env, jobject obj, void *ptr, const char *pointer ); + +/** + * Creates a cairo surface, ARGB32, native ordering, premultiplied alpha. + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoSurface_create (JNIEnv *env, jobject obj, jint width, jint height, jint stride) +{ + cairo_surface_t* surface; + void *data = g_malloc(stride * height * 4); + memset(data, 0, stride * height * 4); + setNativeObject(env, obj, data, BUFFER); + + surface = cairo_image_surface_create_for_data + (data, CAIRO_FORMAT_ARGB32, width, height, stride); + + setNativeObject(env, obj, surface, SURFACE); +} + +/** + * Destroy the surface + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoSurface_destroy (JNIEnv *env, jobject obj) +{ + void *buffer; + cairo_surface_t* surface = (cairo_surface_t *)getNativeObject(env, obj, SURFACE); + if( surface != NULL ) + cairo_surface_destroy(surface); + + buffer = getNativeObject(env, obj, BUFFER); + if( buffer != NULL ) + g_free(buffer); +} + +/** + * Gets a pixel + */ +JNIEXPORT jint JNICALL +Java_gnu_java_awt_peer_gtk_CairoSurface_nativeGetElem (JNIEnv *env, jobject obj, jint i) +{ + jint *pixeldata = (jint *)getNativeObject(env, obj, BUFFER); + + if( pixeldata == NULL ) + return 0; + + return pixeldata[i]; +} + +/** + * Sets a pixel + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoSurface_nativeSetElem +(JNIEnv *env, jobject obj, jint i, jint val) +{ + jint *pixeldata = (jint *)getNativeObject(env, obj, BUFFER); + + if( pixeldata == NULL ) + return; + + pixeldata[i] = val; +} + +/** + * Gets all pixels in an array + */ +JNIEXPORT jintArray JNICALL +Java_gnu_java_awt_peer_gtk_CairoSurface_getPixels +(JNIEnv *env, jobject obj, int size) +{ + jint *pixeldata, *jpixdata; + jintArray jpixels; + + pixeldata = (jint *)getNativeObject(env, obj, BUFFER); + g_assert(pixeldata != NULL); + + jpixels = (*env)->NewIntArray (env, size); + jpixdata = (*env)->GetIntArrayElements (env, jpixels, NULL); + memcpy (jpixdata, pixeldata, size * sizeof( jint )); + + (*env)->ReleaseIntArrayElements (env, jpixels, jpixdata, 0); + return jpixels; +} + +/** + * Sets all pixels by an array. + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoSurface_setPixels +(JNIEnv *env, jobject obj, jintArray jpixels) +{ + jint *pixeldata, *jpixdata; + int size; + int width, height; + jclass cls; + jfieldID field; + + if( jpixels == NULL ) + return; + + cls = (*env)->GetObjectClass (env, obj); + field = (*env)->GetFieldID (env, cls, "width", "I"); + g_assert (field != 0); + width = (*env)->GetIntField (env, obj, field); + + field = (*env)->GetFieldID (env, cls, "height", "I"); + g_assert (field != 0); + height = (*env)->GetIntField (env, obj, field); + + pixeldata = (jint *)getNativeObject(env, obj, BUFFER); + g_assert(pixeldata != NULL); + + jpixdata = (*env)->GetIntArrayElements (env, jpixels, NULL); + size = (*env)->GetArrayLength( env, jpixels ); + if( size > width * height ) size = width * height; /* stop overflows. */ + + memcpy (pixeldata, jpixdata, size * sizeof( jint )); + + (*env)->ReleaseIntArrayElements (env, jpixels, jpixdata, 0); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoSurface_drawSurface + (JNIEnv *env, jobject obj, jobject context, jdoubleArray java_matrix) +{ + cairo_t *cr; + jdouble *native_matrix = NULL; + cairo_surface_t* surface = (cairo_surface_t *)getNativeObject(env, obj, SURFACE); + g_assert(surface != NULL); + + cr = cp_gtk_get_cairo_t(env, context); + g_assert(cr != NULL); + + native_matrix = (*env)->GetDoubleArrayElements (env, java_matrix, NULL); + g_assert (native_matrix != NULL); + g_assert ((*env)->GetArrayLength (env, java_matrix) == 6); + + { + cairo_matrix_t mat; + cairo_pattern_t *p; + cairo_matrix_init_identity (&mat); + cairo_matrix_init (&mat, + native_matrix[0], native_matrix[1], + native_matrix[2], native_matrix[3], + native_matrix[4], native_matrix[5]); + + p = cairo_pattern_create_for_surface (surface); + cairo_pattern_set_matrix (p, &mat); + + cairo_set_source(cr, p); + cairo_paint(cr); + cairo_pattern_destroy(p); + } + + (*env)->ReleaseDoubleArrayElements (env, java_matrix, native_matrix, 0); +} + +JNIEXPORT jlong JNICALL +Java_gnu_java_awt_peer_gtk_CairoSurface_getFlippedBuffer +(JNIEnv *env, jobject obj, jint size) +{ + jint *dst; + jint *src = (jint *)getNativeObject(env, obj, BUFFER); + int i; + int t; + + g_assert( src != NULL ); + dst = g_malloc( size * sizeof( jint ) ); + + for(i = 0; i < size; i++ ) + { + t = (src[i] & 0x0000FF) << 16; + dst[i] = (src[i] & 0x00FF0000) >> 16; + dst[i] |= (src[i] & 0xFF00FF00); + dst[i] |= t; + } + + return PTR_TO_JLONG(dst); +} + +/** + * Create and return a cairo context for drawing to the surface. + */ +JNIEXPORT jlong JNICALL +Java_gnu_java_awt_peer_gtk_CairoSurface_newCairoContext (JNIEnv *env, jobject obj) +{ + cairo_surface_t* surface = (cairo_surface_t *)getNativeObject(env, obj, SURFACE); + cairo_t *ptr; + g_assert(surface != NULL); + ptr = cairo_create(surface); + g_assert(ptr != NULL); + + return PTR_TO_JLONG(ptr); +} + +/** + * copyArea. + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_CairoSurface_copyAreaNative (JNIEnv *env, + jobject obj, + jint x, jint y, + jint w, jint h, + jint dx, jint dy, + jint stride) +{ + int row; + int srcOffset, dstOffset; + jint *temp; + jint *pixeldata = (jint *)getNativeObject(env, obj, BUFFER); + g_assert( pixeldata != NULL ); + + temp = g_malloc( h * w * 4 ); + g_assert( temp != NULL ); + + srcOffset = x + (y * stride); + dstOffset = (x + dx) + ((y + dy) * stride); + + for( row = 0; row < h; row++ ) + memcpy( temp + (w * row), pixeldata + srcOffset + (stride * row), w * 4 ); + + for( row = 0; row < h; row++ ) + memcpy( pixeldata + dstOffset + (stride * row), temp + (w * row), w * 4 ); + + g_free( temp ); +} + +/* + * Sets the native object field. + */ +static void +setNativeObject( JNIEnv *env, jobject obj, void *ptr, const char *pointer ) +{ + jclass cls; + jlong value; + jfieldID nofid; + cls = (*env)->GetObjectClass( env, obj ); + value = PTR_TO_JLONG(ptr); + nofid = (*env)->GetFieldID( env, cls, pointer, "J" ); + (*env)->SetLongField( env, obj, nofid, value ); + (*env)->DeleteLocalRef( env, cls ); +} + +/** + * Gets the native object field. + */ +static void * +getNativeObject( JNIEnv *env, jobject obj, const char *pointer ) +{ + jclass cls; + jlong value; + jfieldID nofid; + cls = (*env)->GetObjectClass( env, obj ); + nofid = (*env)->GetFieldID( env, cls, pointer, "J" ); + value = (*env)->GetLongField( env, obj, nofid ); + (*env)->DeleteLocalRef( env, cls ); + return JLONG_TO_PTR(void, value); +} diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c new file mode 100644 index 00000000000..7e3c83808c8 --- /dev/null +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c @@ -0,0 +1,307 @@ +/* gnu_java_awt_peer_gtk_ComponentGraphics.c + 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. */ + +#include "jcl.h" +#include "gtkpeer.h" +#include <cairo-xlib.h> +#include <gdk/gdktypes.h> +#include <gdk/gdkprivate.h> +#include <gdk/gdkx.h> +#include <X11/extensions/Xrender.h> + +#include <gdk-pixbuf/gdk-pixbuf.h> +#include <gdk-pixbuf/gdk-pixdata.h> + +#include <cairo-ft.h> +#include <cairo-xlib.h> + +#include <stdio.h> +#include <stdlib.h> + +#include "gnu_java_awt_peer_gtk_ComponentGraphics.h" + +#include "cairographics2d.h" + +static short flush_scheduled = 0; + +static gboolean flush (gpointer data __attribute__((unused))) +{ + gdk_threads_enter (); + + XFlush (GDK_DISPLAY ()); + flush_scheduled = 0; + + gdk_threads_leave (); + + return FALSE; +} + +/* The minimum time period between calls to XFlush, in + milliseconds. */ +#define MINIMUM_FLUSH_PERIOD 20 + +/* schedule_flush must be called with the GDK lock held. */ +static void +schedule_flush () +{ + if (!flush_scheduled) + { + g_timeout_add (MINIMUM_FLUSH_PERIOD, flush, NULL); + flush_scheduled = 1; + } +} + +void cp_gtk_grab_current_drawable(GtkWidget *widget, GdkDrawable **draw, + GdkWindow **win) +{ + g_assert (widget != NULL); + g_assert (draw != NULL); + g_assert (win != NULL); + + *win = widget->window; + + *draw = *win; + gdk_window_get_internal_paint_info (*win, draw, 0, 0); +} + +/** + * Returns whether the XRender extension is supported + */ +JNIEXPORT jboolean JNICALL +Java_gnu_java_awt_peer_gtk_ComponentGraphics_hasXRender + (JNIEnv *env __attribute__ ((unused)), jclass cls __attribute__ ((unused))) +{ +#if HAVE_XRENDER + int ev = 0, err = 0; + if( XRenderQueryExtension (GDK_DISPLAY (), &ev, &err) ) + return JNI_TRUE; +#endif + return JNI_FALSE; +} + + +JNIEXPORT jlong JNICALL +Java_gnu_java_awt_peer_gtk_ComponentGraphics_initState + (JNIEnv *env, jobject obj __attribute__ ((unused)), jobject peer) +{ + Drawable draw; + Display * dpy; + Visual * vis; + GdkDrawable *drawable; + cairo_surface_t *surface; + GdkWindow *win; + GtkWidget *widget = NULL; + void *ptr = NULL; + int width, height; + cairo_t *cr; + + gdk_threads_enter(); + + ptr = NSA_GET_PTR (env, peer); + g_assert (ptr != NULL); + + widget = GTK_WIDGET (ptr); + g_assert (widget != NULL); + + cp_gtk_grab_current_drawable (widget, &drawable, &win); + g_assert (drawable != NULL); + + width = widget->allocation.width; + height = widget->allocation.height; + + g_assert (drawable != NULL); + + draw = gdk_x11_drawable_get_xid(drawable); + g_assert (draw != (XID) 0); + + dpy = gdk_x11_drawable_get_xdisplay(drawable); + g_assert (dpy != NULL); + + vis = gdk_x11_visual_get_xvisual(gdk_drawable_get_visual(drawable)); + g_assert (vis != NULL); + + surface = cairo_xlib_surface_create (dpy, draw, vis, width, height); + g_assert (surface != NULL); + + cr = cairo_create (surface); + g_assert(cr != NULL); + + gdk_threads_leave(); + + return PTR_TO_JLONG(cr); +} + +/** + * Disposes of the surface + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_ComponentGraphics_disposeSurface + (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)), + jlong value) +{ + struct cairographics2d *gr; + cairo_surface_t *surface; + + gr = JLONG_TO_PTR(struct cairographics2d, value); + + if (gr == NULL) + return; + + if (gr->cr == NULL) + return; + + surface = cairo_get_target (gr->cr); + if (surface != NULL) + cairo_surface_destroy (surface); +} + +JNIEXPORT jlong JNICALL +Java_gnu_java_awt_peer_gtk_ComponentGraphics_initFromVolatile + (JNIEnv *env __attribute__ ((unused)), jobject obj __attribute__ ((unused)), + jlong ptr, jint width, jint height) +{ + Drawable draw; + Display * dpy; + Visual * vis; + GdkDrawable *drawable; + cairo_surface_t *surface; + cairo_t *cr; + + gdk_threads_enter(); + + drawable = JLONG_TO_PTR(GdkDrawable, ptr); + g_assert (drawable != NULL); + + draw = gdk_x11_drawable_get_xid(drawable); + g_assert (draw != (XID) 0); + + dpy = gdk_x11_drawable_get_xdisplay(drawable); + g_assert (dpy != NULL); + + vis = gdk_x11_visual_get_xvisual(gdk_drawable_get_visual(drawable)); + g_assert (vis != NULL); + + surface = cairo_xlib_surface_create (dpy, draw, vis, width, height); + g_assert (surface != NULL); + + cr = cairo_create (surface); + g_assert(cr != NULL); + + gdk_threads_leave(); + + return PTR_TO_JLONG(cr); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_ComponentGraphics_start_1gdk_1drawing + (JNIEnv *env __attribute__ ((unused)), jobject obj __attribute__ ((unused))) +{ + gdk_threads_enter(); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_ComponentGraphics_end_1gdk_1drawing + (JNIEnv *env __attribute__ ((unused)), jobject obj __attribute__ ((unused))) +{ + schedule_flush (); + gdk_threads_leave(); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_ComponentGraphics_copyAreaNative + (JNIEnv *env, jobject obj __attribute__((unused)), jobject peer, + jint x, jint y, jint w, jint h, jint dx, jint dy) +{ + GdkPixbuf *pixbuf; + GdkDrawable *drawable; + GdkWindow *win; + GtkWidget *widget = NULL; + void *ptr = NULL; + + gdk_threads_enter(); + + ptr = NSA_GET_PTR (env, peer); + g_assert (ptr != NULL); + + widget = GTK_WIDGET (ptr); + g_assert (widget != NULL); + + cp_gtk_grab_current_drawable (widget, &drawable, &win); + g_assert (drawable != NULL); + + pixbuf = gdk_pixbuf_new( GDK_COLORSPACE_RGB, TRUE, 8, w, h ); + gdk_pixbuf_get_from_drawable( pixbuf, drawable, NULL, x, y, 0, 0, w, h ); + gdk_draw_pixbuf (drawable, NULL, pixbuf, + 0, 0, x + dx, y + dy, + w, h, + GDK_RGB_DITHER_NORMAL, 0, 0); + gdk_threads_leave(); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_ComponentGraphics_drawVolatile +(JNIEnv *env, jobject obj __attribute__ ((unused)), jobject peer, + jobject img, jint x, jint y, jint w, jint h) +{ + GdkPixmap *pixmap; + GtkWidget *widget = NULL; + void *ptr = NULL; + GdkGC *gc; + + gdk_threads_enter(); + ptr = NSA_GET_PTR (env, peer); + g_assert (ptr != NULL); + + widget = GTK_WIDGET (ptr); + g_assert (widget != NULL); + + pixmap = cp_gtk_get_pixmap( env, img ); + + gc = gdk_gc_new(widget->window); + gdk_draw_drawable(widget->window, + gc, + pixmap, + 0, 0, + x, y, + w, h); + + g_object_unref( gc ); + + schedule_flush (); + + gdk_threads_leave(); +} diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphicsCopy.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphicsCopy.c new file mode 100644 index 00000000000..76caa5d0c00 --- /dev/null +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphicsCopy.c @@ -0,0 +1,132 @@ +/* gnu_java_awt_peer_gtk_ComponentGraphicsCopy.c + 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. */ + +#include "jcl.h" +#include "gtkpeer.h" +#include <cairo-xlib.h> +#include <gdk/gdktypes.h> +#include <gdk/gdkprivate.h> +#include <gdk/gdkx.h> + +#include <gdk-pixbuf/gdk-pixbuf.h> +#include <gdk-pixbuf/gdk-pixdata.h> + +#include <cairo-ft.h> +#include <cairo-xlib.h> + +#include <stdio.h> +#include <stdlib.h> + +#include "gnu_java_awt_peer_gtk_ComponentGraphicsCopy.h" + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_ComponentGraphicsCopy_getPixbuf + (JNIEnv *env, jobject obj __attribute__((unused)), + jobject peer, jobject image) +{ + gint width, height; + GdkPixbuf *pixbuf; + GdkDrawable *drawable; + GdkWindow *win; + GtkWidget *widget = NULL; + void *ptr = NULL; + + gdk_threads_enter(); + + ptr = NSA_GET_PTR (env, peer); + g_assert (ptr != NULL); + + widget = GTK_WIDGET (ptr); + g_assert (widget != NULL); + + cp_gtk_grab_current_drawable (widget, &drawable, &win); + g_assert (drawable != NULL); + + pixbuf = cp_gtk_image_get_pixbuf( env, image ); + g_assert( pixbuf != NULL); + + width = gdk_pixbuf_get_width( pixbuf ); + height = gdk_pixbuf_get_height( pixbuf ); + + gdk_pixbuf_get_from_drawable( pixbuf, /* destination pixbuf */ + drawable, + NULL, /* colormap */ + 0, 0, 0, 0, + width, height ); + gdk_threads_leave(); +} + + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_ComponentGraphicsCopy_copyPixbuf + (JNIEnv *env, jobject obj __attribute__((unused)), + jobject peer, jobject image, + int x __attribute__((unused)), int y __attribute__((unused)), + int width __attribute__((unused)), int height __attribute__((unused))) +{ + gint pwidth, pheight; + GdkPixbuf *pixbuf; + GdkDrawable *drawable; + GdkWindow *win; + GtkWidget *widget = NULL; + void *ptr = NULL; + + gdk_threads_enter(); + + ptr = NSA_GET_PTR (env, peer); + g_assert (ptr != NULL); + + widget = GTK_WIDGET (ptr); + g_assert (widget != NULL); + + cp_gtk_grab_current_drawable (widget, &drawable, &win); + g_assert (drawable != NULL); + + pixbuf = cp_gtk_image_get_pixbuf( env, image ); + g_assert( pixbuf != NULL); + + pwidth = gdk_pixbuf_get_width( pixbuf ); + pheight = gdk_pixbuf_get_height( pixbuf ); + + gdk_draw_pixbuf (drawable, NULL, pixbuf, + 0, 0, 0, 0, + pwidth, pheight, + GDK_RGB_DITHER_NORMAL, 0, 0); + + gdk_threads_leave(); +} + diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c new file mode 100644 index 00000000000..42abd983c7a --- /dev/null +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c @@ -0,0 +1,335 @@ +/* gnu_java_awt_FreetypeGlyphVector.c + 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. */ + +#include <jni.h> +#include <gtk/gtk.h> +#include <string.h> +#include <pango/pango.h> +#include <pango/pangoft2.h> +#include <pango/pangofc-font.h> +#include <freetype/ftglyph.h> +#include <freetype/ftoutln.h> +#include "native_state.h" +#include "gdkfont.h" +#include "gnu_java_awt_peer_gtk_FreetypeGlyphVector.h" +#include "cairographics2d.h" + +typedef struct gp +{ + JNIEnv *env; + jobject obj; + double px; + double py; + double sx; + double sy; +} generalpath ; + +static PangoFcFont * +getFont(JNIEnv *env, jobject obj) +{ + jfieldID fid; + jobject data; + jclass cls; + struct peerfont *pfont; + + cls = (*env)->GetObjectClass (env, obj); + fid = (*env)->GetFieldID (env, cls, "peer", + "Lgnu/java/awt/peer/gtk/GdkFontPeer;"); + g_assert (fid != 0); + + data = (*env)->GetObjectField (env, obj, fid); + g_assert (data != NULL); + + pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, data); + g_assert (pfont != NULL); + g_assert (pfont->font != NULL); + + return (PangoFcFont *)pfont->font; +} + +JNIEXPORT jint JNICALL +Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyph + (JNIEnv *env, jobject obj, jint codepoint) +{ + FT_Face ft_face; + jint glyph_index; + PangoFcFont *font; + + font = getFont(env, obj); + + ft_face = pango_fc_font_lock_face( font ); + g_assert (ft_face != NULL); + + glyph_index = FT_Get_Char_Index( ft_face, codepoint ); + + pango_fc_font_unlock_face (font); + + return glyph_index; +} + +JNIEXPORT jobject JNICALL +Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getKerning +(JNIEnv *env, jobject obj, jint rightGlyph, jint leftGlyph) +{ + FT_Face ft_face; + FT_Vector kern; + jclass cls; + jmethodID method; + jvalue values[2]; + PangoFcFont *font; + + font = getFont(env, obj); + ft_face = pango_fc_font_lock_face( font ); + g_assert (ft_face != NULL); + FT_Get_Kerning( ft_face, rightGlyph, leftGlyph, FT_KERNING_DEFAULT, &kern ); + + pango_fc_font_unlock_face( font ); + + values[0].d = (jdouble)kern.x/64.0; + values[1].d = (jdouble)kern.y/64.0; + + cls = (*env)->FindClass (env, "java/awt/geom/Point2D$Double"); + method = (*env)->GetMethodID (env, cls, "<init>", "(DD)V"); + return (*env)->NewObjectA(env, cls, method, values); +} + +JNIEXPORT jdoubleArray JNICALL +Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getMetricsNative +(JNIEnv *env, jobject obj, jint glyphIndex ) +{ + FT_Face ft_face; + jdouble *values; + jdoubleArray retArray = NULL; + PangoFcFont *font; + + font = getFont(env, obj); + ft_face = pango_fc_font_lock_face( font ); + + g_assert (ft_face != NULL); + + FT_Set_Transform( ft_face, NULL, NULL ); + + if( FT_Load_Glyph( ft_face, glyphIndex, FT_LOAD_DEFAULT ) != 0 ) + { + pango_fc_font_unlock_face( font ); + printf("Couldn't load glyph %i\n", glyphIndex); + return NULL; + } + + retArray = (*env)->NewDoubleArray (env, 8); + values = (*env)->GetDoubleArrayElements (env, retArray, NULL); + + values[0] = 0; + values[1] = (jdouble)ft_face->glyph->advance.x/64.0; + values[2] = (jdouble)ft_face->glyph->advance.y/64.0; + values[3] = (jdouble)ft_face->glyph->metrics.horiBearingX/64.0; + values[4] = -(jdouble)ft_face->glyph->metrics.horiBearingY/64.0; + values[5] = (jdouble)ft_face->glyph->metrics.width/64.0; + values[6] = (jdouble)ft_face->glyph->metrics.height/64.0; + values[7] = 0; + + (*env)->ReleaseDoubleArrayElements (env, retArray, values, 0); + pango_fc_font_unlock_face( font ); + + return retArray; +} + +/* GetOutline code follows ****************************/ +/********* Freetype callback functions *****************************/ + +static int _moveTo( const FT_Vector* to, + void *p) +{ + JNIEnv *env; + jobject obj; + jclass cls; + jmethodID method; + jvalue values[2]; + generalpath *path = (generalpath *) p; + + env = path->env; + obj = path->obj; + + values[0].f = (jfloat)(to->x * path->sx + path->px); + values[1].f = (jfloat)(to->y * path->sy + path->py); + + cls = (*env)->FindClass (env, "java/awt/geom/GeneralPath"); + method = (*env)->GetMethodID (env, cls, "moveTo", "(FF)V"); + (*env)->CallVoidMethodA(env, obj, method, values ); + + return 0; +} + +static int _lineTo( const FT_Vector* to, + void *p) +{ + JNIEnv *env; + jobject obj; + jclass cls; + jmethodID method; + jvalue values[2]; + generalpath *path = (generalpath *) p; + + env = path->env; + obj = path->obj; + values[0].f = (jfloat)(to->x * path->sx + path->px); + values[1].f = (jfloat)(to->y * path->sy + path->py); + + cls = (*env)->FindClass (env, "java/awt/geom/GeneralPath"); + method = (*env)->GetMethodID (env, cls, "lineTo", "(FF)V"); + (*env)->CallVoidMethodA(env, obj, method, values ); + + return 0; +} + +static int _quadTo( const FT_Vector* cp, + const FT_Vector* to, + void *p) +{ + JNIEnv *env; + jobject obj; + jclass cls; + jmethodID method; + jvalue values[4]; + generalpath *path = (generalpath *) p; + + env = path->env; + obj = path->obj; + values[0].f = (jfloat)(cp->x * path->sx + path->px); + values[1].f = (jfloat)(cp->y * path->sy + path->py); + values[2].f = (jfloat)(to->x * path->sx + path->px); + values[3].f = (jfloat)(to->y * path->sy + path->py); + + cls = (*env)->FindClass (env, "java/awt/geom/GeneralPath"); + method = (*env)->GetMethodID (env, cls, "quadTo", "(FFFF)V"); + (*env)->CallVoidMethodA(env, obj, method, values ); + + return 0; +} + +static int _curveTo( const FT_Vector* cp1, + const FT_Vector* cp2, + const FT_Vector* to, + void *p) +{ + JNIEnv *env; + jobject obj; + jclass cls; + jmethodID method; + jvalue values[6]; + generalpath *path = (generalpath *) p; + + env = path->env; + obj = path->obj; + values[0].f = (jfloat)(cp1->x * path->sx + path->px); + values[1].f = (jfloat)(cp1->y * path->sy + path->py); + values[2].f = (jfloat)(cp2->x * path->sx + path->px); + values[3].f = (jfloat)(cp2->y * path->sy + path->py); + values[4].f = (jfloat)(to->x * path->sx + path->px); + values[5].f = (jfloat)(to->y * path->sy + path->py); + + cls = (*env)->FindClass (env, "java/awt/geom/GeneralPath"); + method = (*env)->GetMethodID (env, cls, "curveTo", "(FFFFFF)V"); + (*env)->CallVoidMethodA(env, obj, method, values ); + + return 0; +} + + +JNIEXPORT jobject JNICALL +Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphOutlineNative + (JNIEnv *env, jobject obj, jint glyphIndex) +{ + generalpath *path; + jobject gp; + FT_Outline_Funcs ftCallbacks = + { + (FT_Outline_MoveToFunc) _moveTo, + (FT_Outline_LineToFunc) _lineTo, + (FT_Outline_ConicToFunc) _quadTo, + (FT_Outline_CubicToFunc) _curveTo, + 0, + 0 + }; + PangoFcFont *font; + FT_Face ft_face; + FT_Glyph glyph; + + font = getFont(env, obj); + ft_face = pango_fc_font_lock_face( font ); + + g_assert (ft_face != NULL); + + path = g_malloc0 (sizeof (generalpath)); + g_assert(path != NULL); + path->env = env; + + path->px = path->py = 0.0; + path->sx = 1.0/64.0; + path->sy = -1.0/64.0; + + { /* create a GeneralPath instance */ + jclass cls; + jmethodID method; + + cls = (*env)->FindClass (env, "java/awt/geom/GeneralPath"); + method = (*env)->GetMethodID (env, cls, "<init>", "()V"); + gp = path->obj = (*env)->NewObject (env, cls, method); + } + + if(FT_Load_Glyph(ft_face, + (FT_UInt)(glyphIndex), + FT_LOAD_DEFAULT | FT_LOAD_NO_BITMAP) != 0) + { + pango_fc_font_unlock_face( font ); + g_free(path); + return NULL; + } + + FT_Get_Glyph( ft_face->glyph, &glyph ); + FT_Outline_Decompose (&(((FT_OutlineGlyph)glyph)->outline), + &ftCallbacks, path); + FT_Done_Glyph( glyph ); + + pango_fc_font_unlock_face( font ); + + g_free(path); + + return gp; +} + + diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c index 0726fb531bb..ddaece1b278 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c @@ -35,6 +35,13 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +#include <pango/pango.h> +#include <pango/pangoft2.h> +#include <pango/pangofc-font.h> +#include <freetype/ftglyph.h> +#include <freetype/ftoutln.h> +#include <freetype/fttypes.h> +#include <freetype/tttables.h> #include "gdkfont.h" #include "gnu_java_awt_peer_gtk_GdkFontPeer.h" @@ -52,25 +59,11 @@ enum java_awt_font_baseline { java_awt_font_HANGING_BASELINE = 2 }; -static jmethodID glyphVector_ctor; -static jclass glyphVector_class; -static PangoAttrList *attrs = NULL; - JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_initStaticState (JNIEnv *env, jclass clazz) { NSA_FONT_INIT (env, clazz); - - glyphVector_class = (*env)->FindClass - (env, "gnu/java/awt/peer/gtk/GdkGlyphVector"); - - glyphVector_class = (*env)->NewGlobalRef - (env, glyphVector_class); - - glyphVector_ctor = (*env)->GetMethodID - (env, glyphVector_class, "<init>", - "([D[ILjava/awt/Font;Ljava/awt/font/FontRenderContext;)V"); } JNIEXPORT void JNICALL @@ -114,124 +107,26 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_dispose } -JNIEXPORT jobject JNICALL -Java_gnu_java_awt_peer_gtk_GdkFontPeer_getGlyphVector - (JNIEnv *env, jobject self, - jstring chars, - jobject font, - jobject fontRenderContext) +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GdkFontPeer_releasePeerGraphicsResource + (JNIEnv *env, jobject java_font) { struct peerfont *pfont = NULL; - GList *items = NULL; - GList *i = NULL; - gchar *str = NULL; - int len = 0; - int j = 0; - double *native_extents = NULL; - int *native_codes = NULL; - jintArray java_codes = NULL; - jdoubleArray java_extents = NULL; - gdk_threads_enter (); + gdk_threads_enter(); - pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, self); + pfont = (struct peerfont *) NSA_GET_FONT_PTR (env, java_font); g_assert (pfont != NULL); - - len = (*cp_gtk_gdk_env())->GetStringUTFLength (env, chars); - str = (gchar *)(*env)->GetStringUTFChars (env, chars, NULL); - g_assert (str != NULL); - - if (attrs == NULL) - attrs = pango_attr_list_new (); - - if (len > 0 && str[len-1] == '\0') - len--; - - items = pango_itemize (pfont->ctx, str, 0, len, attrs, NULL); - - i = g_list_first (items); - - if (i == NULL) + if (pfont->graphics_resource != NULL) { - java_extents = (*env)->NewDoubleArray (env, 0); - java_codes = (*env)->NewIntArray (env, 0); - } - else - { - PangoGlyphString *glyphs; - PangoItem *item = (PangoItem *)i->data; - - pango_context_set_font_description (pfont->ctx, pfont->desc); - pango_context_set_language (pfont->ctx, gtk_get_default_language()); - pango_context_load_font (pfont->ctx, pfont->desc); - - glyphs = pango_glyph_string_new (); - g_assert (glyphs != NULL); - - pango_shape (str + item->offset, item->length, - &(item->analysis), glyphs); - - if (glyphs->num_glyphs > 0) - { - int x = 0; - double scale = ((double) PANGO_SCALE); - - java_extents = (*env)->NewDoubleArray (env, glyphs->num_glyphs * NUM_GLYPH_METRICS); - java_codes = (*env)->NewIntArray (env, glyphs->num_glyphs); - - native_extents = (*env)->GetDoubleArrayElements (env, java_extents, NULL); - native_codes = (*env)->GetIntArrayElements (env, java_codes, NULL); - - for (j = 0; j < glyphs->num_glyphs; ++j) - { - PangoRectangle ink; - PangoRectangle logical; - PangoGlyphGeometry *geom = &glyphs->glyphs[j].geometry; - - pango_font_get_glyph_extents (pfont->font, - glyphs->glyphs[j].glyph, - &ink, &logical); - - native_codes[j] = glyphs->glyphs[j].glyph; - - native_extents[ GLYPH_LOG_X(j) ] = (logical.x) / scale; - native_extents[ GLYPH_LOG_Y(j) ] = (- logical.y) / scale; - native_extents[ GLYPH_LOG_WIDTH(j) ] = (logical.width) / scale; - native_extents[ GLYPH_LOG_HEIGHT(j) ] = (logical.height) / scale; - - native_extents[ GLYPH_INK_X(j) ] = (ink.x) / scale; - native_extents[ GLYPH_INK_Y(j) ] = (- ink.y) / scale; - native_extents[ GLYPH_INK_WIDTH(j) ] = (ink.width) / scale; - native_extents[ GLYPH_INK_HEIGHT(j) ] = (ink.height) / scale; - - native_extents[ GLYPH_POS_X(j) ] = (x + geom->x_offset) / scale; - native_extents[ GLYPH_POS_Y(j) ] = ( - geom->y_offset) / scale; - - x += geom->width; - } - (*env)->ReleaseDoubleArrayElements (env, java_extents, native_extents, 0); - (*env)->ReleaseIntArrayElements (env, java_codes, native_codes, 0); - } - - pango_glyph_string_free (glyphs); + cairo_font_face_destroy ((cairo_font_face_t *) pfont->graphics_resource); + pfont->graphics_resource = NULL; } - (*env)->ReleaseStringUTFChars (env, chars, str); - - for (i = g_list_first (items); i != NULL; i = g_list_next (i)) - pango_item_free(i->data); - - g_list_free (items); - - gdk_threads_leave (); - - return (*env)->NewObject (env, - glyphVector_class, - glyphVector_ctor, - java_extents, java_codes, - font, fontRenderContext); + gdk_threads_leave(); } + JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_getFontMetrics (JNIEnv *env, jobject java_font, jdoubleArray java_metrics) @@ -389,7 +284,7 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont - (JNIEnv *env, jobject self, jstring family_name_str, jint style_int, jint size, jboolean useGraphics2D) + (JNIEnv *env, jobject self, jstring family_name_str, jint style_int, jint size) { struct peerfont *pfont = NULL; char const *family_name = NULL; @@ -426,22 +321,11 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont if (style & java_awt_font_ITALIC) pango_font_description_set_style (pfont->desc, PANGO_STYLE_ITALIC); - if (useGraphics2D) + pango_font_description_set_size (pfont->desc, size * PANGO_SCALE); + if (pfont->ctx == NULL) { - pango_font_description_set_size (pfont->desc, size * PANGO_SCALE); - if (pfont->ctx == NULL) - { - ft2_map = PANGO_FT2_FONT_MAP(pango_ft2_font_map_for_display ()); - pfont->ctx = pango_ft2_font_map_create_context (ft2_map); - } - } - else - { - /* GDK uses a slightly different DPI setting. */ - pango_font_description_set_size (pfont->desc, - size * cp_gtk_dpi_conversion_factor); - if (pfont->ctx == NULL) - pfont->ctx = gdk_pango_context_get(); + ft2_map = PANGO_FT2_FONT_MAP(pango_ft2_font_map_for_display ()); + pfont->ctx = pango_ft2_font_map_create_context (ft2_map); } g_assert (pfont->ctx != NULL); @@ -465,3 +349,64 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont } +JNIEXPORT jbyteArray JNICALL +Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTrueTypeTable + (JNIEnv *env, jobject self, jbyte n, jbyte a, jbyte m, jbyte e) +{ + struct peerfont *pfont = NULL; + FT_Face face; + FT_ULong length = 0; + FT_ULong tag; + int error; + FT_Byte *buffer; + jbyteArray result_array; + jbyte *rbuf; + + pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, self); + if(pfont == NULL) + return NULL; + + gdk_threads_enter (); + face = pango_fc_font_lock_face ((PangoFcFont *)pfont->font); + tag = FT_MAKE_TAG( n, a, m, e ); + + /* Get the length of the table requested */ + error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); + if ( error ) + { + pango_fc_font_unlock_face ((PangoFcFont *)pfont->font); + gdk_threads_leave (); + return NULL; + } + + buffer = (FT_Byte *)g_malloc0( length ); + if ( buffer == NULL ) + { + pango_fc_font_unlock_face ((PangoFcFont *)pfont->font); + gdk_threads_leave (); + return NULL; + } + /* get the table data */ + error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length ); + if ( error ) + { + pango_fc_font_unlock_face ((PangoFcFont *)pfont->font); + g_free(buffer); + gdk_threads_leave (); + return NULL; + } + + /* copy to a jbytearray */ + result_array = (*env)->NewByteArray (env, length); + + rbuf = (*env)->GetByteArrayElements (env, result_array, NULL); + memcpy(rbuf, buffer, length); + (*env)->ReleaseByteArrayElements (env, result_array, rbuf, 0); + + g_free(buffer); + pango_fc_font_unlock_face ((PangoFcFont *)pfont->font); + gdk_threads_leave (); + + /* done */ + return result_array; +} diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c index 7662800f000..89adcd1e525 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c @@ -1,5 +1,5 @@ /* gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,9 +35,43 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +#include <glib.h> +#include <gdk/gdk.h> + #include "gdkfont.h" +#include "gdkdisplay.h" #include "gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h" +struct state_table *cp_gtk_native_display_state_table; + +jclass gdkGraphicsEnvironment_class; + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_initStaticState +(JNIEnv *env, jclass klazz __attribute__((unused))) +{ + gdkGraphicsEnvironment_class = (*env)->NewGlobalRef + (env, klazz); + + NSA_DISPLAY_INIT(env, gdkGraphicsEnvironment_class); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeInitState +(JNIEnv *env, jobject obj) +{ + GdkDisplay *defaultDisplay; + + gdk_threads_enter(); + + /* Retrieve the default display. */ + defaultDisplay = gdk_display_get_default(); + + gdk_threads_leave(); + + /* Store display pointer in GdkGraphicsEnvironment instance. */ + NSA_SET_DISPLAY_PTR(env, obj, (void *) defaultDisplay); +} static gint cmp_families (const void *a, const void *b) @@ -101,3 +135,109 @@ Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeGetNumFontFamilies return num; } + +JNIEXPORT jobjectArray JNICALL +Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeGetScreenDevices +(JNIEnv *env, jobject obj) +{ + jmethodID gdkScreenGraphicsDevice_ctor, gdkScreenGraphicsDevice_init; + jclass gdkScreenGraphicsDevice_class; + int numScreens = 0, i = 0; + GdkDisplay *display; + jobjectArray array; + jobject instance; + + gdkScreenGraphicsDevice_class = (*env)->FindClass + (env, "gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice"); + + gdkScreenGraphicsDevice_ctor = (*env)->GetMethodID + (env, gdkScreenGraphicsDevice_class, "<init>", + "(Lgnu/java/awt/peer/gtk/GdkGraphicsEnvironment;)V"); + + gdkScreenGraphicsDevice_init = (*env)->GetMethodID + (env, gdkScreenGraphicsDevice_class, "init", "()V"); + + display = (GdkDisplay *) NSA_GET_DISPLAY_PTR(env, obj); + + gdk_threads_enter(); + + numScreens = gdk_display_get_n_screens(display); + + + /* Create a suitably sized array. */ + array = (*env)->NewObjectArray(env, + numScreens, + gdkScreenGraphicsDevice_class, + NULL); + + /* Create GdkScreenGraphicsDevice instances, store the native pointer to + * the GScreen object with them, run a 2nd initialization phase and + * put the new instance into the result array. + */ + for ( ; i < numScreens ; i++) + { + instance = (*env)->NewObject (env, + gdkScreenGraphicsDevice_class, + gdkScreenGraphicsDevice_ctor, + obj); + + NSA_SET_SCREEN_PTR(env, + instance, + gdk_display_get_screen(display, i)); + + gdk_threads_leave(); + (*env)->CallVoidMethod(env, + instance, + gdkScreenGraphicsDevice_init); + gdk_threads_enter(); + + (*env)->SetObjectArrayElement(env, array, i, instance); + } + + gdk_threads_leave(); + + return array; +} + +JNIEXPORT jobject JNICALL +Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeGetDefaultScreenDevice +(JNIEnv *env, jobject obj) +{ + jclass gdkScreenGraphicsDevice_class; + jmethodID gdkScreenGraphicsDevice_ctor, gdkScreenGraphicsDevice_init; + jobject defaultDevice; + GdkScreen *defaultScreen; + + gdkScreenGraphicsDevice_class = (*env)->FindClass + (env, "gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice"); + + gdkScreenGraphicsDevice_ctor = (*env)->GetMethodID + (env, gdkScreenGraphicsDevice_class, "<init>", + "(Lgnu/java/awt/peer/gtk/GdkGraphicsEnvironment;)V"); + + gdkScreenGraphicsDevice_init = (*env)->GetMethodID + (env, gdkScreenGraphicsDevice_class, "init", "()V"); + + /* Create the GdkScreenGraphicsDevice instance. */ + defaultDevice = (*env)->NewObject (env, + gdkScreenGraphicsDevice_class, + gdkScreenGraphicsDevice_ctor, + obj); + + gdk_threads_enter(); + + defaultScreen = gdk_screen_get_default(); + + gdk_threads_leave(); + + /* Class initialization will have set up the native_state storage + * mechanism for GdkScreenGraphicsDevice. + */ + NSA_SET_SCREEN_PTR(env, defaultDevice, defaultScreen); + + (*env)->CallVoidMethod(env, + defaultDevice, + gdkScreenGraphicsDevice_init); + + return defaultDevice; +} diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c new file mode 100644 index 00000000000..965fb5a2342 --- /dev/null +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c @@ -0,0 +1,354 @@ +/* gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c + 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. */ + +#include <jcl.h> + +#include <gdk/gdk.h> +#include <gdk/gdkx.h> + +#ifdef HAVE_XRANDR +#include <X11/Xlib.h> +#include <X11/extensions/Xrandr.h> +#endif + +#include "gdkdisplay.h" + +#include "gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.h" + +struct state_table *cp_gtk_native_screen_state_table; + +jclass gdkScreenGraphicsDevice_class; + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_initStaticState +(JNIEnv *env, jclass klazz) +{ + gdkScreenGraphicsDevice_class = (*env)->NewGlobalRef + (env, klazz); + + NSA_SCREEN_INIT(env, gdkScreenGraphicsDevice_class); +} + +JNIEXPORT jobject JNICALL +Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetFixedDisplayMode +(JNIEnv *env, jobject obj, jobject gdkGraphicsEnv __attribute__((unused))) +{ + jclass displayMode_class; + jmethodID displayMode_ctor; + GdkScreen *screen; + jobject fixedDisplayMode = NULL; +#ifdef HAVE_XRANDR + int temp1, temp2; + GdkDisplay *display; + + display = (GdkDisplay *) NSA_GET_DISPLAY_PTR(env, gdkGraphicsEnv); + + gdk_threads_enter(); + + if (!XRRQueryExtension(GDK_DISPLAY_XDISPLAY(display), &temp1, &temp2)) + { + displayMode_class = (*env)->FindClass(env, "java/awt/DisplayMode"); + displayMode_ctor = (*env)->GetMethodID(env, + displayMode_class, + "<init>", + "(IIII)V"); + + screen = (GdkScreen *) NSA_GET_SCREEN_PTR(env, obj); + + fixedDisplayMode = (*env)->NewObject(env, + displayMode_class, + displayMode_ctor, + gdk_screen_get_width(screen), + gdk_screen_get_height(screen), + -1, + 0); + } + + gdk_threads_leave(); + +#else + + displayMode_class = (*env)->FindClass(env, "java/awt/DisplayMode"); + displayMode_ctor = (*env)->GetMethodID(env, + displayMode_class, + "<init>", + "(IIII)V"); + + screen = (GdkScreen *) NSA_GET_SCREEN_PTR(env, obj); + + fixedDisplayMode = (*env)->NewObject(env, + displayMode_class, + displayMode_ctor, + gdk_screen_get_width(screen), + gdk_screen_get_height(screen), + -1, + 0); + +#endif + return fixedDisplayMode; +} + +JNIEXPORT jstring JNICALL +Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetIDString +(JNIEnv *env, jobject obj) +{ + GdkScreen *screen; + gchar* displayName; + jstring string; + + screen = (GdkScreen *) NSA_GET_SCREEN_PTR(env, obj); + + gdk_threads_enter(); + + displayName = gdk_screen_make_display_name(screen); + + gdk_threads_leave(); + + string = (*env)->NewStringUTF(env, displayName); + + g_free(displayName); + + return string; +} + +JNIEXPORT jint JNICALL +Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetDisplayModeRate +(JNIEnv *env, jobject obj __attribute__((unused)), jobject gdkGraphicsEnv __attribute__((unused))) +{ +#ifdef HAVE_XRANDR + + GdkDisplay *display; + XRRScreenConfiguration *config; + int rate; + + display = (GdkDisplay *) NSA_GET_DISPLAY_PTR(env, gdkGraphicsEnv); + + gdk_threads_enter(); + + config = XRRGetScreenInfo (GDK_DISPLAY_XDISPLAY(display), GDK_ROOT_WINDOW()); + + rate = (int) XRRConfigCurrentRate (config); + + XRRFreeScreenConfigInfo (config); + + gdk_threads_leave(); + + return rate; +#else + JCL_ThrowException(env, + "java/lang/InternalError", + "Method should not have been invoked."); + + return -1; +#endif +} + +JNIEXPORT jint JNICALL +Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetDisplayModeIndex +(JNIEnv *env, jobject obj __attribute__((unused)), jobject gdkGraphicsEnv __attribute__((unused))) +{ +#ifdef HAVE_XRANDR + + GdkDisplay *display; + XRRScreenConfiguration *config; + SizeID index; + Rotation rotation; + + display = (GdkDisplay *) NSA_GET_DISPLAY_PTR(env, gdkGraphicsEnv); + + gdk_threads_enter(); + + config = XRRGetScreenInfo (GDK_DISPLAY_XDISPLAY(display), GDK_ROOT_WINDOW()); + + index = XRRConfigCurrentConfiguration (config, &rotation); + + XRRFreeScreenConfigInfo (config); + + gdk_threads_leave(); + + return (int) index; + +#else + + JCL_ThrowException(env, + "java/lang/InternalError", + "Method should not have been invoked."); + + return -1; + +#endif +} + +JNIEXPORT jobjectArray JNICALL +Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetDisplayModes +(JNIEnv *env, jobject obj __attribute__((unused)), jobject gdkGraphicsEnv __attribute__((unused))) +{ +#ifdef HAVE_XRANDR + GdkDisplay *display; + XRRScreenConfiguration *config; + XRRScreenSize *screenSizes; + int nsizes = 0, nrates = 0, i = 0; + jclass x11DisplayMode_class; + jmethodID x11DisplayMode_ctor; + jobjectArray array; + jobject instance; + short *rates; + jshortArray shortArray; + + display = (GdkDisplay *) NSA_GET_DISPLAY_PTR(env, gdkGraphicsEnv); + + gdk_threads_enter(); + + config = XRRGetScreenInfo (GDK_DISPLAY_XDISPLAY(display), GDK_ROOT_WINDOW()); + + screenSizes = XRRConfigSizes(config, &nsizes); + + x11DisplayMode_class = (*env)->FindClass(env, "gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice$X11DisplayMode"); + + x11DisplayMode_ctor = (*env)->GetMethodID(env, x11DisplayMode_class, "<init>", "(II[S)V"); + + array = (*env)->NewObjectArray(env, nsizes, x11DisplayMode_class, NULL); + + for (; i < nsizes ; i++) + { + /* Retrieves refresh rate information. */ + rates = XRRConfigRates(config, i, &nrates); + + /* Create a Java int array and put them in. */ + shortArray = (*env)->NewIntArray(env, nrates); + (*env)->SetShortArrayRegion(env, shortArray, 0, nrates, (jshort *) rates); + + /* Create a GdkScreenGraphicsDevice.X11DisplayMode instance. */ + instance = (*env)->NewObject(env, + x11DisplayMode_class, + x11DisplayMode_ctor, + screenSizes[i].width, + screenSizes[i].height, + shortArray); + + /* Put it into the result array. */ + (*env)->SetObjectArrayElement(env, array, i, instance); + } + + /* Free everything acquired by xlib. */ + XRRFreeScreenConfigInfo (config); + + gdk_threads_leave(); + + return array; +#else + JCL_ThrowException(env, + "java/lang/InternalError", + "Method should not have been invoked."); + + return NULL; + +#endif +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeSetDisplayMode +(JNIEnv *env, jobject obj __attribute__((unused)), jobject gdkGraphicsEnv __attribute__((unused)), jint index __attribute__((unused)), jshort rate __attribute__((unused))) +{ +#ifdef HAVE_XRANDR + GdkDisplay *display; + XRRScreenConfiguration *config; + Rotation rotation; + + display = (GdkDisplay *) NSA_GET_DISPLAY_PTR(env, gdkGraphicsEnv); + + gdk_threads_enter(); + + config = XRRGetScreenInfo (GDK_DISPLAY_XDISPLAY(display), GDK_ROOT_WINDOW()); + + /* The rotation is not exposed to the Java API. So we retrieve its current + * value and set it to the same when switching resolution. + */ + XRRConfigCurrentConfiguration (config, &rotation); + + XRRSetScreenConfigAndRate (GDK_DISPLAY_XDISPLAY(display), + config, + GDK_ROOT_WINDOW(), + index, + rotation, + rate, + CurrentTime); + + XRRFreeScreenConfigInfo(config); + + gdk_threads_leave(); + +#else + JCL_ThrowException(env, + "java/lang/InternalError", + "Method should not have been invoked."); +#endif +} + +JNIEXPORT jobject JNICALL +Java_gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice_nativeGetBounds +(JNIEnv *env, jobject obj) +{ + jclass rectangle_class; + jmethodID rectangle_ctor; + GdkScreen *screen; + GdkWindow *window; + int x, y, w, h; + jobject instance; + + rectangle_class = (*env)->FindClass(env, "java/awt/Rectangle"); + + rectangle_ctor = (*env)->GetMethodID + (env, rectangle_class, "<init>", "(IIII)V"); + + screen = (GdkScreen *) NSA_GET_SCREEN_PTR(env, obj); + + gdk_threads_enter(); + + window = gdk_screen_get_root_window(screen); + + gdk_window_get_geometry(window, &x, &y, &w, &h, NULL); + + gdk_threads_leave(); + + instance = (*env)->NewObject(env, + rectangle_class, + rectangle_ctor, + x, y, w, h); + + return instance; +} diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c index edce3917d68..92f2d37ca42 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c @@ -1,5 +1,5 @@ /* gnu_java_awt_GdkTextLayout.c - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,6 +47,7 @@ #include "native_state.h" #include "gdkfont.h" #include "gnu_java_awt_peer_gtk_GdkTextLayout.h" +#include "cairographics2d.h" struct state_table *cp_gtk_native_text_layout_state_table; @@ -60,6 +61,9 @@ typedef struct gp double sy; } generalpath ; +static void paint_glyph_run(cairo_t *cr, cairo_glyph_t **glyphs, + gint *n_glyphs, PangoLayoutRun *run); + JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_initStaticState (JNIEnv *env, jclass clazz) @@ -93,8 +97,6 @@ Java_gnu_java_awt_peer_gtk_GdkTextLayout_setText gchar *str = NULL; gint len = 0; - gdk_threads_enter (); - g_assert(self != NULL); g_assert(text != NULL); @@ -106,13 +108,37 @@ Java_gnu_java_awt_peer_gtk_GdkTextLayout_setText str = (gchar *)(*env)->GetStringUTFChars (env, text, NULL); g_assert (str != NULL); - pango_layout_set_text (tl->pango_layout, text, len); + gdk_threads_enter (); + + pango_layout_set_text (tl->pango_layout, str, len); (*env)->ReleaseStringUTFChars (env, text, str); gdk_threads_leave (); } +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GdkTextLayout_setFont (JNIEnv *env, jobject obj, jobject font) +{ + struct textlayout *tl; + struct peerfont *pf; + + g_assert(obj != NULL); + g_assert(font != NULL); + + tl = (struct textlayout *)NSA_GET_TEXT_LAYOUT_PTR (env, obj); + g_assert(tl != NULL); + g_assert(tl->pango_layout != NULL); + pf = (struct peerfont *)NSA_GET_FONT_PTR (env, font); + g_assert(pf != NULL); + + gdk_threads_enter (); + + pango_layout_set_font_description(tl->pango_layout, pf->desc); + + gdk_threads_leave (); +} + JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkTextLayout_indexToPos (JNIEnv *env, jobject self, jint idx, jdoubleArray javaPos) @@ -207,10 +233,108 @@ Java_gnu_java_awt_peer_gtk_GdkTextLayout_dispose gdk_threads_leave (); } +/** + * Draw this textlayout on a cairo surface + * FIXME: Seems completely broken. + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GdkTextLayout_cairoDrawGdkTextLayout + (JNIEnv *env, jobject obj, jobject cairographics, jfloat x, jfloat y) +{ + /* + * FIXME: Some day we expect either cairo or pango will know how to make + * a pango layout paint to a cairo surface. that day is not yet here. + */ + + cairo_t *cr; + struct textlayout *tl = NULL; + PangoLayoutIter *i = NULL; + PangoLayoutRun *run = NULL; + cairo_glyph_t *glyphs = NULL; + gint n_glyphs = 0; + + g_assert (cairographics != NULL); + + cr = cp_gtk_get_cairo_t(env, cairographics); + tl = (struct textlayout *)NSA_GET_TEXT_LAYOUT_PTR (env, obj); + + g_assert (cr != NULL); + g_assert (tl != NULL); + g_assert (tl->pango_layout != NULL); + + gdk_threads_enter (); + + i = pango_layout_get_iter (tl->pango_layout); + g_assert (i != NULL); + + cairo_translate (cr, x, y); + + do + { + run = pango_layout_iter_get_run (i); + if (run != NULL) + paint_glyph_run (cr, &glyphs, &n_glyphs, run); + } + while (pango_layout_iter_next_run (i)); + + if (glyphs != NULL) + g_free (glyphs); + + cairo_translate (cr, -x, -y); + + pango_layout_iter_free (i); + + gdk_threads_leave (); +} + +static void +paint_glyph_run(cairo_t *cr, + cairo_glyph_t **glyphs, + gint *n_glyphs, + PangoLayoutRun *run) +{ + gint i = 0; + gint x = 0, y = 0; + + g_assert (cr != NULL); + g_assert (glyphs != NULL); + g_assert (n_glyphs != NULL); + g_assert (run != NULL); + + if (run->glyphs != NULL && run->glyphs->num_glyphs > 0) + { + if (*n_glyphs < run->glyphs->num_glyphs) + { + *glyphs = g_realloc(*glyphs, + (sizeof(cairo_glyph_t) + * run->glyphs->num_glyphs)); + *n_glyphs = run->glyphs->num_glyphs; + } + + g_assert (*glyphs != NULL); + + for (i = 0; i < run->glyphs->num_glyphs; ++i) + { + (*glyphs)[i].index = run->glyphs->glyphs[i].glyph; + + (*glyphs)[i].x = + ((double) (x + run->glyphs->glyphs[i].geometry.x_offset)) + / ((double) PANGO_SCALE); + + (*glyphs)[i].y = + ((double) (y + run->glyphs->glyphs[i].geometry.y_offset)) + / ((double) PANGO_SCALE); + + x += run->glyphs->glyphs[i].geometry.width; + } + cairo_show_glyphs (cr, *glyphs, run->glyphs->num_glyphs); + } +} + /* GetOutline code follows ****************************/ /********* Freetype callback functions *****************************/ -static int _moveTo( FT_Vector* to, +static int _moveTo( const FT_Vector* to, void *p) { JNIEnv *env; @@ -233,7 +357,7 @@ static int _moveTo( FT_Vector* to, return 0; } -static int _lineTo( FT_Vector* to, +static int _lineTo( const FT_Vector* to, void *p) { JNIEnv *env; @@ -255,8 +379,8 @@ static int _lineTo( FT_Vector* to, return 0; } -static int _quadTo( FT_Vector* cp, - FT_Vector* to, +static int _quadTo( const FT_Vector* cp, + const FT_Vector* to, void *p) { JNIEnv *env; @@ -280,9 +404,9 @@ static int _quadTo( FT_Vector* cp, return 0; } -static int _curveTo( FT_Vector* cp1, - FT_Vector* cp2, - FT_Vector* to, +static int _curveTo( const FT_Vector* cp1, + const FT_Vector* cp2, + const FT_Vector* to, void *p) { JNIEnv *env; @@ -320,10 +444,10 @@ Java_gnu_java_awt_peer_gtk_GdkTextLayout_getOutline PangoLayoutLine *current_line; FT_Outline_Funcs ftCallbacks = { - _moveTo, - _lineTo, - _quadTo, - _curveTo, + (FT_Outline_MoveToFunc) _moveTo, + (FT_Outline_LineToFunc) _lineTo, + (FT_Outline_ConicToFunc) _quadTo, + (FT_Outline_CubicToFunc) _curveTo, 0, 0 }; diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c index f44361972ec..ef9ac12076a 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c @@ -56,17 +56,3 @@ Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create gdk_threads_leave (); } - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_realize (JNIEnv *env, jobject obj) -{ - void *ptr; - - gdk_threads_enter (); - - ptr = NSA_GET_PTR (env, obj); - - gtk_widget_realize (GTK_WIDGET (ptr)); - - gdk_threads_leave (); -} diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c index cb2c87238b2..7ce1185a46d 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c @@ -242,14 +242,7 @@ clipboard_get_func (GtkClipboard *clipboard, pixbuf = cp_gtk_image_get_pixbuf (env, gtkimage); if (pixbuf != NULL) - { - gtk_selection_data_set_pixbuf (selection, pixbuf); - - /* if the GtkImage is offscreen, this is a temporary pixbuf - which should be thrown out. */ - if(cp_gtk_image_is_offscreen (env, gtkimage) == JNI_TRUE) - gdk_pixbuf_unref (pixbuf); - } + gtk_selection_data_set_pixbuf (selection, pixbuf); } else if (info == URI_TARGET) { diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c index b0d4ab9b019..4cd80a73f1b 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c @@ -204,6 +204,7 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetCursorUnlocked { void *ptr; GtkWidget *widget; + GdkWindow *win; GdkCursorType gdk_cursor_type; GdkCursor *gdk_cursor; @@ -255,16 +256,20 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetCursorUnlocked } widget = get_widget(GTK_WIDGET(ptr)); - + + win = widget->window; + if ((widget->window) == NULL) + win = GTK_WIDGET(ptr)->window; + if (image == NULL) gdk_cursor = gdk_cursor_new (gdk_cursor_type); else gdk_cursor - = gdk_cursor_new_from_pixbuf (gdk_drawable_get_display (widget->window), + = gdk_cursor_new_from_pixbuf (gdk_drawable_get_display (win), cp_gtk_image_get_pixbuf (env, image), x, y); - gdk_window_set_cursor (widget->window, gdk_cursor); + gdk_window_set_cursor (win, gdk_cursor); gdk_cursor_unref (gdk_cursor); /* Make sure the cursor is replaced on screen. */ @@ -749,6 +754,20 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetForeground } JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GtkComponentPeer_realize (JNIEnv *env, jobject obj) +{ + void *ptr; + + gdk_threads_enter (); + + ptr = NSA_GET_PTR (env, obj); + + gtk_widget_realize (GTK_WIDGET (ptr)); + + gdk_threads_leave (); +} + +JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_setVisibleNative (JNIEnv *env, jobject obj, jboolean visible) { @@ -793,30 +812,6 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_isEnabled } JNIEXPORT jboolean JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_isRealized - (JNIEnv *env, jobject obj) -{ - void *ptr; - jboolean ret_val; - - gdk_threads_enter (); - - ptr = NSA_GET_PTR (env, obj); - - if (ptr == NULL) - { - gdk_threads_leave (); - return FALSE; - } - - ret_val = GTK_WIDGET_REALIZED (get_widget(GTK_WIDGET (ptr))); - - gdk_threads_leave (); - - return ret_val; -} - -JNIEXPORT jboolean JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_modalHasGrab (JNIEnv *env __attribute__((unused)), jclass clazz __attribute__((unused))) { diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c index c60f48f51bb..76696431424 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c @@ -186,10 +186,5 @@ Java_gnu_java_awt_peer_gtk_GtkFramePeer_nativeSetIconImage gtk_window_set_icon (GTK_WINDOW (ptr), pixbuf); - /* if the GtkImage is offscreen, this is a temporary pixbuf which should - be thrown out. */ - if(cp_gtk_image_is_offscreen (env, gtkimage) == JNI_TRUE) - gdk_pixbuf_unref (pixbuf); - gdk_threads_leave (); } diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c index 92bc09edde7..ff3fbe896b9 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c @@ -37,8 +37,10 @@ exception statement from your version. */ #include "jcl.h" #include "gtkpeer.h" +#include <cairo-xlib.h> +#include <gdk/gdkx.h> + #include "gnu_java_awt_peer_gtk_GtkImage.h" -#include <gdk-pixbuf/gdk-pixbuf.h> /* The constant fields in java.awt.Image */ #define SCALE_DEFAULT 1 @@ -49,13 +51,11 @@ exception statement from your version. */ /* local stuff */ static GdkInterpType mapHints(jint hints); -static jboolean offScreen (JNIEnv * env, jobject obj); -static void *getData (JNIEnv * env, jobject obj); static void createRawData (JNIEnv * env, jobject obj, void *ptr); static void setWidthHeight (JNIEnv * env, jobject obj, int width, int height); /** - * Loads a pixmap from a file. + * Loads a pixbuf from a file. */ JNIEXPORT jboolean JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_loadPixbuf @@ -117,10 +117,14 @@ Java_gnu_java_awt_peer_gtk_GtkImage_loadImageFromData if (pixbuf == NULL) { + g_object_unref (loader); createRawData (env, obj, NULL); return JNI_FALSE; } + g_object_ref (pixbuf); + g_object_unref (loader); + width = gdk_pixbuf_get_width (pixbuf); height = gdk_pixbuf_get_height (pixbuf); @@ -135,7 +139,7 @@ Java_gnu_java_awt_peer_gtk_GtkImage_createFromPixbuf (JNIEnv *env, jobject obj) { int width, heigth; - GdkPixbuf *pixbuf = (GdkPixbuf *) getData (env, obj); + GdkPixbuf *pixbuf = cp_gtk_image_get_pixbuf (env, obj); width = gdk_pixbuf_get_width (pixbuf); heigth = gdk_pixbuf_get_height (pixbuf); setWidthHeight(env, obj, width, heigth); @@ -154,6 +158,8 @@ Java_gnu_java_awt_peer_gtk_GtkImage_getPixels(JNIEnv *env, jobject obj) jint *result_array_iter, *dst; int i,j; + gdk_threads_enter (); + pixbuf = cp_gtk_image_get_pixbuf (env, obj); width = gdk_pixbuf_get_width (pixbuf); height = gdk_pixbuf_get_height (pixbuf); @@ -190,11 +196,9 @@ Java_gnu_java_awt_peer_gtk_GtkImage_getPixels(JNIEnv *env, jobject obj) } } - if (offScreen (env, obj) == JNI_TRUE) - gdk_pixbuf_unref (pixbuf); - (*env)->ReleaseIntArrayElements (env, result_array, result_array_iter, 0); + gdk_threads_leave (); return result_array; } @@ -206,7 +210,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImage_setPixels(JNIEnv *env, jobject obj, jintArray pixels) { - GdkPixbuf *pixbuf = (GdkPixbuf *)getData (env, obj); + GdkPixbuf *pixbuf = cp_gtk_image_get_pixbuf (env, obj); int width, height, rowstride; guchar *pixeldata; jint *src_array_iter, *src; @@ -231,10 +235,10 @@ Java_gnu_java_awt_peer_gtk_GtkImage_setPixels(JNIEnv *env, jobject obj, } /** - * Allocates a Gtk Pixbuf or Pixmap. + * Allocates a Gtk Pixbuf */ JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkImage_createPixmap(JNIEnv *env, jobject obj) +Java_gnu_java_awt_peer_gtk_GtkImage_createPixbuf(JNIEnv *env, jobject obj) { int width, height; jclass cls; @@ -249,35 +253,58 @@ Java_gnu_java_awt_peer_gtk_GtkImage_createPixmap(JNIEnv *env, jobject obj) g_assert (field != 0); height = (*env)->GetIntField (env, obj, field); - if (offScreen (env, obj) == JNI_FALSE) - createRawData (env, obj, gdk_pixbuf_new (GDK_COLORSPACE_RGB, - TRUE, - 8, - width, - height)); - else - createRawData (env, obj, gdk_pixmap_new (NULL, width, height, - gdk_rgb_get_visual ()->depth)); + createRawData (env, obj, gdk_pixbuf_new (GDK_COLORSPACE_RGB, + TRUE, + 8, + width, + height)); } /** - * Frees the Gtk Pixmap. + * Allocates a Gtk Pixbuf */ JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkImage_freePixmap(JNIEnv *env, jobject obj) +Java_gnu_java_awt_peer_gtk_GtkImage_initFromBuffer(JNIEnv *env, jobject obj, + jlong bufferPointer) { - if (offScreen (env, obj) == JNI_FALSE) - gdk_pixbuf_unref ((GdkPixbuf *)getData (env, obj)); - else - g_object_unref ((GdkPixmap *)getData (env, obj)); + int width, height; + jclass cls; + jfieldID field; + GdkPixbuf *pixbuf; + const guchar *bp = JLONG_TO_PTR(const guchar, bufferPointer); + + g_assert(bp != NULL); + cls = (*env)->GetObjectClass( env, obj ); + field = (*env)->GetFieldID( env, cls, "width", "I" ); + g_assert( field != 0 ); + width = (*env)->GetIntField( env, obj, field ); + + field = (*env)->GetFieldID( env, cls, "height", "I" ); + g_assert( field != 0 ); + height = (*env)->GetIntField( env, obj, field ); + + pixbuf = gdk_pixbuf_new_from_data( bp, + GDK_COLORSPACE_RGB, TRUE, 8, + width, height, width * 4, NULL, NULL ); + g_assert( pixbuf != NULL ); + createRawData( env, obj, pixbuf ); } /** - * Sets this pixmap to a scaled version of the source pixmap. + * Frees the Gtk Pixbuf. + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GtkImage_freePixbuf(JNIEnv *env, jobject obj) +{ + gdk_pixbuf_unref (cp_gtk_image_get_pixbuf (env, obj)); +} + +/** + * Sets this to a scaled version of the original pixbuf * width and height of the destination GtkImage must be set. */ JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkImage_createScaledPixmap(JNIEnv *env, +Java_gnu_java_awt_peer_gtk_GtkImage_createScaledPixbuf(JNIEnv *env, jobject destination, jobject source, jint hints) @@ -304,251 +331,25 @@ Java_gnu_java_awt_peer_gtk_GtkImage_createScaledPixmap(JNIEnv *env, width, height, mapHints(hints)); - if (offScreen (env, source) == JNI_TRUE) - gdk_pixbuf_unref (pixbuf); - createRawData (env, destination, (void *)dst); } /** - * Draws the pixbuf at x, y, scaled to width and height and - * optionally composited with a given background color. - */ -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkImage_drawPixelsScaled - (JNIEnv *env, jobject obj, jobject gc_obj, - jint bg_red, jint bg_green, jint bg_blue, - jint x, jint y, jint width, jint height, jboolean composite) -{ - GdkPixbuf* dst; - struct graphics *g; - guint32 bgColor; - - gdk_threads_enter (); - - if (width <= 0 || height <= 0) - { - gdk_threads_leave (); - return; - } - - bgColor = ((bg_red & 0xFF) << 16) | - ((bg_green & 0xFF) << 8) | (bg_blue & 0xFF); - - g = (struct graphics *) NSA_GET_G_PTR (env, gc_obj); - - if (!g || !GDK_IS_DRAWABLE (g->drawable)) - { - gdk_threads_leave (); - return; - } - - if (offScreen (env, obj) == JNI_FALSE) - { - GdkPixbuf* pixbuf = (GdkPixbuf *)getData (env, obj); - - /* Scale and composite the image */ - if (composite == JNI_TRUE) - dst = gdk_pixbuf_composite_color_simple (pixbuf, - width, - height, - GDK_INTERP_BILINEAR, - 255, - width, - bgColor, - bgColor); - else - dst = gdk_pixbuf_scale_simple(pixbuf, - width, height, - GDK_INTERP_BILINEAR); - - gdk_draw_pixbuf (g->drawable, - g->gc, - dst, - 0, 0, - x + g->x_offset, y + g->y_offset, - width, height, - GDK_RGB_DITHER_NORMAL, 0, 0); - gdk_pixbuf_unref (dst); - - } else { - /* Get a pixmap */ - GdkPixmap* pixmap = (GdkPixmap *)getData (env, obj); - gdk_draw_drawable (g->drawable, - g->gc, - pixmap, - 0, 0, /* src x,y */ - x + g->x_offset, y + g->y_offset, - width, height); - } - - gdk_threads_leave (); -} - -/** - * Draws the pixbuf at x, y, scaled to width and height and - * optionally composited and/or flipped with a given background color. - */ -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkImage_drawPixelsScaledFlipped -(JNIEnv *env, jobject obj, jobject gc_obj, - jint bg_red, jint bg_green, jint bg_blue, -#if GTK_MINOR_VERSION > 4 - jboolean flipx, jboolean flipy, -#else - jboolean flipx __attribute__((unused)), - jboolean flipy __attribute__((unused)), -#endif - jint srcx, jint srcy, jint srcwidth, jint srcheight, - jint dstx, jint dsty, jint dstwidth, jint dstheight, - jboolean composite) -{ - GdkPixbuf *pixbuf; - GdkPixbuf *tmp, *dst; - struct graphics *g; - guint32 bgColor; - - gdk_threads_enter (); - - if (srcwidth <= 0 || srcheight <= 0 - || dstwidth <= 0 || dstheight <= 0) - { - gdk_threads_leave (); - return; - } - - bgColor = ((bg_red & 0xFF) << 16) | - ((bg_green & 0xFF) << 8) | (bg_blue & 0xFF); - - g = (struct graphics *) NSA_GET_G_PTR (env, gc_obj); - - if (!g || !GDK_IS_DRAWABLE (g->drawable)) - { - gdk_threads_leave (); - return; - } - - if (offScreen (env, obj) == JNI_FALSE) - { - pixbuf = (GdkPixbuf *)getData (env, obj); - - /* Get the source area */ - tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, - TRUE, - 8, - srcwidth, - srcheight); - - gdk_pixbuf_copy_area (pixbuf, - srcx, srcy, - srcwidth, srcheight, - tmp, - 0, 0); /* dst x , dst y */ - } else { - /* Get a pixbuf from the pixmap */ - GdkDrawable *pixmap = (GdkDrawable *)getData(env, obj); - tmp = gdk_pixbuf_get_from_drawable (NULL, - pixmap, - gdk_drawable_get_colormap( pixmap ), - srcx, srcy, - 0, 0, /* dst x , dst y */ - srcwidth, srcheight); - } - - /* FIXME: This #if should be discarded once I feel comfortable about - GTK 2.6 dependence */ -#if GTK_MINOR_VERSION > 4 - /* Flip it if necessary. */ - if (flipx == JNI_TRUE) - { - GdkPixbuf *tmp2 = gdk_pixbuf_flip (tmp, TRUE); - gdk_pixbuf_unref (tmp); - tmp = tmp2; - } - if (flipy == JNI_TRUE) - { - GdkPixbuf *tmp2 = gdk_pixbuf_flip (tmp, FALSE); - gdk_pixbuf_unref (tmp); - tmp = tmp2; - } -#endif - - /* Scale and composite the image */ - if (composite == JNI_TRUE) - dst = gdk_pixbuf_composite_color_simple (tmp, - dstwidth, - dstheight, - GDK_INTERP_BILINEAR, - 255, - dstwidth, - bgColor, - bgColor); - else - dst = gdk_pixbuf_scale_simple(tmp, - dstwidth, dstheight, - GDK_INTERP_BILINEAR); - gdk_pixbuf_unref (tmp); - - gdk_draw_pixbuf (g->drawable, - g->gc, - dst, - 0, 0, - dstx + g->x_offset, dsty + g->y_offset, - dstwidth, dstheight, - GDK_RGB_DITHER_NORMAL, 0, 0); - - gdk_pixbuf_unref (dst); - - gdk_threads_leave (); -} - -/** * Used by GtkFramePeer */ GdkPixbuf *cp_gtk_image_get_pixbuf (JNIEnv *env, jobject obj) { - int width, height; - GdkPixbuf *pixbuf; - GdkPixmap* pixmap; jclass cls; - jfieldID field; - - if (offScreen (env, obj) == JNI_FALSE) - return (GdkPixbuf *)getData (env, obj); + jfieldID data_fid; + jobject data; cls = (*env)->GetObjectClass (env, obj); - field = (*env)->GetFieldID (env, cls, "width", "I"); - g_assert (field != 0); - width = (*env)->GetIntField (env, obj, field); - - field = (*env)->GetFieldID (env, cls, "height", "I"); - g_assert (field != 0); - height = (*env)->GetIntField (env, obj, field); - - /* Get a pixmap */ - pixmap = (GdkPixmap *)getData (env, obj); - pixbuf = gdk_pixbuf_get_from_drawable (NULL, - pixmap, - gdk_drawable_get_colormap( pixmap ), - 0, 0, /* src x , src y */ - 0, 0, /* dst x , dst y */ - width, height); - return pixbuf; -} - -/** - * Used by GdkGraphics - */ -GdkPixmap *cp_gtk_image_get_pixmap (JNIEnv *env, jobject obj) -{ - if (offScreen (env, obj) == JNI_FALSE) - return NULL; - return (GdkPixmap *)getData (env, obj); -} + data_fid = (*env)->GetFieldID (env, cls, "pixbuf", + "Lgnu/classpath/Pointer;"); + g_assert (data_fid != 0); + data = (*env)->GetObjectField (env, obj, data_fid); -jboolean cp_gtk_image_is_offscreen (JNIEnv *env, jobject obj) -{ - return offScreen(env, obj); + return (GdkPixbuf *)JCL_GetRawData (env, data); } /** @@ -593,18 +394,6 @@ static void setWidthHeight (JNIEnv * env, jobject obj, int width, int height) (*env)->SetIntField (env, obj, field, (jint)height); } -/* Returns the value of the offScreen field. */ -static jboolean offScreen (JNIEnv *env, jobject obj) -{ - jclass cls; - jfieldID field; - - cls = (*env)->GetObjectClass (env, obj); - field = (*env)->GetFieldID (env, cls, "offScreen", "Z"); - g_assert (field != 0); - return (*env)->GetBooleanField (env, obj, field); -} - /* Store and get the pixbuf pointer */ static void createRawData (JNIEnv * env, jobject obj, void *ptr) @@ -614,7 +403,7 @@ createRawData (JNIEnv * env, jobject obj, void *ptr) jfieldID data_fid; cls = (*env)->GetObjectClass (env, obj); - data_fid = (*env)->GetFieldID (env, cls, "pixmap", + data_fid = (*env)->GetFieldID (env, cls, "pixbuf", "Lgnu/classpath/Pointer;"); g_assert (data_fid != 0); @@ -623,18 +412,3 @@ createRawData (JNIEnv * env, jobject obj, void *ptr) (*env)->SetObjectField (env, obj, data_fid, data); } -static void * -getData (JNIEnv * env, jobject obj) -{ - jclass cls; - jfieldID data_fid; - jobject data; - - cls = (*env)->GetObjectClass (env, obj); - data_fid = (*env)->GetFieldID (env, cls, "pixmap", - "Lgnu/classpath/Pointer;"); - g_assert (data_fid != 0); - data = (*env)->GetObjectField (env, obj, data_fid); - - return JCL_GetRawData (env, data); -} diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c index b14330e5fe2..c966f6331a4 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c @@ -185,10 +185,6 @@ Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit (JNIEnv *env, old_glog_func = g_log_set_default_handler (&glog_func, NULL); #endif -#if GTK_CAIRO - cp_gtk_graphics2d_init_jni (); -#endif - cp_gtk_graphics_init_jni (); cp_gtk_button_init_jni (); cp_gtk_checkbox_init_jni (); cp_gtk_choice_init_jni (); diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c new file mode 100644 index 00000000000..5ca21a5677a --- /dev/null +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c @@ -0,0 +1,216 @@ +/* gnu_java_awt_peer_gtk_VolatileImage.c + 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. */ + +#include "jcl.h" +#include "gtkpeer.h" +#include <gdk/gdkx.h> +#include <gdk/gdktypes.h> +#include <gdk/gdkprivate.h> +#include <gdk/gdkx.h> +#include <gdk-pixbuf/gdk-pixbuf.h> +#include <gdk-pixbuf/gdk-pixdata.h> + +#include "gnu_java_awt_peer_gtk_GtkVolatileImage.h" +#include "cairographics2d.h" + +/* prototypes */ +static void *getNativeObject( JNIEnv *env, jobject obj ); +/* static void setNativeObject( JNIEnv *env, jobject obj, void *ptr ); */ + +GdkPixmap *cp_gtk_get_pixmap( JNIEnv *env, jobject obj); + +/** + * Creates a cairo surface, ARGB32, native ordering, premultiplied alpha. + */ +JNIEXPORT jlong JNICALL +Java_gnu_java_awt_peer_gtk_GtkVolatileImage_init (JNIEnv *env, + jobject obj __attribute__ ((__unused__)), + jobject peer, + jint width, jint height) +{ + GtkWidget *widget = NULL; + GdkPixmap* pixmap; + void *ptr = NULL; + + gdk_threads_enter(); + + if( peer != NULL ) + { + ptr = NSA_GET_PTR (env, peer); + g_assert (ptr != NULL); + + widget = GTK_WIDGET (ptr); + g_assert (widget != NULL); + pixmap = gdk_pixmap_new( widget->window, width, height, -1 ); + } + else + pixmap = gdk_pixmap_new( NULL, width, height, 16 ); + + gdk_threads_leave(); + + g_assert( pixmap != NULL ); + + return PTR_TO_JLONG( pixmap ); +} + +/** + * Destroy the surface + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GtkVolatileImage_destroy (JNIEnv *env, jobject obj) +{ + GdkPixmap* pixmap = getNativeObject(env, obj); + if( pixmap != NULL ) + { + gdk_threads_enter(); + g_object_unref( pixmap ); + gdk_threads_leave(); + } +} + +/** + * Gets all pixels in an array + */ +JNIEXPORT jintArray JNICALL +Java_gnu_java_awt_peer_gtk_GtkVolatileImage_getPixels +(JNIEnv *env, jobject obj) +{ + /* jint *pixeldata, *jpixdata; */ + jint *jpixdata; + GdkPixmap *pixmap; + jintArray jpixels; + int width, height, depth, size; + jclass cls; + jfieldID field; + + cls = (*env)->GetObjectClass (env, obj); + field = (*env)->GetFieldID (env, cls, "width", "I"); + g_assert (field != 0); + width = (*env)->GetIntField (env, obj, field); + + field = (*env)->GetFieldID (env, cls, "height", "I"); + g_assert (field != 0); + height = (*env)->GetIntField (env, obj, field); + + pixmap = GDK_PIXMAP(getNativeObject(env, obj)); + g_assert(pixmap != NULL); + + gdk_threads_enter(); + + /* get depth in bytes */ + depth = gdk_drawable_get_depth( pixmap ) >> 3; + size = width * height * 4; + jpixels = (*env)->NewIntArray ( env, size ); + jpixdata = (*env)->GetIntArrayElements (env, jpixels, NULL); + /* memcpy (jpixdata, pixeldata, size * sizeof( jint )); */ + + (*env)->ReleaseIntArrayElements (env, jpixels, jpixdata, 0); + + gdk_threads_leave(); + + return jpixels; +} + +/** + * Copy area + */ +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GtkVolatileImage_copyArea +(JNIEnv *env, jobject obj, jint x, jint y, jint w, jint h, jint dx, jint dy) +{ + GdkPixbuf *pixbuf; + GdkPixmap* pixmap = getNativeObject(env, obj); + + g_assert (pixmap != NULL); + + gdk_threads_enter(); + + pixbuf = gdk_pixbuf_new( GDK_COLORSPACE_RGB, TRUE, 8, w, h ); + gdk_pixbuf_get_from_drawable( pixbuf, pixmap, NULL, x, y, 0, 0, w, h ); + gdk_draw_pixbuf (pixmap, NULL, pixbuf, + 0, 0, x + dx, y + dy, + w, h, + GDK_RGB_DITHER_NORMAL, 0, 0); + gdk_threads_leave(); +} + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GtkVolatileImage_drawVolatile +(JNIEnv *env, jobject obj, jlong ptr, jint x, jint y, jint w, jint h) +{ + GdkPixmap *dst, *src; + GdkGC *gc; + + src = JLONG_TO_PTR(GdkPixmap, ptr); + dst = getNativeObject(env, obj); + g_assert (src != NULL); + g_assert (dst != NULL); + + gdk_threads_enter(); + + gc = gdk_gc_new( dst ); + gdk_draw_drawable(dst, + gc, + src, + 0, 0, + x, y, + w, h); + g_object_unref( gc ); + + gdk_threads_leave(); +} + +GdkPixmap *cp_gtk_get_pixmap( JNIEnv *env, jobject obj) +{ + return (GdkPixmap *)getNativeObject(env, obj); +} + +/** + * Gets the native object field. + */ +static void * +getNativeObject( JNIEnv *env, jobject obj ) +{ + jclass cls; + jlong value; + jfieldID nofid; + cls = (*env)->GetObjectClass( env, obj ); + nofid = (*env)->GetFieldID( env, cls, "nativePointer", "J" ); + value = (*env)->GetLongField( env, obj, nofid ); + (*env)->DeleteLocalRef( env, cls ); + return JLONG_TO_PTR(void, value); +} diff --git a/libjava/classpath/native/jni/gtk-peer/gtkpeer.h b/libjava/classpath/native/jni/gtk-peer/gtkpeer.h index 9a1590b81d3..065d20608f5 100644 --- a/libjava/classpath/native/jni/gtk-peer/gtkpeer.h +++ b/libjava/classpath/native/jni/gtk-peer/gtkpeer.h @@ -36,12 +36,14 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ +#include <cairo.h> #include <gtk/gtk.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <config.h> #include "native_state.h" +#include <gdk-pixbuf/gdk-pixbuf.h> #include <jni.h> @@ -54,6 +56,7 @@ exception statement from your version. */ extern struct state_table *cp_gtk_native_state_table; extern struct state_table *cp_gtk_native_global_ref_table; +extern struct state_table *cp_gtk_native_graphics2d_state_table; #define NSA_INIT(env, clazz) \ do {cp_gtk_native_state_table = cp_gtk_init_state_table (env, clazz); \ @@ -83,34 +86,21 @@ extern struct state_table *cp_gtk_native_global_ref_table; (*env)->DeleteGlobalRef (env, *globRefPtr); \ free (globRefPtr);} while (0) -extern struct state_table *cp_gtk_native_graphics_state_table; +#define NSA_G2D_INIT(env, clazz) \ + cp_gtk_native_graphics2d_state_table = cp_gtk_init_state_table (env, clazz) -#define NSA_G_INIT(env, clazz) \ - cp_gtk_native_graphics_state_table = cp_gtk_init_state_table (env, clazz) +#define NSA_GET_G2D_PTR(env, obj) \ + cp_gtk_get_state (env, obj, cp_gtk_native_graphics2d_state_table) -#define NSA_GET_G_PTR(env, obj) \ - cp_gtk_get_state (env, obj, cp_gtk_native_graphics_state_table) +#define NSA_SET_G2D_PTR(env, obj, ptr) \ + cp_gtk_set_state (env, obj, cp_gtk_native_graphics2d_state_table, (void *)ptr) -#define NSA_SET_G_PTR(env, obj, ptr) \ - cp_gtk_set_state (env, obj, cp_gtk_native_graphics_state_table, (void *)ptr) - -#define NSA_DEL_G_PTR(env, obj) \ - cp_gtk_remove_state_slot (env, obj, cp_gtk_native_graphics_state_table) +#define NSA_DEL_G2D_PTR(env, obj) \ + cp_gtk_remove_state_slot (env, obj, cp_gtk_native_graphics2d_state_table) #define SWAPU32(w) \ (((w) << 24) | (((w) & 0xff00) << 8) | (((w) >> 8) & 0xff00) | ((w) >> 24)) -struct graphics -{ - GdkDrawable *drawable; - GdkGC *gc; - GdkColormap *cm; - PangoFontDescription *pango_font; - PangoContext *pango_context; - PangoLayout *pango_layout; - jint x_offset, y_offset; -}; - /* New-style event masks. */ #define AWT_BUTTON1_DOWN_MASK (1 << 10) #define AWT_BUTTON2_DOWN_MASK (1 << 11) @@ -192,14 +182,12 @@ jint cp_gtk_state_to_awt_mods (guint state); /* Image helpers */ GdkPixbuf *cp_gtk_image_get_pixbuf (JNIEnv *env, jobject obj); -GdkPixmap *cp_gtk_image_get_pixmap (JNIEnv *env, jobject obj); -jboolean cp_gtk_image_is_offscreen (JNIEnv *env, jobject obj); + +/* Component Graphics helpers */ +void cp_gtk_grab_current_drawable(GtkWidget *widget, GdkDrawable **draw, + GdkWindow **win); /* JNI initialization functions */ -#if GTK_CAIRO -void cp_gtk_graphics2d_init_jni (void); -#endif -void cp_gtk_graphics_init_jni (void); void cp_gtk_button_init_jni (void); void cp_gtk_checkbox_init_jni (void); void cp_gtk_choice_init_jni (void); @@ -221,6 +209,8 @@ void cp_gtk_textcomponent_connect_signals (GObject *ptr, jobject *gref); /* Debugging */ void cp_gtk_print_current_thread (void); +GdkPixmap *cp_gtk_get_pixmap( JNIEnv *env, jobject obj); + #define SYNCHRONIZE_GDK 0 #define DEBUG_LOCKING 0 diff --git a/libjava/classpath/native/jni/java-io/Makefile.in b/libjava/classpath/native/jni/java-io/Makefile.in index 940e46e7349..ca4b8a4728f 100644 --- a/libjava/classpath/native/jni/java-io/Makefile.in +++ b/libjava/classpath/native/jni/java-io/Makefile.in @@ -92,8 +92,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@ @@ -120,8 +118,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@ @@ -144,6 +146,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@ @@ -159,9 +163,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@ @@ -183,6 +186,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -196,6 +200,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@ @@ -209,6 +215,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@ @@ -228,11 +235,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@ diff --git a/libjava/classpath/native/jni/java-lang/Makefile.in b/libjava/classpath/native/jni/java-lang/Makefile.in index ed76c1546c3..70e673b3b31 100644 --- a/libjava/classpath/native/jni/java-lang/Makefile.in +++ b/libjava/classpath/native/jni/java-lang/Makefile.in @@ -98,8 +98,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@ @@ -126,8 +124,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@ @@ -150,6 +152,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@ @@ -165,9 +169,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@ @@ -189,6 +192,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -202,6 +206,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@ @@ -215,6 +221,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@ @@ -234,11 +241,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@ diff --git a/libjava/classpath/native/jni/java-net/Makefile.in b/libjava/classpath/native/jni/java-net/Makefile.in index 99511d08b03..cc47eb3fb73 100644 --- a/libjava/classpath/native/jni/java-net/Makefile.in +++ b/libjava/classpath/native/jni/java-net/Makefile.in @@ -102,8 +102,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@ @@ -130,8 +128,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@ @@ -154,6 +156,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@ @@ -169,9 +173,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@ @@ -193,6 +196,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -206,6 +210,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@ @@ -219,6 +225,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@ @@ -238,11 +245,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@ diff --git a/libjava/classpath/native/jni/java-nio/Makefile.in b/libjava/classpath/native/jni/java-nio/Makefile.in index 85ff65ed31f..5634c92cea5 100644 --- a/libjava/classpath/native/jni/java-nio/Makefile.in +++ b/libjava/classpath/native/jni/java-nio/Makefile.in @@ -99,8 +99,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@ @@ -127,8 +125,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@ @@ -151,6 +153,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@ @@ -166,9 +170,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@ @@ -190,6 +193,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -203,6 +207,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@ @@ -216,6 +222,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@ @@ -235,11 +242,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@ diff --git a/libjava/classpath/native/jni/java-util/Makefile.in b/libjava/classpath/native/jni/java-util/Makefile.in index 7f013ab8395..7adf1a4ddaa 100644 --- a/libjava/classpath/native/jni/java-util/Makefile.in +++ b/libjava/classpath/native/jni/java-util/Makefile.in @@ -90,8 +90,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@ @@ -118,8 +116,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@ @@ -142,6 +144,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@ @@ -157,9 +161,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@ @@ -181,6 +184,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -194,6 +198,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@ @@ -207,6 +213,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@ @@ -226,11 +233,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@ diff --git a/libjava/classpath/native/jni/midi-alsa/Makefile.in b/libjava/classpath/native/jni/midi-alsa/Makefile.in index 48090e8e72d..b0650c08d03 100644 --- a/libjava/classpath/native/jni/midi-alsa/Makefile.in +++ b/libjava/classpath/native/jni/midi-alsa/Makefile.in @@ -93,8 +93,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@ @@ -121,8 +119,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@ @@ -145,6 +147,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@ @@ -160,9 +164,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@ @@ -184,6 +187,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -197,6 +201,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@ @@ -210,6 +216,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@ @@ -229,11 +236,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@ diff --git a/libjava/classpath/native/jni/midi-dssi/Makefile.in b/libjava/classpath/native/jni/midi-dssi/Makefile.in index 6383c65485d..969e029c7a4 100644 --- a/libjava/classpath/native/jni/midi-dssi/Makefile.in +++ b/libjava/classpath/native/jni/midi-dssi/Makefile.in @@ -93,8 +93,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@ @@ -121,8 +119,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@ @@ -145,6 +147,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@ @@ -160,9 +164,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@ @@ -184,6 +187,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -197,6 +201,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@ @@ -210,6 +216,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@ @@ -229,11 +236,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@ diff --git a/libjava/classpath/native/jni/qt-peer/.cvsignore b/libjava/classpath/native/jni/qt-peer/.cvsignore new file mode 100644 index 00000000000..369a52a2a3c --- /dev/null +++ b/libjava/classpath/native/jni/qt-peer/.cvsignore @@ -0,0 +1,9 @@ +*.o +*.a +*.lo +*.la +.libs +.deps +Makefile +Makefile.in +slotcallbacks.moc.h diff --git a/libjava/classpath/native/jni/qt-peer/Makefile.in b/libjava/classpath/native/jni/qt-peer/Makefile.in index e9c2bffa429..537ead6318b 100644 --- a/libjava/classpath/native/jni/qt-peer/Makefile.in +++ b/libjava/classpath/native/jni/qt-peer/Makefile.in @@ -116,8 +116,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@ @@ -144,8 +142,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@ @@ -168,6 +170,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@ @@ -183,9 +187,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@ @@ -207,6 +210,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -220,6 +224,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@ @@ -233,6 +239,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@ @@ -252,11 +259,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@ diff --git a/libjava/classpath/native/jni/qt-peer/eventmethods.h b/libjava/classpath/native/jni/qt-peer/eventmethods.h index ea5d45a5caf..ae56da8e7aa 100644 --- a/libjava/classpath/native/jni/qt-peer/eventmethods.h +++ b/libjava/classpath/native/jni/qt-peer/eventmethods.h @@ -1,5 +1,5 @@ /* eventmethods.cpp -- - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -62,7 +62,7 @@ private: env->DeleteGlobalRef(componentCls); } - void callVoidMethod(char *methodName) + void callVoidMethod(const char *methodName) { JNIEnv *env; vm->GetEnv((void **)&env, JNI_VERSION_1_1); @@ -72,7 +72,7 @@ private: env->CallVoidMethod( target, fireEventID ); } - void callMouseMethod(char *methodName, + void callMouseMethod(const char *methodName, int modifiers, int x, int y, int clickCount) { JNIEnv *env; diff --git a/libjava/classpath/native/jni/qt-peer/qtmenupeer.cpp b/libjava/classpath/native/jni/qt-peer/qtmenupeer.cpp index 1ac17145c2f..6f35c89b9bd 100644 --- a/libjava/classpath/native/jni/qt-peer/qtmenupeer.cpp +++ b/libjava/classpath/native/jni/qt-peer/qtmenupeer.cpp @@ -44,9 +44,11 @@ exception statement from your version. */ #include "slotcallbacks.h" #include "componentevent.h" -#define ADDMENU 0 -#define ADDITEM 1 -#define ADDSEPA 2 +typedef enum ActionType { + ActionMenu, + ActionItem, + ActionSeparator +} ActionType; // Sets the title, but also tear-off. class MenuTitleEvent : public AWTEvent { @@ -81,18 +83,18 @@ class MenuAction : public AWTEvent { private: QMenu *menu; QAction *action; - int isMenu; // 0 to add a menu, 1 to add an item, 2 to add a seperator + ActionType actionType; // type of action to add JavaVM *vm; jobject menuPeer; jobject itemPeer; public: MenuAction(JNIEnv *env, jobject mp, jobject ip, QMenu *m, QAction *a, - bool ismenu) : AWTEvent() + ActionType actionType) : AWTEvent() { menu = m; action = a; - isMenu = ismenu; + this->actionType = actionType; env->GetJavaVM( &vm ); menuPeer = env->NewGlobalRef( mp ); if( ip != NULL ) @@ -104,35 +106,22 @@ public: void runEvent() { JNIEnv *env; - QAction *newAction; // adding an action creates a new duplicate. vm->GetEnv((void **)&env, JNI_VERSION_1_1); - - switch(isMenu) - { - case ADDMENU: - newAction = menu->addMenu( (QMenu *)action ); - break; - case ADDITEM: - newAction = menu->addAction(action->text()); - newAction->setSeparator(action->isSeparator()); - newAction->setCheckable(action->isCheckable()); - // delete action; - break; - case ADDSEPA: - newAction = menu->addSeparator(); - break; - } + if (actionType == ActionMenu) + menu->addMenu ((QMenu *) action); + else + menu->addAction (action); jclass menuCls = env->GetObjectClass( menuPeer ); jmethodID mid = env->GetMethodID(menuCls, "add", "(J)V"); env->DeleteLocalRef(menuCls); - env->CallVoidMethod( menuPeer, mid, (jlong)newAction ); + env->CallVoidMethod( menuPeer, mid, (jlong)action ); env->DeleteGlobalRef( menuPeer ); if( itemPeer != NULL ) { - setNativeObject( env, itemPeer, newAction ); - connectAction(newAction, env, itemPeer); + setNativeObject( env, itemPeer, action ); + connectAction(action, env, itemPeer); env->DeleteGlobalRef( itemPeer ); } } @@ -190,7 +179,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtMenuPeer_insertSeperator QMenu *menu = (QMenu *)getNativeObject( env, obj ); assert( menu ); mainThread->postEventToMain( new MenuAction( env, obj, NULL, - menu, NULL, ADDSEPA ) ); + menu, NULL, ActionSeparator ) ); } /* @@ -205,7 +194,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtMenuPeer_insertItem QAction *action = (QAction *)getNativeObject( env, item ); assert( action ); - mainThread->postEventToMain( new MenuAction( env, obj, item, menu, action, ADDITEM )); + mainThread->postEventToMain( new MenuAction( env, obj, item, menu, action, ActionItem )); } /* @@ -220,7 +209,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtMenuPeer_insertMenu QMenu *insMenu = (QMenu *)getNativeObject(env, menu); assert( insMenu ); - mainThread->postEventToMain( new MenuAction( env, obj, menu, thisMenu, (QAction *)insMenu, ADDMENU ) ); + mainThread->postEventToMain( new MenuAction( env, obj, menu, thisMenu, (QAction *)insMenu, ActionMenu ) ); } /* diff --git a/libjava/classpath/native/jni/xmlj/Makefile.in b/libjava/classpath/native/jni/xmlj/Makefile.in index 482b5a8421f..01f27548860 100644 --- a/libjava/classpath/native/jni/xmlj/Makefile.in +++ b/libjava/classpath/native/jni/xmlj/Makefile.in @@ -92,8 +92,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@ @@ -120,8 +118,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@ @@ -144,6 +146,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@ @@ -159,9 +163,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@ @@ -183,6 +186,7 @@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ LIBICONV = @LIBICONV@ +LIBMAGIC = @LIBMAGIC@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ @@ -196,6 +200,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@ @@ -209,6 +215,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@ @@ -228,11 +235,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@ |