Skip to content

Commit

Permalink
Merge pull request #28 from ruby-processing/compatibility
Browse files Browse the repository at this point in the history
major refactor
  • Loading branch information
monkstone authored Sep 23, 2018
2 parents e5800f1 + 5b63b33 commit 9f18793
Show file tree
Hide file tree
Showing 120 changed files with 96,349 additions and 27 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
**v2.9.0** No-one helped with think_open branch, that was trying to get ready for jdk9 (as compilable), so I'm abandoning 2.8.0 series, the 2.9.0 version will create an integrated jar and concentrate on compatibility, rather be future looking (but I'm not sure that think_different is any use or will work in future).

**v2.7.2** Slight re-factor of control_panel, fix virgin install of libraries folder, add grafica library examples suggest upgrade to jruby-9.1.17.0

**v2.7.1** Avoid calling protected method in control_panel (ready for jdk9)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ adjust above for your OS/distro setup.

## Requirements

- jdk8+ (jdk9 mostly works, see changelog, but is noisy)
- jruby-9.1.16.0
- mvn-3.5.0+
- processing-core.jar (_build only_) see [propane-core](https://github.com/ruby-processing/processing-core)
- `jdk8_u172`
- `jruby-9.1.16.0`
- `mvn-3.5.0+`
- `apple.jar` (_build only_) see [vanilla-processing](https://github.com/processing/processing/blob/master/core/apple.jar)

## Building and testing

Expand All @@ -23,7 +23,7 @@ rake javadoc
## Installation
```bash
jgem install propane # from rubygems
jgem install propane-2.7.1-java.gem # local install requires a custom processing-core
jgem install propane-2.9.0-java.gem # local install requires a custom processing-core
```

## Usage
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def create_manifest
File.open('MANIFEST.MF', 'w') do |f|
f.puts(title)
f.puts(version)
f.puts('Class-Path: processing-core.jar gluegen-rt-2.3.2.jar jog-all-2.3.2.jar')
f.puts('Class-Path: gluegen-rt-2.3.2.jar jog-all-2.3.2.jar')
end
end

Expand All @@ -21,7 +21,7 @@ end
desc 'Install'
task :install do
sh 'mvn dependency:copy'
sh 'mv target/propane.jar lib'
sh 'mv target/propane-2.9.0.jar lib'
end

desc 'Gem'
Expand Down
2 changes: 1 addition & 1 deletion lib/propane/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true
module Propane
VERSION = '2.7.2'.freeze
VERSION = '2.9.0'.freeze
end
508 changes: 508 additions & 0 deletions license.txt

Large diffs are not rendered by default.

26 changes: 19 additions & 7 deletions pom.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
require 'fileutils'
project 'rp5extras', 'https://github.com/monkstone/propane' do
project 'propane', 'https://github.com/monkstone/propane' do
model_version '4.0.0'
id 'propane:propane', '2.7.2'
id 'propane:propane:2.9.0'
packaging 'jar'
description 'rp5extras for propane'
description 'An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.'

organization 'ruby-processing', 'https://ruby-processing.github.io'
{ 'monkstone' => 'Martin Prout' }.each do |key, value|

{
'monkstone' => 'Martin Prout', 'benfry' => 'Ben Fry',
'REAS' => 'Casey Reas', 'codeanticode' => 'Andres Colubri'
}.each do |key, value|
developer key do
name value
roles 'developer'
end
end
license 'GPL 3', 'http://www.gnu.org/licenses/gpl-3.0-standalone.html'
license 'LGPL 2', 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html'
issue_management 'https://github.com/ruby-processing/propane/issues', 'Github'

source_control(
Expand Down Expand Up @@ -100,8 +106,14 @@
end

build do
default_goal 'package'
source_directory 'src'
final_name 'propane'
resource do
directory '${source.directory}/main/java'
includes ['**/**/*.glsl', '**/*.jnilib']
excludes '**/**/*.java'
end
resource do
directory '${source.directory}/main/resources'
includes ['**/*.png', '*.txt']
end
end
end
59 changes: 50 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ DO NOT MODIFIY - GENERATED CODE
<modelVersion>4.0.0</modelVersion>
<groupId>propane</groupId>
<artifactId>propane</artifactId>
<version>2.7.2</version>
<name>rp5extras</name>
<description>rp5extras for propane</description>
<version>2.9.0</version>
<name>propane</name>
<description>An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.</description>
<url>https://github.com/monkstone/propane</url>
<organization>
<name>ruby-processing</name>
Expand All @@ -24,6 +24,10 @@ DO NOT MODIFIY - GENERATED CODE
<name>GPL 3</name>
<url>http://www.gnu.org/licenses/gpl-3.0-standalone.html</url>
</license>
<license>
<name>LGPL 2</name>
<url>https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html</url>
</license>
</licenses>
<developers>
<developer>
Expand All @@ -33,6 +37,27 @@ DO NOT MODIFIY - GENERATED CODE
<role>developer</role>
</roles>
</developer>
<developer>
<id>benfry</id>
<name>Ben Fry</name>
<roles>
<role>developer</role>
</roles>
</developer>
<developer>
<id>REAS</id>
<name>Casey Reas</name>
<roles>
<role>developer</role>
</roles>
</developer>
<developer>
<id>codeanticode</id>
<name>Andres Colubri</name>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/ruby-processing/propane.git</connection>
Expand Down Expand Up @@ -62,9 +87,9 @@ DO NOT MODIFIY - GENERATED CODE
<type>pom</type>
</dependency>
<dependency>
<groupId>org.processing</groupId>
<artifactId>core</artifactId>
<version>3.3.7</version>
<groupId>com.apple.eawt</groupId>
<artifactId>apple</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.processing</groupId>
Expand All @@ -83,9 +108,25 @@ DO NOT MODIFIY - GENERATED CODE
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<defaultGoal>package</defaultGoal>
<finalName>propane</finalName>
<resources>
<resource>
<directory>${source.directory}/main/java</directory>
<includes>
<include>**/**/*.glsl</include>
<include>**/*.jnilib</include>
</includes>
<excludes>
<exclude>**/**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>${source.directory}/main/resources</directory>
<includes>
<include>**/*.png</include>
<include>*.txt</include>
</includes>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
Expand Down
5 changes: 2 additions & 3 deletions propane.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ Gem::Specification.new do |gem|
gem.summary = %q{ruby wrapper for processing-3.4 on MacOS and linux64 bit only for opengl}
gem.homepage = 'https://ruby-processing.github.io/propane/'
gem.files = `git ls-files`.split($/)
gem.files << 'lib/propane.jar'
gem.files << 'lib/processing-core.jar'
gem.files << 'lib/propane-2.9.0.jar'
gem.files << 'lib/gluegen-rt-2.3.2.jar'
gem.files << 'lib/jogl-all-2.3.2.jar'
gem.files << 'lib/gluegen-rt-2.3.2-natives-linux-amd64.jar'
Expand All @@ -30,5 +29,5 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency 'arcball', '~> 1.0', '>= 1.0.0'
gem.require_paths = ['lib']
gem.platform = 'java'
gem.requirements << 'java runtime >= 1.8.0_151+'
gem.requirements << 'java runtime >= 1.8.0_171+'
end
88 changes: 88 additions & 0 deletions src/main/java/japplemenubar/JAppleMenuBar.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
Part of the Processing project - http://processing.org
Copyright (c) 2011-12 hansi raber, released under LGPL under agreement
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, version 2.1.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
package japplemenubar;

import java.io.*;

import processing.core.PApplet;


/**
* Starting point for the application. General initialization should be done
* inside the ApplicationController's init() method. If certain kinds of
* non-Swing initialization takes too long, it should happen in a new Thread
* and off the Swing event dispatch thread (EDT).
*
* @author hansi
*/
public class JAppleMenuBar {
static JAppleMenuBar instance;
static final String FILENAME = "libjAppleMenuBar.jnilib";

static {
try {
File temp = File.createTempFile("processing", "menubar");
temp.delete(); // remove the file itself
temp.mkdirs(); // create a directory out of it
temp.deleteOnExit();

File jnilibFile = new File(temp, FILENAME);
InputStream input = JAppleMenuBar.class.getResourceAsStream(FILENAME);
if (input != null) {
if (PApplet.saveStream(jnilibFile, input)) {
System.load(jnilibFile.getAbsolutePath());
instance = new JAppleMenuBar();

} else {
sadness("Problem saving " + FILENAME + " for full screen use.");
}
} else {
sadness("Could not load " + FILENAME + " from core.jar");
}
} catch (IOException e) {
sadness("Unknown error, here's the stack trace.");
e.printStackTrace();
}
}


static void sadness(String msg) {
System.err.println("Full screen mode disabled. " + msg);
}


// static public void show() {
// instance.setVisible(true);
// }


static public void hide() {
instance.setVisible(false, false);
}


public native void setVisible(boolean visibility, boolean kioskMode);


// public void setVisible(boolean visibility) {
// // Keep original API in-tact. Default kiosk-mode to off.
// setVisible(visibility, false);
// }
}
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 9f18793

Please sign in to comment.