diff --git a/Makefile b/Makefile index 3ec3f07d..71f79a4e 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ $(DESTDIR)$(JARDIR)/gtk-$(APIVERSION).jar: tmp/gtk-$(APIVERSION).jar @/bin/echo -e "INSTALL\t$@" cp -f $< $@ @/bin/echo -e "JAR\t$@" - jar uf $@ .libdir + /usr/bin/jar uf $@ .libdir @/bin/echo -e "SYMLINK\t$(@D)/gtk.jar -> gtk-$(APIVERSION).jar" cd $(@D) && rm -f gtk.jar && ln -s gtk-$(APIVERSION).jar gtk.jar diff --git a/README.markdown b/README.markdown index 3b3bc91e..a1bb2383 100644 --- a/README.markdown +++ b/README.markdown @@ -1,3 +1,6 @@ +[![No Maintenance Intended](https://img.shields.io/maintenance/no/2013)](http://unmaintained.tech/) +[![License](https://img.shields.io/badge/license-GPL--2.0%20%2B%20Linking%20Exception-blue)](/LICENCE.markdown) + This is the java-gnome language bindings project. We endeavour to provide a high quality library you can use to write GTK and GNOME programs. The underlying APIs are elegantly transformed into Java and carefully documented so @@ -300,13 +303,9 @@ applications. The architecture and internal design has been well proved, and the coverage level (relative to the full breadth of the underlying libraries) is reaching maturity. -Get Involved ------------- - -If you would like to get involved yourself as an individual, we would welcome -your contribution. See [`HACKING`](HACKING.html). If you are working on an -application, want to learn more, or are just curious, join us online in -`#java-gnome` on `irc.gimp.net`. +The library has been unmaintained for some years, however. If anyone in the +GNOME community wishes to adopt the project we will happily transfer the +repository to you. Happy coding! @@ -314,13 +313,6 @@ AfC `--` Andrew Frederick Cowie -Managing Director, -[Operational Dynamics](http://www.operationaldynamics.com/), -a Change Management consultancy... - -Maintainer, -[java-gnome](http://java-gnome.sourceforge.net/), -opening GTK and GNOME to Java programmers! _Last modified 22 Feb 13_ diff --git a/configure b/configure index 0756474b..7e82fddb 100755 --- a/configure +++ b/configure @@ -1031,45 +1031,45 @@ if ($os eq "gentoo") { check_system_library(@gnomedev_libs, "cairo-svg >= 1.10", "Cairo", - "FIXME"); + "cairo-devel"); check_system_library(@gnomedev_libs, "glib-2.0 >= 2.28", "GLib", - "FIXME"); + "glib2-devel"); check_system_library(@gnomedev_libs, "gtk+-3.0 >= 3.0 gdk-3.0 gtk+-unix-print-3.0", "GTK+", - "FIXME"); + "gtk3-devel"); check_system_library(@gnomedev_libs, "pango >= 1.28", "Pango", - "FIXME"); + "pango-devel"); check_system_library(@gnomedev_libs, "librsvg-2.0", "RSVG", - "FIXME"); + "librsvg2-devel"); check_system_library(@gnomedev_libs, "atk", "ATK", - "FIXME"); + "atk-devel"); check_system_library(@gnomedev_libs, "gtksourceview-3.0", "GtkSourceView", - "FIXME"); + "gtksourceview3-devel"); check_system_library(@gnomedev_libs, "enchant", "Enchant", - "FIXME"); + "enchant-devel"); # check_system_library(@gnomedev_libs, # "gtkspell-3.0", @@ -1346,7 +1346,7 @@ if ($os eq "gentoo") { $vendor = "Specified"; } else { $vendor = "System"; - $jdk_home = $ENV{"JAVA_HOME"}; + $jdk_home = $ENV{"JDK_HOME"}; } $javac_candidate = "$jdk_home/bin/javac"; diff --git a/doc/design/1a-Homework.txt b/doc/design/1a-Homework.markdown similarity index 99% rename from doc/design/1a-Homework.txt rename to doc/design/1a-Homework.markdown index 59eded58..d9e67299 100644 --- a/doc/design/1a-Homework.txt +++ b/doc/design/1a-Homework.markdown @@ -1,4 +1,5 @@ Re-engineering (1): Homework +============================ BACKGROUND ========== diff --git a/doc/design/1b-AllAboutJNI.txt b/doc/design/1b-AllAboutJNI.markdown similarity index 99% rename from doc/design/1b-AllAboutJNI.txt rename to doc/design/1b-AllAboutJNI.markdown index 4ec9e763..dd9dbafb 100644 --- a/doc/design/1b-AllAboutJNI.txt +++ b/doc/design/1b-AllAboutJNI.markdown @@ -1,4 +1,5 @@ Re-engineering (1): The Java Native Interface +============================================= There's one other vitally important area of background information necessary to grok; I should have included this in the Homework email. It's hard to diff --git a/doc/design/2a-ObjectiveAndAudience.txt b/doc/design/2a-ObjectiveAndAudience.markdown similarity index 98% rename from doc/design/2a-ObjectiveAndAudience.txt rename to doc/design/2a-ObjectiveAndAudience.markdown index a255e9bc..557166a4 100644 --- a/doc/design/2a-ObjectiveAndAudience.txt +++ b/doc/design/2a-ObjectiveAndAudience.markdown @@ -1,6 +1,7 @@ Re-engineering (2): Objective and Audience +========================================== -Now that you've done your homework, we can talk about where we're going and +Now that you've done some homework, we can talk about where we're going and why. As I've said elsewhere on many occasions, I have the utmost respect for the diff --git a/doc/design/2b-DesignConstraints.txt b/doc/design/2b-DesignConstraints.markdown similarity index 99% rename from doc/design/2b-DesignConstraints.txt rename to doc/design/2b-DesignConstraints.markdown index 11ac2141..eedb1efa 100644 --- a/doc/design/2b-DesignConstraints.txt +++ b/doc/design/2b-DesignConstraints.markdown @@ -1,4 +1,5 @@ Re-engineering (2): Design constraints +====================================== The issue of audience described in my last message has a significant impact on our design. You've probably already guessed: diff --git a/doc/design/3a-PackageNames.txt b/doc/design/3a-PackageNames.markdown similarity index 99% rename from doc/design/3a-PackageNames.txt rename to doc/design/3a-PackageNames.markdown index c9c61a22..10edcb0d 100644 --- a/doc/design/3a-PackageNames.txt +++ b/doc/design/3a-PackageNames.markdown @@ -1,4 +1,5 @@ Re-engineering (3): Package names +================================= This is a minor matter, but while we're breaking everything anyway, several people have commented that the old java-gnome 2.x package names were _really_ diff --git a/doc/design/3b-VersionNumbers.txt b/doc/design/3b-VersionNumbers.markdown similarity index 98% rename from doc/design/3b-VersionNumbers.txt rename to doc/design/3b-VersionNumbers.markdown index fa4f231c..afacb83d 100644 --- a/doc/design/3b-VersionNumbers.txt +++ b/doc/design/3b-VersionNumbers.markdown @@ -1,4 +1,5 @@ Re-engineering (3): Version numbers +=================================== I've stated my [views about versioning](http://sourceforge.net/mailarchive/message.php?msg_id=3D15113906) diff --git a/doc/design/4a-TreeViewAndTreeModel.txt b/doc/design/4a-TreeViewAndTreeModel.markdown similarity index 98% rename from doc/design/4a-TreeViewAndTreeModel.txt rename to doc/design/4a-TreeViewAndTreeModel.markdown index 36e98e40..e4839e0f 100644 --- a/doc/design/4a-TreeViewAndTreeModel.txt +++ b/doc/design/4a-TreeViewAndTreeModel.markdown @@ -1,4 +1,5 @@ Re-engineering (4): TreeView and TreeModel API design +===================================================== A few weeks ago I wrote: diff --git a/doc/design/4b-ObjectProperties.txt b/doc/design/4b-ObjectProperties.markdown similarity index 99% rename from doc/design/4b-ObjectProperties.txt rename to doc/design/4b-ObjectProperties.markdown index c1b6ae45..44f4440d 100644 --- a/doc/design/4b-ObjectProperties.txt +++ b/doc/design/4b-ObjectProperties.markdown @@ -1,4 +1,5 @@ Re-engineering (4): GObject property handling API +================================================= I was chatting with Davyd last night about how I'd achieved a generalized setProperty() capability for GObjects in the new bindings. I wrote him an diff --git a/doc/design/5a-Architecture.txt b/doc/design/5a-Architecture.markdown similarity index 99% rename from doc/design/5a-Architecture.txt rename to doc/design/5a-Architecture.markdown index 0042cc11..ca6bc954 100644 --- a/doc/design/5a-Architecture.txt +++ b/doc/design/5a-Architecture.markdown @@ -1,4 +1,5 @@ Re-engineering (5): Internal Architecture +========================================= I have alluded several times to having worked out an architecture that I think will do nicely for us given the constraints that I have articulated. diff --git a/doc/design/START b/doc/design/START.markdown similarity index 89% rename from doc/design/START rename to doc/design/START.markdown index 296e344e..a461a6a9 100644 --- a/doc/design/START +++ b/doc/design/START.markdown @@ -32,28 +32,28 @@ The design documents are loosely organized according to the following scheme: 1. Background material: - * [The Great Owen Thread and other necessary homework](1a-Homework.html) - * [Java Native Interface](1b-AllAboutJNI.html) + * [The Great Owen Thread and other necessary homework](1a-Homework.markdown) + * [Java Native Interface](1b-AllAboutJNI.markdown) 2. Governing assumptions (our objective as a project, who our audience is, and what constraints we impose on ourselves as we go about our business): - * [Objective and Audience](2a-ObjectiveAndAudience.html) - * [Design Constraints](2b-DesignConstraints.html) + * [Objective and Audience](2a-ObjectiveAndAudience.markdown) + * [Design Constraints](2b-DesignConstraints.markdown) 3. Miscellaneous organizational decisions: - * [Package Names](3a-PackageNames.html) - * [Version Numbering](3b-VersionNumbers.html) + * [Package Names](3a-PackageNames.markdown) + * [Version Numbering](3b-VersionNumbers.markdown) 4. Discussion of public APIs: - * [TreeView, TreeModel](4a-TreeViewAndTreeModel.html) - * [GObject properties](4b-ObjectProperties.html) + * [TreeView, TreeModel](4a-TreeViewAndTreeModel.markdown) + * [GObject properties](4b-ObjectProperties.markdown) 5. Architecture: - * [Internal Architecture](5a-Architecture.html) + * [Internal Architecture](5a-Architecture.markdown) These numbers correspond to those used to organize the original threads on the java-gnome-hackers mailing list. All of these documents started life as emails @@ -67,13 +67,13 @@ About the format of our documentation These documents are all text files! They are, however, _**lightly**_ marked up with the syntax of John Gruber's "[Markdown][markdown]" so that they also -present nicely as web pages. See [`doc/style/MARKUP`](../style/MARKUP.html) +present nicely as web pages. See [`doc/style/MARKUP`](../style/MARKUP.markdown) for details. As conventions, we: * put the title of the document by itself on the first line of the file (the - script that renders these to HTML on our website picks this up as `` + script that renders these to markdown on our website picks this up as `<TITLE>` and top banner `<H1>` heading for the document), * note, _in italics_, the date of the last significant modification at the diff --git a/doc/examples/START b/doc/examples/START.markdown similarity index 99% rename from doc/examples/START rename to doc/examples/START.markdown index b2dfcc3c..a0b89b6c 100644 --- a/doc/examples/START +++ b/doc/examples/START.markdown @@ -1,4 +1,5 @@ EXAMPLES +======== These files are examples of specific parts of the java-gnome API worked up as complete Java programs. diff --git a/doc/examples/cairo/ExampleDrawingCurves.java b/doc/examples/cairo/ExampleDrawingCurves.java new file mode 100644 index 00000000..3b6ba428 --- /dev/null +++ b/doc/examples/cairo/ExampleDrawingCurves.java @@ -0,0 +1,107 @@ +/* + * java-gnome, a UI library for writing GTK and GNOME programs from Java! + * + * Copyright © 2007-2016 Operational Dynamics Consulting, Pty Ltd and Others + * + * The code in this file, and the program it is a part of, is made available + * to you by its authors as open source software: you can redistribute it + * and/or modify it under the terms of the GNU General Public License version + * 2 ("GPL") as published by the Free Software Foundation. + * + * This program 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 GPL for more details. + * + * You should have received a copy of the GPL along with this program. If not, + * see http://www.gnu.org/licenses/. The authors of this program may be + * contacted through http://java-gnome.sourceforge.net/. + */ +package cairo; + +import org.freedesktop.cairo.Context; +import org.freedesktop.cairo.LinearPattern; +import org.freedesktop.cairo.Pattern; +import org.freedesktop.cairo.RadialPattern; +import org.gnome.gdk.Event; +import org.gnome.gtk.DrawingArea; +import org.gnome.gtk.Gtk; +import org.gnome.gtk.Widget; +import org.gnome.gtk.Window; + +/** + * @author Will Temperley + * + * The curve_to example from: + * http://cairographics.org/samples/curve_to/ + * + * The red lines demonstrate the relationship between the + * start and end points of the curve and the control points. + * + * In depth discussion of the maths here: + * http://pomax.github.io/bezierinfo/ + * + */ +public class ExampleDrawingCurves +{ + + public static void main(String[] args) { + final Window w; + final DrawingArea d; + + Gtk.init(args); + + w = new Window(); + w.setTitle("Drawing"); + w.setDefaultSize(300, 300); + + d = new DrawingArea(); + w.add(d); + w.showAll(); + + d.connect(new Widget.Draw() { + public boolean onDraw(Widget source, Context cr) { + final Pattern linear, radial; + + /* + * Draw a bézier curve. + */ + double x=25.6, y=128.0; + double x1=102.4, y1=230.4, + x2=153.6, y2=25.6, + x3=230.4, y3=128.0; + + cr.moveTo (x, y); + cr.curveTo (x1, y1, x2, y2, x3, y3); + + cr.setLineWidth (10.0); + cr.stroke (); + + cr.setSource(1, 0.2, 0.2, 0.6); + cr.setLineWidth (6.0); + cr.moveTo (x,y); + cr.lineTo (x1,y1); + cr.moveTo (x2,y2); + cr.lineTo (x3,y3); + + cr.stroke(); + + + return true; + } + }); + + /* + * And that's it. Conclude with connecting the usual tear-down + * handler, and then fire up the main loop. + */ + + w.connect(new Window.DeleteEvent() { + public boolean onDeleteEvent(Widget source, Event event) { + Gtk.mainQuit(); + return false; + } + }); + + Gtk.main(); + } +} diff --git a/doc/style/CodeFormat.txt b/doc/style/CodeFormat.markdown similarity index 99% rename from doc/style/CodeFormat.txt rename to doc/style/CodeFormat.markdown index 470fd2c1..2a0d8c8e 100644 --- a/doc/style/CodeFormat.txt +++ b/doc/style/CodeFormat.markdown @@ -1,4 +1,5 @@ Style guide: Source Code +======================== Code Formatting =============== diff --git a/doc/style/CommitMessages.txt b/doc/style/CommitMessages.markdown similarity index 99% rename from doc/style/CommitMessages.txt rename to doc/style/CommitMessages.markdown index b32ab4d3..fcff570a 100644 --- a/doc/style/CommitMessages.txt +++ b/doc/style/CommitMessages.markdown @@ -1,4 +1,5 @@ Style guide: Commit Messages +============================ It might seem a bit anal to ask people to follow certain conventions when writing their commit messages, but reading code history is a big part of diff --git a/doc/style/Documentation.txt b/doc/style/Documentation.markdown similarity index 99% rename from doc/style/Documentation.txt rename to doc/style/Documentation.markdown index 0547edb1..ff8fee69 100644 --- a/doc/style/Documentation.txt +++ b/doc/style/Documentation.markdown @@ -1,4 +1,5 @@ Style guide: Documentation +========================== Text files ========== diff --git a/doc/style/MARKUP b/doc/style/MARKUP.markdown similarity index 99% rename from doc/style/MARKUP rename to doc/style/MARKUP.markdown index a7cca47e..9a8f006d 100644 --- a/doc/style/MARKUP +++ b/doc/style/MARKUP.markdown @@ -1,4 +1,5 @@ MARKUP +====== About the format of these documents ----------------------------------- diff --git a/src/bindings/org/freedesktop/bindings/Internationalization.c b/src/bindings/org/freedesktop/bindings/Internationalization.c index 21486330..6de59ef3 100644 --- a/src/bindings/org/freedesktop/bindings/Internationalization.c +++ b/src/bindings/org/freedesktop/bindings/Internationalization.c @@ -163,7 +163,7 @@ Java_org_freedesktop_bindings_Internationalization_bindtextdomain * from the environment. */ - if (setlocale(LC_ALL, "") == NULL) { + if (setlocale(LC_ALL, NULL) == NULL) { bindings_java_throw(env, "\nCall to setlocale() to initialize the program's locale failed"); return; } diff --git a/src/bindings/org/freedesktop/cairo/Context.java b/src/bindings/org/freedesktop/cairo/Context.java index 13613a44..6be5158c 100644 --- a/src/bindings/org/freedesktop/cairo/Context.java +++ b/src/bindings/org/freedesktop/cairo/Context.java @@ -334,6 +334,28 @@ public void lineTo(double x, double y) { checkStatus(); } + + /** + * Adds a cubic Bézier spline to the path from the current point to position (x3, y3) + * in user-space coordinates, using (x1, y1) and (x2, y2) as the control points. + * After this call the current point will be (x3, y3). If there is no current point + * before the call to this function, it will behave as if preceded by a call + * to {@link #moveTo(double, double)}. + * + * @param x1 the X coordinate of the first control point + * @param y1 the Y coordinate of the first control point + * @param x2 the X coordinate of the second control point + * @param y2 the Y coordinate of the second control point + * @param x3 the X coordinate of the end of the curve + * @param y3 the Y coordinate of the end of the curve + * + * @since 4.1.3 + */ + public void curveTo(double x1, double y1, double x2, double y2, double x3, double y3) { + CairoContext.curveTo(this, x1, y1, x2, y2, x3, y3); + checkStatus(); + } + /** * Set the line width for this Context. This will have effect in next call * to {@link #stroke()}. Default value is <code>2.0</code>. diff --git a/src/defs/CairoContext.defs b/src/defs/CairoContext.defs index 1b8ae480..2a79d74c 100644 --- a/src/defs/CairoContext.defs +++ b/src/defs/CairoContext.defs @@ -124,6 +124,20 @@ ) ) +(define-method curve_to + (of-object "cairo_t") + (c-name "cairo_curve_to") + (return-type "none") + (parameters + '("double" "x1") + '("double" "y1") + '("double" "x2") + '("double" "y2") + '("double" "x3") + '("double" "y3") + ) +) + (define-method rel_line_to (of-object "cairo_t") (c-name "cairo_rel_line_to") diff --git a/tests/bindings/org/freedesktop/enchant/ValidateEnchantInternals.java b/tests/bindings/org/freedesktop/enchant/ValidateEnchantInternals.java index 1ebaa800..c7850285 100644 --- a/tests/bindings/org/freedesktop/enchant/ValidateEnchantInternals.java +++ b/tests/bindings/org/freedesktop/enchant/ValidateEnchantInternals.java @@ -278,7 +278,7 @@ public final void testWordsWithPunctuation() { assertTrue(result); result = dict.check("system."); - assertTrue(result); + assertFalse(result); result = dict.check("systematic"); assertTrue(result); diff --git a/tests/bindings/org/gnome/gtk/ValidateGlobalSettings.java b/tests/bindings/org/gnome/gtk/ValidateGlobalSettings.java index 2cc92c14..37f2e31e 100644 --- a/tests/bindings/org/gnome/gtk/ValidateGlobalSettings.java +++ b/tests/bindings/org/gnome/gtk/ValidateGlobalSettings.java @@ -65,11 +65,11 @@ public final void testShowImagesOnButtons() { settings = Gtk.getSettings(); - assertTrue(settings.getButtonImages()); - settings.setButtonImages(false); assertFalse(settings.getButtonImages()); settings.setButtonImages(true); assertTrue(settings.getButtonImages()); + settings.setButtonImages(false); + assertFalse(settings.getButtonImages()); } public final void testShowImagesInMenus() { @@ -92,11 +92,11 @@ public final void testShowImagesInMenus() { * not have GLib die for lack of a GParamSpec. */ - assertTrue(settings.getMenuImages()); - settings.setMenuImages(false); assertFalse(settings.getMenuImages()); settings.setMenuImages(true); assertTrue(settings.getMenuImages()); + settings.setMenuImages(false); + assertFalse(settings.getMenuImages()); } public final void testShowInputMethodMenu() { @@ -104,13 +104,13 @@ public final void testShowInputMethodMenu() { settings = Gtk.getSettings(); - assertTrue(settings.getShowInputMethodMenu()); - - settings.setShowInputMethodMenu(false); assertFalse(settings.getShowInputMethodMenu()); settings.setShowInputMethodMenu(true); assertTrue(settings.getShowInputMethodMenu()); + + settings.setShowInputMethodMenu(false); + assertFalse(settings.getShowInputMethodMenu()); } public final void testShowUnicodeMenu() { @@ -118,12 +118,12 @@ public final void testShowUnicodeMenu() { settings = Gtk.getSettings(); - assertTrue(settings.getShowUnicodeMenu()); - - settings.setShowUnicodeMenu(false); assertFalse(settings.getShowUnicodeMenu()); settings.setShowUnicodeMenu(true); assertTrue(settings.getShowUnicodeMenu()); + + settings.setShowUnicodeMenu(false); + assertFalse(settings.getShowUnicodeMenu()); } }