Skip to content
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 6 additions & 14 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -300,27 +303,16 @@ 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!

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_

Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Re-engineering (1): Homework
============================

BACKGROUND
==========
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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_
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Re-engineering (4): TreeView and TreeModel API design
=====================================================

A few weeks ago I wrote:

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
22 changes: 11 additions & 11 deletions doc/design/START → doc/design/START.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 `<TITLE>`
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
Expand Down
1 change: 1 addition & 0 deletions doc/examples/START → doc/examples/START.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
EXAMPLES
========

These files are examples of specific parts of the java-gnome API worked up as
complete Java programs.
Expand Down
107 changes: 107 additions & 0 deletions doc/examples/cairo/ExampleDrawingCurves.java
Original file line number Diff line number Diff line change
@@ -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();
}
}
1 change: 1 addition & 0 deletions doc/style/CodeFormat.txt → doc/style/CodeFormat.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Style guide: Source Code
========================

Code Formatting
===============
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Style guide: Documentation
==========================

Text files
==========
Expand Down
1 change: 1 addition & 0 deletions doc/style/MARKUP → doc/style/MARKUP.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
MARKUP
======

About the format of these documents
-----------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
22 changes: 22 additions & 0 deletions src/bindings/org/freedesktop/cairo/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -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>.
Expand Down
Loading